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

feat: support pass cred store #1070

Open
wants to merge 1 commit into
base: linux
Choose a base branch
from

Conversation

Shubhranshu153
Copy link
Contributor

@Shubhranshu153 Shubhranshu153 commented Aug 22, 2024

Issue #, if available:

Description of changes:
Feature to support pass cred store.

TODO:

  1. Add unit test
  2. Add documentation

Testing done:

Env:

  1. sudo yum install pass -y
  2. curl -fsSL https://github.com/docker/docker-credential-helpers/releases/download/v0.8.2/docker-credential-pass-v0.8.2.linux-amd64 -o docker-credential-pass
  3. chmod +x /usr/local/bin/docker-credential-pass
  4. sudo mv docker-credential-pass /usr/local/bin/

Test:

  1. Initialize Pass: sudo finch pass-init
  2. Config finch at /home/shubhum.linux/.finch/config.json:
{
        "credsStore": "pass"
}
  1. Get Account creds (any account)
  2. Run ECR login: aws ecr get-login-password --region us-west-2 | sudo DOCKER_CONFIG=/home/shubhum.linux/.finch/ ./_output/bin/finch login --username AWS --password-stdin .dkr.ecr.us-west-2.amazonaws.com
  3. Delete Pass: sudo finch pass-delete
  • I've reviewed the guidance in CONTRIBUTING.md

License Acceptance

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Signed-off-by: Shubharanshu Mahapatra <[email protected]>
)

func (pia *passInitAction) initGpgKey() command.Command {
passphrase := pwgen.GeneratePassword(passphraseLength, true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're not even asking users to enter a passphrase, can't we do this behind the scenes? Should we instead have a mechanism that initializes the cred store whenever a user modifies their creds_helpers to include pass?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

deletion is problematic,
i would prefer not taking responsibility of key management, if its done with a command customer has responsibility to manage key lifecycle.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can still have the commands, but if the commands require 0 user input, I don't see the harm in doing it for them

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i still feel if we create it the lifecycle is on us to manage for example key rotation etc. if it is automatically done finch has to won the management of the key.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of key rotation for a key where we don't even care about the password?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the key is compromised, we probably want to rotate it, and having set time to rotate it probably makes it harder to breach within certain time period.

passphrase := pwgen.GeneratePassword(passphraseLength, true)
ecc := command.NewExecCmdCreator()
cmd := ecc.Create(
"gpg2", "--batch", "--passphrase", passphrase, "--quick-gen-key", "finch")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this key expire after some default period?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

key doesnt expire, the key creation is owned by the customer so they would need to remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants