-
Notifications
You must be signed in to change notification settings - Fork 557
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 a policy-init using TUF metadata and Fulcio signers #469
Conversation
nice, thanks @asraa . I am not to familiar with the go-tuf client, so excuse my greenness. Is there anyway this root policy is fixed to the registry namespace (in the signed envelope), what would stop someone lifting this and putting into a different registry namespace? I was just thinking if we should stash the registry in the |
one more question, the |
Oops! The public value is the email, I accidentally hex encoded it. I'll update that and the output. The keyid is the hash over all of the key data (type, public value, scheme). This is to prevent someone a double signing if someone uses a different fulcio server.
That indeed is a TODO in the code! It seemed like the targets that are being signed (whose paths are specified) are always relative to the root... The root keys are supposed to be provided out of band, to establish initial trust. I have to give this some more thought. |
Thanks @asraa , happy to chat it over anytime. |
BTW some thoughts on this: the signing event sent to rekor should include the namespace (verifying that the signing happened in that registry namespace). verifying a policy added to a random registry should fail when verifying the signing event on rekor. WDYT? |
Yep, I agree. If the namespace is already in signed envelope that would mean it ends up in the log anyway? |
@lukehinds PR is updated so it at least points to me local fork with the changes in go-tuf that are needed Still working on:
|
Signed-off-by: Asra Ali <[email protected]>
Signed-off-by: Asra Ali <[email protected]>
@lukehinds I decided for ease of getting this in, I'll simplify and remove go-tuf dependency. PTAL just does the metadata generation, not the signing. |
Signed-off-by: Asra Ali <[email protected]>
@lukehinds let me know if the CLI I implemented was wrong -- I think we actually want a subcommand for
|
Looks good @Asra Yep , we need a sign operation next. Should we leverage an existing signer / json parse in go-tuf or implement our own? p.s. bit of coverage if you like https://github.com/lukehinds/cosign/blob/2256bb6a101e8a5f3d0710f524fd6104406690dd/cmd/cosign/cli/policy_init_test.go |
It's an improve from me, but i don't normally review a lot in cosign, so happy for @dlorenc @dekkagaijin and others to pitch in. |
I have a Sign method: cosign/pkg/cosign/tuf/signer.go Line 91 in b2ffe2c
I actually will punt this to the sign command PR |
Signed-off-by: Asra Ali <[email protected]>
Cleaned up, tests added, subcommand added so you run |
Signed-off-by: Asra Ali [email protected]
Hoping to iterate on this. This only initializes the root policy. We need to:
Replaces/uses code from
Current usage:
./cosign policy-init --namespace gcr.io/asra-ali/busybox --maintainers [email protected],[email protected] --threshold 2 --out root.json
The output file is (currently unsigned)