diff --git a/acl/policy_authorizer.go b/acl/policy_authorizer.go index af52418c25..9985c8feb1 100644 --- a/acl/policy_authorizer.go +++ b/acl/policy_authorizer.go @@ -524,6 +524,9 @@ func (p *policyAuthorizer) IntentionRead(prefix string, _ *AuthorizerContext) En // IntentionWrite checks if writing (creating, updating, or deleting) of an // intention is allowed. func (p *policyAuthorizer) IntentionWrite(prefix string, _ *AuthorizerContext) EnforcementDecision { + if prefix == "" { + return Deny + } if prefix == "*" { return p.allAllowed(p.intentionRules, AccessWrite) } diff --git a/agent/structs/intention.go b/agent/structs/intention.go index 15c4017645..c2240c4149 100644 --- a/agent/structs/intention.go +++ b/agent/structs/intention.go @@ -322,16 +322,7 @@ func (ixn *Intention) CanRead(authz acl.Authorizer) bool { } func (ixn *Intention) CanWrite(authz acl.Authorizer) bool { - if authz == acl.ManageAll() { - return true - } var authzContext acl.AuthorizerContext - - // TODO: this line seems to require checking 'authz == acl.ManageAll()' above - if ixn.DestinationName == "" { - return false - } - ixn.FillAuthzContext(&authzContext, true) return authz.IntentionWrite(ixn.DestinationName, &authzContext) == acl.Allow }