Skip to content
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

Intentions ACL enforcement updates #7028

Merged
merged 8 commits into from
Jan 13, 2020

Conversation

mkeeler
Copy link
Member

@mkeeler mkeeler commented Jan 10, 2020

This PR also contains the necessary OSS changes to support namespaces with Consul Enterprise.

Get rid of remnants of enterprise only renaming.

Add a WildcardName field for specifying what string should be used to indicate a wildcard.
For read operations they can call anyAllowed to determine if any read access to the given resource would be granted.

For write operations they can call allAllowed to ensure that write access is granted to everything.
@mkeeler mkeeler added this to the 1.7.0 milestone Jan 10, 2020
@mkeeler mkeeler requested a review from a team January 10, 2020 17:26
This also changes how intention:read is granted. Before the Intention.List RPC would allow viewing an intention if the token had intention:read on the destination. However Intention.Match allowed viewing if access was allowed for either the source or dest side. Now Intention.List and Intention.Get fall in line with Intention.Matches previous behavior.

Due to this being done a few different places ACL enforcement for a singular intention is now done with the CanRead and CanWrite methods on the intention itself.
Copy link
Contributor

@mkcp mkcp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really great work! 💯

There is one PLEASEFIX in agent/structs/intention_oss.go where a bunch of noops are implemented. I think a note on the file's intention, even as a TODO or a short explanation, will be key to inform future maintainers.

The remaining review notes are requests for additional docs and various curiosities I had about the codebase (mostly for my own learning). They are certainly non-blocking, and I trust you to use your best judgement as always for merging.

website/source/api/agent/connect.html.md Show resolved Hide resolved
agent/structs/structs.go Show resolved Hide resolved
agent/structs/intention_test.go Show resolved Hide resolved
agent/structs/intention_oss.go Show resolved Hide resolved
agent/structs/intention_oss.go Show resolved Hide resolved
agent/consul/intention_endpoint_test.go Show resolved Hide resolved
acl/policy_authorizer.go Outdated Show resolved Hide resolved
acl/policy_authorizer_test.go Show resolved Hide resolved
agent/consul/intention_endpoint.go Show resolved Hide resolved
agent/consul/intention_endpoint.go Show resolved Hide resolved
@mkeeler mkeeler force-pushed the feature/intention-acls-and-namespaces branch 2 times, most recently from fc8cd91 to 400cf62 Compare January 13, 2020 19:38
@mkeeler mkeeler force-pushed the feature/intention-acls-and-namespaces branch from 8bc8463 to 0915ede Compare January 13, 2020 20:24
@mkeeler
Copy link
Member Author

mkeeler commented Jan 13, 2020

I checked it out and the one failing test is a flake and unrelated to these changes (and it executes properly locally). Going to go ahead and merge this anyways.

@mkeeler mkeeler merged commit 8bd34e1 into master Jan 13, 2020
@mkeeler mkeeler deleted the feature/intention-acls-and-namespaces branch January 13, 2020 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants