Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onepassword lookup with service account #6635

Closed
1 task done
Domi-cc opened this issue Jun 7, 2023 · 7 comments · Fixed by #6660
Closed
1 task done

onepassword lookup with service account #6635

Domi-cc opened this issue Jun 7, 2023 · 7 comments · Fixed by #6660
Labels
feature This issue/PR relates to a feature request has_pr lookup lookup plugin plugins plugin (any type)

Comments

@Domi-cc
Copy link
Contributor

Domi-cc commented Jun 7, 2023

Summary

1password has new service accounts. via lookup should be possible to get secrets.

we can offer to contribute, but want to know, do you want a new lookup file for that, or should we try to expand: plugins/lookup/onepassword.py ?

Issue Type

Feature Idea

Component Name

lookup onepassword

Additional Information

Code of Conduct

  • I agree to follow the Ansible Code of Conduct
@ansibullbot
Copy link
Collaborator

Files identified in the description:

If these files are incorrect, please update the component name section of the description or use the !component bot command.

click here for bot help

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added feature This issue/PR relates to a feature request lookup lookup plugin plugins plugin (any type) labels Jun 7, 2023
@jansagurna
Copy link
Contributor

I would also like this feature and can help with a contribution.

@samdoran
Copy link
Contributor

samdoran commented Jun 7, 2023

Support for service accounts should be added to the existing onepassword and onepassword_raw lookups. The OP_SERVICE_ACCOUNT_TOKEN needs to be added to the environment running op commands and should be a new parameter

@Domi-cc
Copy link
Contributor Author

Domi-cc commented Jun 9, 2023

Hey @samdoran added the service_account_token. Works everything fine. Please review and feel free to change or improve the PR. Thanks!

@BlexToGo
Copy link

I was looking at using service accounts for my Ansible playbook since I need an initial sign in and don't want to use my master password with unrestricted read/write access to all vaults for security reasons, so I tried out @Domi-cc's fork directly instead of waiting for the 7.1.0 release by installing it via:

ansible-galaxy collection install [email protected]:Domi-cc/community.general.git,onepassword-lookup-add-service-accounts

And I can confirm that it works as expected. Had just to pass my generated token with the service_account_token parameter and could retrieve secrets from the corresponding vault.

@samdoran
Copy link
Contributor

This is indeed a much better way to do things than passing around the master password. I'm glad service account tokens are a thing now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature This issue/PR relates to a feature request has_pr lookup lookup plugin plugins plugin (any type)
Projects
None yet
5 participants