-
Notifications
You must be signed in to change notification settings - Fork 486
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
Final changes for RC2 based on sig-net review feedback #898
Final changes for RC2 based on sig-net review feedback #898
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: robscott 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 |
38f46eb
to
810411c
Compare
I agree with all three of these changes, I think that the call on ReferencePolicy /lgtm /hold I'll update the changelog again once this merges. |
// namespace. | ||
// | ||
// +optional | ||
Name *ObjectName `json:"name,omitempty"` |
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.
Should Name
be added to ReferenceFrom
for consistency?
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.
Despite the structural similarities of from and to, I think they're fundamentally different. Since this policy is in the referent namespace, it's helpful to be able to control which of your resources may be referenced. For example only granting access to a specific cert in a namespace that contains many.
On the other hand restricting access from resources you don't control by name is not particularly helpful. The resource owner in the other namespace can just use the allowed name, so it becomes quite easy to bypass any controls intended by the referent.
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.
In your certificate example, the reference policy allows all gateways from a namespace to reference a specific named certificate. A reasonable extension of that would be to let a specific gateway reference a specific certificate. The names can be aligned by controllers or by convention. However, control over the name of the referee does make this more of an operational safety mechanism than a security one, so maybe it is better not to muddy those concerns.
Not a blocker for me, anyway :)
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.
However, control over the name of the referee does make this more of an operational safety mechanism than a security one, so maybe it is better not to muddy those concerns.
That's a great way to differentiate these. Agree that it's best not to muddy those concerns yet, but if we start getting feedback/feature requests asking for from.name
, we should probably revisit this.
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
|
||
// Name is the name of the referent. When unspecified or empty, this policy | ||
// refers to all resources of the specified Group and Kind in the local | ||
// namespace. |
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.
Finally, woot!
There are three changes here: 1. The "Prefix" path match type has been renamed "PathPrefix" to leave room for a future "StringPrefix" match. 2. The "ClassName" field in PolicyTargetReference has been removed as it is not clearly necessary at this point. 3. A new optional "Name" field has been added to ReferencePolicyTo, enabling more fine grained control over which resource(s) may be referenced.
810411c
to
2b0cc91
Compare
I think we have consensus here, removing the hold, but still need a final LGTM. /hold cancel |
/lgtm |
What type of PR is this?
/kind cleanup
/kind api-change
What this PR does / why we need it:
There are three changes here, all based on feedback from @thockin in #861:
More thoughts on all of the above:
to.name
in ReferencePolicy has come up many times already, and even reappeared when I presented this concept to sig-auth. Although it's true that we could add this at a later point, it would be messier. Users would need to know whether the implementation they were using was new enough to support that particular field of ReferencePolicy, and if it wasn't you may be unknowingly allowing more references than intended. Although I've generally pushed to keep ReferencePolicy as simple as possible to start, this feels like an inevitable addition and it is significantly simpler to add this up front.Does this PR introduce a user-facing change?:
/hold for consensus
/cc @bowei @hbagdi @jpeach @youngnick