-
Notifications
You must be signed in to change notification settings - Fork 221
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
[TEP-0091] Update trusted resources feature flag and add condition #949
Conversation
Hi @afrittoli @wlynch @bobcatfish @jagathprakash |
36d2736
to
c741f0a
Compare
/kind tep |
c741f0a
to
2ea7d57
Compare
API WG - waiting for the review /assign @jagathprakash |
@pritidesai: GitHub didn't allow me to assign the following users: jagathprakash. Note that only tektoncd members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/lgtm |
@jagathprakash: changing LGTM is restricted to collaborators In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
teps/0091-trusted-resources.md
Outdated
* `skip`: Directly skip the verification. | ||
`resource-verification-mode`. (Optional, `verify_all`, `verify_match` or `no_verification`, default `no_verification`): | ||
* `verify_all`: Failing verification will mark the taskruns/pipelineruns as failed. | ||
* `verify_match`: Fetch VerificationPolicy from the namespace, and if policies matched then verify, otherwise skip the verification. Details explained in [ Verify the Resources](#verify-the-resources) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a good idea to support globally, though I get why we'd want something like this for incremental adoption. It would be generally be bad if Tasks could circumvent verification just by renaming to something that's not covered by policy, and new Tasks that are probably riskier would be exempted by default since they're unlikely to match existing policies.
Instead of making verification opt-in, it would probably be safer to make the mode opt-out on a per-policy basis (see ClusterImagePolicySpec.mode
for an example). This way things are directed to the more secure way by default, forcing users to either configure the matching policy or explicitly opt out the Tasks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! That makes sense. By looking at the ClusterImagePolicySpec.mode. How about changing the verify_match
to:
- If found matched polices then verify and fail
- If no matched policies then warn
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preferring warn over skip generally sounds good, but that doesn't address the larger problem of opt-in enforcement and the ability to evade enforcement by crafting a non-matching artifact. 😢
Having policies that opt-out matching patterns seems like a better global policy - this way new artifacts that we haven't encountered before (whether they are malicious or not) can't bypass enforcement.
Followed up with @Yongxuanzhang off thread - We're leaning towards modifying this slightly by:
If you want to have the same affect as what is proposed for
Much of this was inspired by https://github.com/sigstore/policy-controller so, feel free to take a look there to read up on additional background. We'll plan to discuss this more in next week's s3c working group, so please join if you have thoughts / opinions! 🙏 |
2ea7d57
to
0fd4c55
Compare
782f142
to
828e730
Compare
/assign @bobcatfish |
/assign @jagathprakash |
eab08cc
to
f883bbb
Compare
f883bbb
to
759435b
Compare
759435b
to
882467c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the addressing my feedback, the conditions are much clearer now 🎉
status: "False" | ||
type: TrustedResourcesVerified | ||
- lastTransitionTime: "2023-03-01T18:17:10Z" | ||
message: resource verification failed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
message: resource verification failed | |
message: Trusted resource verification failed |
@afrittoli @bobcatfish @jagathprakash @wlynch please take another look 🙏🏾 |
once all assignees have approved, feel free to unhold (just don't want it to merge accidentally) |
882467c
to
7c62627
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all the updates @Yongxuanzhang ! There's one last nit from me about referring to the "knative API" but nothing blocking
/approve
* `warn`: Don't fail the taskrun/pipelinerun and log a warning if no matching policies are found. | ||
* `fail`: Fail the taskrun/pipelinerun if no matching policies are found. | ||
|
||
**Note:** The current proposed `trusted-resources-verification-no-match-policy` will be added to replace the old `resource-verification-mode` in one release and this is not a backwards compatible change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is already on your radar, but please send a notification to tekton-dev@ and tekton-users@ to warn folks this is going to happen within one release, with some warning (at least a week I'm thinking?) before the release goes out 🙏
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bobcatfish, jerop The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This commit proposes to add mode field into VerificationPolicy, update the feature flag trusted-resources-verification-no-match-policy to control the behaviour of no matching policies for a resource. Besides this commit proposes to add condition into taskrun and pipelinerun to indicate the verification passes or not.
7c62627
to
96d45fe
Compare
/hold cancel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
This commit proposes to
mode
field intoVerificationPolicy
, update the feature flag toverification-no-match-policy
with allow / warn / deny