AccessPolicy resource in Omni.
At the moment, only Kubernetes cluster access (group impersonation) is supported.
Structure
AccessPolicy
The 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
A UserGroup is a group of users.
| Field | Type | Description |
|---|---|---|
users | array | List of Users. |
User
A 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
A ClusterGroup is a group of clusters.
| Field | Type | Description |
|---|---|---|
clusters | array | List of Clusters. |
Cluster
A 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
A 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 strings representing Kubernetes impersonation groups. |
Role
A Role is the role to grant to the user.
Possible values: None, Reader, Operator, Admin.
Test
A 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
A 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
A TestCluster is the cluster to use in a test case.
| Field | Type | Description |
|---|---|---|
name | string | Cluster name (ID). |
Expected
An 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 strings representing Kubernetes impersonation groups. |