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

Import secrets are received without any terminal history #267

Merged
merged 10 commits into from
Jan 19, 2023

Conversation

AbineshECAD
Copy link
Contributor

@AbineshECAD AbineshECAD commented Dec 14, 2022

Existing behaviour:
Secret key is part of the import cli command and available in cli history.
Behaviour with this fix
Secret key is not part of import cli. It is received fro user like a password. Not visible in cli history.

@codeclimate
Copy link

codeclimate bot commented Dec 14, 2022

Code Climate has analyzed commit 99d7210 and detected 0 issues on this pull request.

The test coverage on the diff in this pull request is 100.0% (50% is the threshold).

This pull request will bring the total coverage in the repository to 47.1% (0.0% change).

View more on Code Climate.

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Dec 14, 2022

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 99d7210
Status: ✅  Deploy successful!
Preview URL: https://c2d52b93.signatory.pages.dev
Branch Preview URL: https://secret-import.signatory.pages.dev

View logs

@AbineshECAD
Copy link
Contributor Author

AbineshECAD commented Dec 14, 2022

Test for empty secret input:

% ./signatory-cli import --vault kms --base-dir ./ -c ./s.yaml
INFO[0000] Initializing vault                            vault=cloudkms vault_name=kms
Enter secret key: 
Error: enter a valid secret key

Positive import for encrypted key:

% ./signatory-cli import --vault kms --base-dir ./ -c ./s.yaml
INFO[0000] Initializing vault                            vault=cloudkms vault_name=kms
Enter secret key: 
Enter Password: 
INFO[0009] Requesting import operation                   pkh=tz3be5v4ZWL3zQYUZoLWJQy8P3H6RJryVVXn vault=CloudKMS vault_name=projects/signatory-testing/locations/asia-south1/keyRings/signatory-abi
INFO[0012] Successfully imported                         key_id=projects/signatory-testing/locations/asia-south1/keyRings/signatory-abi/cryptoKeys/signatory-imported-2IvUdirA4yvh6AEiMSVfEnWpVxf/cryptoKeyVersions/1 pkh=tz3be5v4ZWL3zQYUZoLWJQy8P3H6RJryVVXn vault=CloudKMS vault_name=projects/signatory-testing/locations/asia-south1/keyRings/signatory-abi

cmd/commands/import.go Outdated Show resolved Hide resolved
cmd/commands/import.go Outdated Show resolved Hide resolved
cmd/commands/import.go Show resolved Hide resolved
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.

Don't save private keys in terminal history when importing keys via CLI
2 participants