-
Notifications
You must be signed in to change notification settings - Fork 8
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
Spike/remote verification #42
Merged
Merged
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
Couldn't call the command directly because it depends on a global variable rootOptions which is necessary for timeout, but that is actually good since we now can have more control over the options Used Cosign instead of the low level sigstore-go because Cosign will eventually depend on and its not going anywhere.
- Added the verify command - Added the verify flag for deploy - Integration test updated
…egistry Add upload-signatures flag in case user wants to upload to the registry
remove manual deployment with hardcoded values
…at the client For consistency with similar features.
...This might still run into some issues when removing and re-adding containers in a pod.
Added a few changes after reviewing the code. Looking good! (Note: changes are untested. Hopefully I didn't break anything.. too bad! 🥲) |
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.
Overview
This PR introduced image signing, verification, and policy enforcement & tpod application remote verification. It also includes various organizational enhancements to the codebase in an attempt to Fix #35.
Key Features:
Image Signing & Verification:
--upload-signatures
flagControl over Verification Settings:
Added VerificationDetails Field For images: Publisher can specify the following details that will be later used for image verification:
Added VerificationSettings field: has the following options:
Various Codebase enhancements: (re-organized and decoupled scripts for better maintainability and better flow during development)
How it works
Image Signing & verification: when the developer specify the
--sign-images
flag, the command (deploy/upload) will loop through the pod images, sign them by calling cosign methods. a certificate request will be sent to sigstore fulcio certificate authority and the signature is saved locally and in the registry (when specifying --upload-signatures
). and a new log is added in sigstore Rekor transparency log of this operation. verification is done the same way, given image information (URL, certificate identity & Issuer), the commands will call into cosign verify methods to get the signature (could specify the location locally with--signature-path
) verify the transparency log and the signature.Forcing Image Policy: Added sigstore policy controller chart which will watch for new created namespaces with
policy.sigstore.dev/include
label, this means that any image that exists in this namespace will be forced to match at least one image policy. which is why we create a policy per image with the image verification details. after creating the policy; the controller will automatically verify the image URL in the pods and make sure they originate from the identity & issuer specified otherwise deployment will fail.Remote application verification
Problem
Solution:
VerificationHost
inVerificationSettings
. the command will fetch the first HTTP Host and create a subdomain from it that will be used to retreive application information.app.apocryph.cloud
, another subdomain will be added automatically like this:app.apocryph.tpodinfo.cloud
tpod-proxy
which has the namespace name injected as an Environment variable.What cannot work
Since the namespace is enforcing the images to have matching policies, and since we cannot trust the deployer to create the tpod-proxy, it means it must be created by the official comrade-coop identity, which is why a global image policy is created and the template values for the identity and the issuer are set during deployment of the charts.
A cool feature about this approach is that due to the creation of the proxy alongisde the app within the same namespace, at least the provider is not doing "completely" free work and get a small execution fee for retrieving the info.
Tests
In both tests you must specify the identity and issuer for the images.
/test/integration/sigstore/run-test
/test/e2e/minikube/run-attestation-test.sh
(require a deployed apocryph cluster, you can set it up in/test/e2e/minikube/run-test.sh
Libraries