-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add priv key uri support to SignerStore #451
Merged
lukpueh
merged 1 commit into
repository-service-tuf:main
from
lukpueh:support-priv-key-uri
Feb 7, 2024
Merged
Add priv key uri support to SignerStore #451
lukpueh
merged 1 commit into
repository-service-tuf:main
from
lukpueh:support-priv-key-uri
Feb 7, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
implements option 2 from repository-service-tuf/repository-service-tuf#580 supersedes repository-service-tuf#427 (does not include a custom "relative file path signer", can be added in a follow-up PR) -- Change `SignerStore.get` to load non-cached signers from private key uri configured on the passed public key in a "x-rstuf-online-key-uri" field. If the public key does not include a uri, RSTUF_KEYVAULT_BACKEND is used as fallback. securesystemslib.signer.CryptoSigner is "registered" to load signers from private key files. No key specific secrets handling is added. This means the keys must be stored unencryped, preferrably using the secrets handling of the deployment platform (e.g. docker secrets). Default schemes in `securesystemslib.signer.SIGNER_FOR_URI_SCHEME` can be used but are untested. **Tests** Add test to load actual signer from private key file. Uses new unencrypted ed25519 private key copied from: secure-systems-lab/securesystemslib@7952c3f Public key stubs in other tests are updated, because signer store now reads the `unrecognized_fields` attribute, which is mandatory in Key objects. -- implements option 2 described in repository-service-tuf/repository-service-tuf#580 mostly supersedes repository-service-tuf#427 (does not include a custom "relative file path signer") Signed-off-by: Lukas Puehringer <[email protected]>
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #451 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 15 15
Lines 1035 1039 +4
=========================================
+ Hits 1035 1039 +4 ☔ View full report in Codecov by Sentry. |
lukpueh
added a commit
to lukpueh/repository-service-tuf-worker
that referenced
this pull request
Feb 6, 2024
Add test setup and test to load a signer from AWS KMS (localstack) via SignerStore (pending in repository-service-tuf#451), with 0 worker code changes. Run as `tox -e local-aws-kms` **Change details** * Add independent tox environment to init/cleanup localstack, configure ambient AWS KMS credentials, create a test key, and run the test. * Add test to "import" test public key from AWS KMS and configure private key URI - this would typically happen in a key management UI (e.g. RSTUF CLI) - and use `SignerStore.get` to load the signer. Signed-off-by: Lukas Puehringer <[email protected]>
This was referenced Feb 6, 2024
kairoaraujo
approved these changes
Feb 7, 2024
lukpueh
added a commit
to lukpueh/repository-service-tuf-worker
that referenced
this pull request
Feb 7, 2024
Add test setup and test to load a signer from AWS KMS (localstack) via SignerStore (pending in repository-service-tuf#451), with 0 worker code changes. Run as `tox -e local-aws-kms` **Change details** * Add independent tox environment to init/cleanup localstack, configure ambient AWS KMS credentials, create a test key, and run the test. * Add test to "import" test public key from AWS KMS and configure private key URI - this would typically happen in a key management UI (e.g. RSTUF CLI) - and use `SignerStore.get` to load the signer. Signed-off-by: Lukas Puehringer <[email protected]>
lukpueh
added a commit
to lukpueh/repository-service-tuf-worker
that referenced
this pull request
Feb 13, 2024
Add test setup and test to load a signer from AWS KMS (localstack) via SignerStore (pending in repository-service-tuf#451), with 0 worker code changes. Run as `tox -e local-aws-kms` **Change details** * Add independent tox environment to init/cleanup localstack, configure ambient AWS KMS credentials, create a test key, and run the test. * Add test to "import" test public key from AWS KMS and configure private key URI - this would typically happen in a key management UI (e.g. RSTUF CLI) - and use `SignerStore.get` to load the signer. Signed-off-by: Lukas Puehringer <[email protected]>
lukpueh
added a commit
to lukpueh/repository-service-tuf-worker
that referenced
this pull request
Feb 14, 2024
Add test setup and test to load a signer from AWS KMS (localstack) via SignerStore (pending in repository-service-tuf#451), with 0 worker code changes. Run as `tox -e local-aws-kms` **Change details** * Add independent tox environment to init/cleanup localstack, configure ambient AWS KMS credentials, create a test key, and run the test. * Add test to "import" test public key from AWS KMS and configure private key URI - this would typically happen in a key management UI (e.g. RSTUF CLI) - and use `SignerStore.get` to load the signer. Signed-off-by: Lukas Puehringer <[email protected]>
kairoaraujo
pushed a commit
to lukpueh/repository-service-tuf-worker
that referenced
this pull request
Mar 2, 2024
Add test setup and test to load a signer from AWS KMS (localstack) via SignerStore (pending in repository-service-tuf#451), with 0 worker code changes. Run as `tox -e local-aws-kms` **Change details** * Add independent tox environment to init/cleanup localstack, configure ambient AWS KMS credentials, create a test key, and run the test. * Add test to "import" test public key from AWS KMS and configure private key URI - this would typically happen in a key management UI (e.g. RSTUF CLI) - and use `SignerStore.get` to load the signer. Signed-off-by: Lukas Puehringer <[email protected]>
kairoaraujo
pushed a commit
to lukpueh/repository-service-tuf-worker
that referenced
this pull request
Mar 7, 2024
Add test setup and test to load a signer from AWS KMS (localstack) via SignerStore (pending in repository-service-tuf#451), with 0 worker code changes. Run as `tox -e local-aws-kms` **Change details** * Add independent tox environment to init/cleanup localstack, configure ambient AWS KMS credentials, create a test key, and run the test. * Add test to "import" test public key from AWS KMS and configure private key URI - this would typically happen in a key management UI (e.g. RSTUF CLI) - and use `SignerStore.get` to load the signer. Signed-off-by: Lukas Puehringer <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
implements option 2 from repository-service-tuf/repository-service-tuf#580
supersedes #427 (does not include a custom "relative file path signer", can be added in a follow-up PR)
--
Change
SignerStore.get
to load non-cached signers from private key uri configured on the passed public key in a "x-rstuf-online-key-uri" field.If the public key does not include a uri, RSTUF_KEYVAULT_BACKEND is used as fallback.
securesystemslib.signer.CryptoSigner is "registered" to load signers from private key files. No key specific secrets handling is added. This means the keys must be stored unencryped, preferrably using the secrets handling of the deployment platform (e.g. docker secrets).
Default schemes in
securesystemslib.signer.SIGNER_FOR_URI_SCHEME
can be used but are untested.Tests
Add test to load actual signer from private key file.
Uses new unencrypted ed25519 private key copied from: secure-systems-lab/securesystemslib@7952c3f
Public key stubs in other tests are updated, because signer store now reads the
unrecognized_fields
attribute, which is mandatory in Key objects.