Repository navigation
Commit 06be9fb
committed
fix(cozystack-basics): narrow trustedCaller to explicit cozystack group list
Address review feedback from kitsunoff on
packages/system/cozystack-basics/templates/gateway-hostname-policy.yaml:120:
startsWith("system:serviceaccount:cozy-") without a trailing colon trusted
any ServiceAccount in any namespace whose name begins with cozy- — including
a hypothetical attacker-controlled cozy-evil namespace. Creating such a
namespace requires cluster-admin today, so this is not an active escalation
path, but it is an unnecessarily wide trust boundary for a defense-in-depth
check.
Switch both tenant-host-policy and namespace-host-label-policy to a
group-based check that matches the exact system:serviceaccounts:<ns> group
for cozy-system, cozy-cert-manager, flux-system and kube-system. Every SA
in those namespaces is a member of that group automatically, so there is no
behaviour regression for cozystack's own controllers.
Assisted-By: Claude <[email protected]>
Signed-off-by: Aleksei Sviridkin <[email protected]>1 parent b49ee24 commit 06be9fb
1 file changed
Lines changed: 12 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
124 | 126 | | |
125 | 127 | | |
126 | 128 | | |
| |||
165 | 167 | | |
166 | 168 | | |
167 | 169 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
172 | 176 | | |
173 | 177 | | |
174 | 178 | | |
| |||
0 commit comments