AccessPolicy
resource in Omni.
At the moment, only Kubernetes cluster access (group impersonation) is supported.
AccessPolicy
AccessPolicy
is a single resource containing a set of user groups, a set of cluster groups, a list of matching rules and a list of tests.
Field | Type | Description |
---|---|---|
metadata.namespace | string | Always set to default . |
metadata.type | string | AccessPolicies.omni.sidero.dev . |
metadata.id | string | Always set to access-policy . |
spec.usergroups | map[string]UserGroup | Map of user group names to user group definitions. |
spec.clustergroups | map[string]ClusterGroup | Map of cluster group names to cluster group definitions. |
spec.rules | array | List of rules to match. |
spec.tests | array | List of tests to run when the resource is created or updated. |
UserGroup
UserGroup
is a group of users.
Field | Type | Description |
---|---|---|
users | array | List of Users. |
User
User
is a single user.
Field | Type | Description |
---|---|---|
name | string | User identity used to authenticate to Omni. |
match | string | fnmatch expression to match user identities. |
labelselectors | array | List of label selector strings. |
name
, match
and labelselectors
are mutually exclusive. Only one of them can be set to a non-zero value.
ClusterGroup
ClusterGroup
is a group of clusters.
Field | Type | Description |
---|---|---|
clusters | array | List of Clusters. |
Cluster
Cluster
is a single cluster.
Field | Type | Description |
---|---|---|
name | string | Cluster name (ID). |
match | fnmatch expression to match cluster names (IDs). |
name
and match
are mutually exclusive. Only one of them can be set to a non-zero value.
Rule
Rule
is a set of users, clusters and Kubernetes impersonation groups.
The reserved prefix group/
is used to reference a user group in users
or a cluster group in clusters
.
Field | Type | Description |
---|---|---|
users | array | List of Users or UserGroups. |
clusters | array | List of Clusters or ClusterGroups. |
role | enum | Role to grant to the user. |
kubernetes.impersonate.groups | array | List of string s representing Kubernetes impersonation groups. |
Role
Role
is the role to grant to the user.
Possible values: None
, Reader
, Operator
, Admin
.
Test
Test
is a single test case.
Test cases are run when the resource is created or updated, and if any of them fail, the operation is rejected.
Field | Type | Description |
---|---|---|
name | string | Human-friendly test case name. |
user | TestUser | User identity to use in the test. |
cluster | TestCluster | Cluster to use in the test. |
expected | Expected | Expected result. |
TestUser
TestUser
is the user identity to use in a test case.
Field | Type | Description |
---|---|---|
name | string | User identity to use in the test. |
labels | map[string]string | Map of label names to label values. |
TestCluster
TestCluster
is the cluster to use in a test case.
Field | Type | Description |
---|---|---|
name | string | Cluster name (ID). |
Expected
Expected
is the expected results of a test case.
Field | Type | Description |
---|---|---|
role | enum | Role to grant to the user. |
kubernetes.impersonate.groups | array | List of string s representing Kubernetes impersonation groups. |