Files
cozystack/packages/system/cozystack-api/tests/rbac_test.yaml
T
Aleksei SviridkinandTimofei Larkin 8ac68b24e9 feat(cozystack-api): register sdn APIService and SecurityGroup RBAC
Register the v1alpha1.sdn.cozystack.io aggregated APIService, grant the
cozystack-api ServiceAccount full access to CiliumNetworkPolicy (the
backing object for SecurityGroup), and let tenants self-service their
SecurityGroups: full access in the base tenant role and read access in
the view role, mirroring how apps.cozystack.io resources are exposed.

Assisted-By: Claude <noreply@anthropic.com>
Signed-off-by: Aleksei Sviridkin <f@lex.la>
Co-authored-by: Timofei Larkin <lllamnyp@gmail.com>
2026-06-22 16:35:10 +03:00

44 lines
1.6 KiB
YAML

suite: cozystack-api ClusterRole grants Option provider sources
templates:
- templates/rbac.yaml
release:
name: cozystack-api
namespace: cozy-system
# The Option (dropdown) providers run with the cozystack-api ServiceAccount's
# privileged client, so every GVR a provider lists must be granted on this
# ClusterRole. The plan/backup providers list namespaced plans/backups in the
# backups.cozystack.io group; without read access there the apiserver returns
# forbidden and List silently drops those dropdowns (Get returns 500). The
# bare cozystack.io grant does NOT cover backups.cozystack.io — RBAC matches
# the API group string exactly.
tests:
- it: grants read on backups.cozystack.io plans and backups for the plan/backup providers
asserts:
- contains:
path: rules
content:
apiGroups: ["backups.cozystack.io"]
resources: ["backupclasses", "plans", "backups"]
verbs: ["get", "watch", "list"]
- it: does not grant objectstorage.k8s.io bucketclasses (no provider reads it)
asserts:
- notContains:
path: rules
content:
apiGroups: ["objectstorage.k8s.io"]
resources: ["bucketclasses"]
verbs: ["get", "watch", "list"]
- it: grants full access on cilium.io ciliumnetworkpolicies for SecurityGroup storage
asserts:
- contains:
path: rules
content:
apiGroups: ["cilium.io"]
resources: ["ciliumnetworkpolicies"]
verbs: ["get", "watch", "list", "create", "update", "patch", "delete"]