Skip to content

Commit

Permalink
AuthorizationPolicy: add serviceAccounts field (#3340)
Browse files Browse the repository at this point in the history
* AuthorizationPolicy: add `serviceAccounts` field

This is a minor implementation complexity in favor of a dramatic
simplification to usage of Istio authorization.

Today, if a user wants to dive into zero-trust 101, they are presented
with a requirement to set `principals`: `A list of peer identities
derived from the peer certificate`, and write
`<TRUST_DOMAIN>/ns/<NAMESPACE>/sa/<SERVICE_ACCOUNT>`.

This simple sentance is a huge cognitive overload for users in my
experience working with users, and unnecesarily pushes SPIFFE, trust
domains, and other unneccesary concepts onto users. Additionally, the
requirement to set 'trust domain', which is overwhelmingly not desired
by users who just want SA auth, leads to all sorts of wonky workarounds
in Istio like `cluster.local` being a magic value.

Instead, we just add a SA field directly. This takes the format `ns/sa`,
as you cannot safely reference a SA without a namespace field as well.
Note we do this, rather than just require you to set 'service account' and 'namespace'
as individual fields, since you could have `namespace=[a,b],sa=[d,e]`
which is ambiguous.

If this is directionally approved, I will add some more documentation
and CEL validation and testing.

* Tests and validation

* add doc

* Clarify comment that this is a KSA
  • Loading branch information
howardjohn authored Dec 18, 2024
1 parent c363ca7 commit 27d505c
Show file tree
Hide file tree
Showing 7 changed files with 290 additions and 34 deletions.
44 changes: 44 additions & 0 deletions kubernetes/customresourcedefinitions.gen.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions security/v1/authorization_policy_alias.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

114 changes: 80 additions & 34 deletions security/v1beta1/authorization_policy.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 26 additions & 0 deletions security/v1beta1/authorization_policy.pb.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 27d505c

Please sign in to comment.