Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CNS-2801 - Minimize the operator's RBAC access #163

Merged
merged 22 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
14a7062
Change namespace to be a value on the Controller and StateApplier ins…
ltsonov-cb Jun 28, 2023
f83633e
Add env var to pass the operator's namespace into the code and use it…
ltsonov-cb Jun 28, 2023
2992c16
Add a description to the Namespace field to indicate it is deprecated…
ltsonov-cb Jun 28, 2023
e7501ea
Reduce operator workload permissions to a role instead of ClusterRole
ltsonov-cb Jun 28, 2023
81d45b6
Move dataplane RBAC to a subfolder to separate operator vs dataplane
ltsonov-cb Jun 30, 2023
b2081f6
Commit generated file diff
ltsonov-cb Jun 30, 2023
5b1187a
Add dataplane files to the kustomization
ltsonov-cb Jun 30, 2023
3523583
Remove duplicated Dataplane items
ltsonov-cb Jun 30, 2023
4dce536
Keep the old ClusterRoleBinding name to avoid duplicates if redeployi…
ltsonov-cb Jun 30, 2023
da611d4
Restrict PriorityClass RBAC
ltsonov-cb Jun 30, 2023
aafec7a
Restrict webhook RBAC by resource name when possible
ltsonov-cb Jul 3, 2023
4aa8c4a
Move dataplane RBAC objects to the operator chart - so the agent char…
ltsonov-cb Jul 3, 2023
02b1a53
Update Readmes to match the "same-namespace" enforcement. Remove refe…
ltsonov-cb Jul 3, 2023
d6c14de
Sync operator.yaml in the chart with RBAC changes and some missing it…
ltsonov-cb Jul 4, 2023
f7b05fd
Bump charts version due to breaking changes. Bumped app version there…
ltsonov-cb Jul 4, 2023
6e5d7bc
Minor comment change
ltsonov-cb Jul 4, 2023
d56ec34
Added some explanation behind the RBAC setup and how to update it
ltsonov-cb Jul 4, 2023
761070d
Update deployment.yaml to also mount the namespace env var
ltsonov-cb Jul 4, 2023
0b247de
Replace namespace var in dataplane_rbac.yaml
ltsonov-cb Jul 4, 2023
5c0c648
Added deprecation notice as godoc to CRD.Namespace
ltsonov-cb Jul 11, 2023
60f0303
Add Namespace to each component's constructor. Don't set the namespac…
ltsonov-cb Jul 11, 2023
acc9591
Removed the public registry secret from all dataplane accounts since …
ltsonov-cb Jul 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions api/v1/cbcontainersagent_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ type CBContainersAgentSpec struct {
ClusterName string `json:"clusterName,required"`
Version string `json:"version,required"`
Gateways CBContainersGatewaysSpec `json:"gateways,required"`
// The field below remains to avoid moving the CRD from v1 to v2.
// It MUST not be used as agent namespace should be controlled outside the operator itself.
// This is because a custom namespace in the CRD requires high privileges by the operator across the whole cluster to be able to "switch" namespaces on demand.

// +kubebuilder:default:="cbcontainers-dataplane"
// Namespace is deprecated and the value has no effect. Do not use.
ltsonov-cb marked this conversation as resolved.
Show resolved Hide resolved
Namespace string `json:"namespace,omitempty"`
// +kubebuilder:default:="cbcontainers-access-token"
AccessTokenSecretName string `json:"accessTokenSecretName,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions cbcontainers/state/components/cluster_configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ func (obj *ConfigurationK8sObject) MutateK8sObject(k8sObject client.Object, agen
return fmt.Errorf("expected ConfigMap K8s object")
}

configMap.Namespace = agentSpec.Namespace
configMap.Namespace = obj.Namespace
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't really matter
Is this line necessary? (and in other files)
The function NamespacedName takes care on this.
Just so we won't have confusion in the future.

I also wrote a comment next to the c.SetNamespace() in state applier about passing the namespace as a parameter to DesiredK8sObjectes New functions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done - both the constructor and removing these lines.

configMap.Data = map[string]string{
commonState.DataPlaneConfigmapAccountKey: agentSpec.Account,
commonState.DataPlaneConfigmapClusterKey: agentSpec.ClusterName,
commonState.DataPlaneConfigmapAgentVersionKey: agentSpec.Version,
commonState.DataPlaneConfigmapDataplaneNamespaceKey: agentSpec.Namespace,
commonState.DataPlaneConfigmapDataplaneNamespaceKey: configMap.Namespace,
commonState.DataPlaneConfigmapApiSchemeKey: agentSpec.Gateways.ApiGateway.Scheme,
commonState.DataPlaneConfigmapApiHostKey: agentSpec.Gateways.ApiGateway.Host,
commonState.DataPlaneConfigmapApiPortKey: strconv.Itoa(agentSpec.Gateways.ApiGateway.Port),
Expand Down
3 changes: 1 addition & 2 deletions cbcontainers/state/components/enforcer_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,7 @@ func (obj *EnforcerDeploymentK8sObject) MutateK8sObject(k8sObject client.Object,
if objectsDiffer(deployment.Spec.Template.Spec.ImagePullSecrets, desiredImagePullSecrets) {
deployment.Spec.Template.Spec.ImagePullSecrets = desiredImagePullSecrets
}
obj.Namespace = agentSpec.Namespace
deployment.Namespace = agentSpec.Namespace
deployment.Namespace = obj.Namespace
obj.mutateAnnotations(deployment, enforcer)
obj.mutateVolumes(&deployment.Spec.Template.Spec)
obj.mutateAffinityAndNodeSelector(&deployment.Spec.Template.Spec, enforcer)
Expand Down
10 changes: 5 additions & 5 deletions cbcontainers/state/components/enforcer_mutating_webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ func (obj *EnforcerMutatingWebhookK8sObject) MutateK8sObject(k8sObject client.Ob

enforcer := &agentSpec.Components.Basic.Enforcer
obj.mutateWebhookConfigurationLabels(webhookConfiguration, enforcer)
return obj.mutateWebhooks(webhookConfiguration, enforcer, agentSpec.Namespace)
return obj.mutateWebhooks(webhookConfiguration, enforcer)
}

func (obj *EnforcerMutatingWebhookK8sObject) mutateWebhooks(webhookConfiguration adapters.WebhookConfigurationAdapter, enforcer *cbcontainersv1.CBContainersEnforcerSpec, serviceNamespace string) error {
func (obj *EnforcerMutatingWebhookK8sObject) mutateWebhooks(webhookConfiguration adapters.WebhookConfigurationAdapter, enforcer *cbcontainersv1.CBContainersEnforcerSpec) error {
var resourcesWebhookObj adapters.WebhookAdapter

initializeWebhooks := false
Expand All @@ -93,7 +93,7 @@ func (obj *EnforcerMutatingWebhookK8sObject) mutateWebhooks(webhookConfiguration
resourcesWebhookObj = updatedWebhooks[0]
}

obj.mutateResourcesWebhook(resourcesWebhookObj, enforcer.WebhookTimeoutSeconds, enforcer.FailurePolicy, serviceNamespace)
obj.mutateResourcesWebhook(resourcesWebhookObj, enforcer.WebhookTimeoutSeconds, enforcer.FailurePolicy)
return nil
}

Expand All @@ -107,7 +107,7 @@ func (obj *EnforcerMutatingWebhookK8sObject) findWebhookByName(webhooks []adapte
return nil, false
}

func (obj *EnforcerMutatingWebhookK8sObject) mutateResourcesWebhook(resourcesWebhook adapters.WebhookAdapter, timeoutSeconds int32, failurePolicy, serviceNamespace string) {
func (obj *EnforcerMutatingWebhookK8sObject) mutateResourcesWebhook(resourcesWebhook adapters.WebhookAdapter, timeoutSeconds int32, failurePolicy string) {
resourcesWebhook.SetName(MutatingWebhookName)
resourcesWebhook.SetFailurePolicy(failurePolicy)
resourcesWebhook.SetSideEffects(MutatingWebhookSideEffect)
Expand All @@ -123,7 +123,7 @@ func (obj *EnforcerMutatingWebhookK8sObject) mutateResourcesWebhook(resourcesWeb
}
resourcesWebhook.SetCABundle(obj.tlsSecretValues.CaCert)
resourcesWebhook.SetServiceName(EnforcerName)
resourcesWebhook.SetServiceNamespace(serviceNamespace)
resourcesWebhook.SetServiceNamespace(obj.ServiceNamespace)
resourcesWebhook.SetServicePath(&MutatingWebhookPath)
}

Expand Down
2 changes: 1 addition & 1 deletion cbcontainers/state/components/enforcer_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func (obj *EnforcerServiceK8sObject) MutateK8sObject(k8sObject client.Object, ag

service.Labels = enforcer.Labels
service.Spec.Type = coreV1.ServiceTypeClusterIP
service.Namespace = agentSpec.Namespace
service.Namespace = obj.Namespace
service.Spec.Selector = map[string]string{
EnforcerLabelKey: EnforcerName,
}
Expand Down
2 changes: 1 addition & 1 deletion cbcontainers/state/components/enforcer_tls_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (obj *EnforcerTlsK8sObject) MutateK8sObject(k8sObject client.Object, spec *
return fmt.Errorf("expected Secret K8s object")
}

secret.Namespace = spec.Namespace
secret.Namespace = obj.Namespace
tlsSecretValues, err := obj.tlsSecretsValuesCreator.CreateTlsSecretsValues(types.NamespacedName{Name: EnforcerName, Namespace: obj.Namespace})
if err != nil {
return err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ func (obj *ImageScanningReporterDeploymentK8sObject) MutateK8sObject(k8sObject c
}

clusterScanning := &agentSpec.Components.ClusterScanning
deployment.Namespace = agentSpec.Namespace
deployment.Namespace = obj.Namespace
imageScanningReporter := &clusterScanning.ImageScanningReporter
obj.initiateDeployment(deployment, agentSpec)
obj.mutateLabels(deployment, imageScanningReporter)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func (obj *ImageScanningReporterServiceK8sObject) MutateK8sObject(k8sObject clie

imageScanningReporter := &agentSpec.Components.ClusterScanning.ImageScanningReporter

service.Namespace = agentSpec.Namespace
service.Namespace = obj.Namespace
service.Labels = imageScanningReporter.Labels
service.Spec.Type = coreV1.ServiceTypeClusterIP
service.Spec.Selector = map[string]string{
Expand Down
2 changes: 1 addition & 1 deletion cbcontainers/state/components/monitor_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ func (obj *MonitorDeploymentK8sObject) MutateK8sObject(k8sObject client.Object,
deployment.Spec.Template.ObjectMeta.Annotations = make(map[string]string)
}

deployment.Namespace = agentSpec.Namespace
deployment.Namespace = obj.Namespace
deployment.Spec.Replicas = &MonitorReplicas
deployment.ObjectMeta.Labels = desiredLabels
deployment.Spec.Selector.MatchLabels = desiredLabels
Expand Down
2 changes: 1 addition & 1 deletion cbcontainers/state/components/registry_secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (obj *RegistrySecretK8sObject) MutateK8sObject(k8sObject client.Object, spe

secret.Type = obj.registrySecretValues.Type
secret.Data = obj.registrySecretValues.Data
secret.Namespace = spec.Namespace
secret.Namespace = obj.Namespace

return nil
}
2 changes: 1 addition & 1 deletion cbcontainers/state/components/resolver_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func (obj *ResolverServiceK8sObject) MutateK8sObject(k8sObject client.Object, ag
service.Spec.Type = coreV1.ServiceTypeClusterIP
service.Spec.ClusterIP = coreV1.ClusterIPNone

service.Namespace = agentSpec.Namespace
service.Namespace = obj.Namespace
service.Spec.Selector = map[string]string{
resolverLabelKey: ResolverName,
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func (obj *ResolverDeploymentK8sObject) MutateK8sObject(k8sObject client.Object,
}
}

deployment.Namespace = agentSpec.Namespace
deployment.Namespace = obj.Namespace
deployment.Spec.Replicas = replicasCount
deployment.ObjectMeta.Labels = desiredLabels
deployment.Spec.Selector.MatchLabels = desiredLabels
Expand Down
2 changes: 1 addition & 1 deletion cbcontainers/state/components/sensor_daemon_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ func (obj *SensorDaemonSetK8sObject) MutateK8sObject(k8sObject client.Object, ag
daemonSet.Spec.Template.Spec.HostPID = false
}

daemonSet.Namespace = agentSpec.Namespace
daemonSet.Namespace = obj.Namespace
obj.mutateLabels(daemonSet, agentSpec)
obj.mutateAnnotations(daemonSet, agentSpec)
obj.mutateVolumes(daemonSet, agentSpec)
Expand Down
2 changes: 1 addition & 1 deletion cbcontainers/state/components/state_reporter_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (obj *StateReporterDeploymentK8sObject) MutateK8sObject(k8sObject client.Ob
deployment.Spec.Template.ObjectMeta.Annotations = make(map[string]string)
}

deployment.Namespace = agentSpec.Namespace
deployment.Namespace = obj.Namespace
deployment.Spec.Replicas = &StateReporterReplicas
deployment.ObjectMeta.Labels = desiredLabels
deployment.Spec.Selector.MatchLabels = desiredLabels
Expand Down
12 changes: 4 additions & 8 deletions cbcontainers/state/state_applier.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ type StateApplier struct {
imageScanningReporterService *components.ImageScanningReporterServiceK8sObject
applier AgentComponentApplier
log logr.Logger
agentNamespace string
}

func NewStateApplier(apiReader client.Reader, agentComponentApplier AgentComponentApplier, k8sVersion string, tlsSecretsValuesCreator components.TlsSecretsValuesCreator, log logr.Logger) *StateApplier {
func NewStateApplier(apiReader client.Reader, agentComponentApplier AgentComponentApplier, k8sVersion, agentNamespace string, tlsSecretsValuesCreator components.TlsSecretsValuesCreator, log logr.Logger) *StateApplier {
return &StateApplier{
desiredConfigMap: components.NewConfigurationK8sObject(),
desiredRegistrySecret: components.NewRegistrySecretK8sObject(),
Expand All @@ -60,6 +61,7 @@ func NewStateApplier(apiReader client.Reader, agentComponentApplier AgentCompone
imageScanningReporterService: components.NewImageScanningReporterServiceK8sObject(),
applier: agentComponentApplier,
log: log,
agentNamespace: agentNamespace,
}
}

Expand All @@ -69,13 +71,7 @@ func (c *StateApplier) GetPriorityClassEmptyK8sObject() client.Object {

func (c *StateApplier) ApplyDesiredState(ctx context.Context, agentSpec *cbcontainersv1.CBContainersAgentSpec, registrySecret *models.RegistrySecretValues, setOwner applymentOptions.OwnerSetter) (bool, error) {
applyOptions := applymentOptions.NewApplyOptions().SetOwnerSetter(setOwner)

// The namespace field of the agent spec should always be populated, because it has a default value
// but just in case include this check here in case it turns out to be empty in the future.
// By default all objects have the "cbcontainers-dataplane" as namespace.
if agentSpec.Namespace != "" {
c.setNamespace(agentSpec.Namespace)
}
c.setNamespace(c.agentNamespace)
BenRub marked this conversation as resolved.
Show resolved Hide resolved

coreMutated, err := c.applyCoreComponents(ctx, agentSpec, registrySecret, applyOptions)
if err != nil {
Expand Down
3 changes: 1 addition & 2 deletions cbcontainers/state/state_applier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ func testStateApplier(t *testing.T, setup StateApplierTestSetup, k8sVersion, nam
agentSpec := &cbcontainersv1.CBContainersAgentSpec{
Account: Account,
ClusterName: Cluster,
Namespace: namespace,
Gateways: cbcontainersv1.CBContainersGatewaysSpec{
ApiGateway: cbcontainersv1.CBContainersApiGatewaySpec{
Scheme: ApiGateWayScheme,
Expand Down Expand Up @@ -190,7 +189,7 @@ func testStateApplier(t *testing.T, setup StateApplierTestSetup, k8sVersion, nam

setup(mockObjects)

stateApplier := state.NewStateApplier(testUtilsMocks.NewMockReader(ctrl), mockObjects.componentApplier, k8sVersion, mockObjects.secretValuesCreator, logrTesting.NewTestLogger(t))
stateApplier := state.NewStateApplier(testUtilsMocks.NewMockReader(ctrl), mockObjects.componentApplier, k8sVersion, namespace, mockObjects.secretValuesCreator, logrTesting.NewTestLogger(t))
return stateApplier.ApplyDesiredState(context.Background(), agentSpec, &models.RegistrySecretValues{}, nil)
}

Expand Down
19 changes: 8 additions & 11 deletions charts/cbcontainers-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,7 @@ There are 8 required fields that need to be provided by the user:
| `spec.gateways.hardeningEventsGatewayHost` | The URL of the CBC Hardening events Gateway |
| `spec.gateways.runtimeEventsGatewayHost` | The URL of the CBC Runtime events Gateway |

After setting these required fields in a `values.yaml` file you can install the chart from our repo:

```sh
helm repo add vmware TODO-chart-repo/TODO-chart-name -f values.yaml
helm repo update
helm install cbcontainers-agent TODO-chart-repo/TODO-chart-name -f values.yaml --namespace cbcontainers-dataplane
```

or from source
After setting these required fields in a `values.yaml` file you can install the chart from source

```sh
cd charts/cbcontainers-agent
Expand All @@ -46,9 +38,14 @@ For all the possible values see <https://github.com/octarinesec/octarine-operato

### Namespace

By default the CBContainers agent will be installed in the `cbcontainers-dataplane` namespace.
The CBContainers agent will be running in the same namespace as the deployed operator. This is by design as only 1 running agent per cluster is supported.
To customize that namespace, see [operator-chart](../cbcontainers-operator).

The actual namespace where helm tracks the release (see [--namespace flag](https://helm.sh/docs/helm/helm_install/)) is not important to the agent chart,
but the recommended approach is to also use the same namespace as the operator chart.

If you want to change that set the `agentNamespce` value in your `values.yaml` file.
The `agentNamespace` value is only required if the agent chart is responsible for deploying the agent's secret as well. See [secret detection](#secret-creation) for details.
If the secret is pre-created before deploying the agent, then `agentNamespace` has no effect.

### Secret creation

Expand Down
4 changes: 2 additions & 2 deletions charts/cbcontainers-agent/cbcontainers-agent-chart/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: cbcontainers-agent
description: A Helm chart for installing the CBContainers Agent
type: application
version: 1.0.0
appVersion: "2.11.0"
version: 2.0.0
appVersion: "2.12.1"
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ clusterGroup: ""
# clusterName is the name that will be used for the cluster that the agent is installed on
clusterName: ""
# agentNamespace is the name of the namespace in which the agent will be installed
# that namespace should exist before the chart is installed
# that namespace must exist before the chart is installed and must match the namespace where the operator is deployed
agentNamespace: "cbcontainers-dataplane"
31 changes: 18 additions & 13 deletions charts/cbcontainers-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,22 @@ The chart can be installed as is, without any customization or modifications.

You can create the Helm release in any namespace that you want.

You can also customize the namespace in which the operator is installed.
You can also customize the namespace in which the operator itself is installed.
See [Customization](#namespace).

### Installing the operator chart

Now, install the actual helm chart in the namespace based on the chosen option 1 or 2 above.

```sh
helm repo add vmware TODO-chart-repo/TODO-chart-name
helm repo update
helm install cbcontainers-operator TODO-chart-repo/TODO-chart-name --namespace X
```

or from source:
Now, install the actual helm chart from source:

```sh
cd charts/cbcontainers-operator
helm install cbcontainers-operator ./cbcontainers-operator-chart --namespace X
helm install cbcontainers-operator ./cbcontainers-operator-chart
```

## Customization

| Parameter | Description | Default |
| -------------------------------- | --------------------------------------------------- | ---------------------------------------------------------------------------------- |
|----------------------------------|-----------------------------------------------------|------------------------------------------------------------------------------------|
| `spec.operator.image.repository` | The repository of the operator image | `cbartifactory/octarine-operator` |
| `spec.operator.image.version` | The version of the operator image | The latest version of the operator image |
| `spec.operator.resources` | Carbon Black Container Operator resources | `{requests: {memory: "64Mi", cpu: "30m"}, limits: {memory: "256Mi", cpu: "200m"}}` |
Expand All @@ -51,6 +43,16 @@ If you want to change that, set the `operatorNamespace` field in your `values.ya
The chart will automatically create the namespace that you have chosen to install the operator into.
If you don't want to do that (because you have already created the namespace), set the `createOperatorNamespace` field in your `values.yaml` file to `false`.

If the namespace is pre-created, then it must also be labeled properly or the operator and agent might not reconcile successfully.
The commands below show an example of creating a custom namespace, labeling and installing the operator inside.

```sh
NAMESPACE=<choose_your_value>
kubectl create namespace $NAMESPACE
kubectl label namespace $NAMESPACE control-plane=operator octarine=ignore
helm install cbcontainers-operator ./cbcontainers-operator-chart --set createOperatorNamespace=false,operatorNamespace=$NAMESPACE
```

### CRD Installation

By default, installing the chart will also create the `CBContainersAgent` CRD.
Expand All @@ -71,7 +73,7 @@ For more info see <https://github.com/octarinesec/octarine-operator/tree/master#

## Templates

This chart consists of two [templates](cbcontainers-operator-chart/templates).
This chart consists of four [templates](cbcontainers-operator-chart/templates).

The [operator.yaml](cbcontainers-operator-chart/templates/operator.yaml) file contains all resources, apart from the operator deployment.
It is generated via `kustomize`.
Expand All @@ -81,3 +83,6 @@ The [deployment.yaml](cbcontainers-operator-chart/templates/deployment.yaml) fil
It is derived from [this Kustomize configuration](../../config/manager) but because it needs to be configurable via Helm it is heavily templated.
Because of that it cannot be generated automatically, so it should be maintained by hand.
If any changes are make to the [Kustomize configuration](../../config/manager), they should also be reflected in that file.

The [dataplane_rbac.yaml](cbcontainers-operator-chart/templates/dataplane_rbac.yaml) and [dataplane_service_accounts](cbcontainers-operator-chart/templates/dataplane_service_accounts.yaml)
files contain necessary RBAC objects for the agent to work as expected.
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: cbcontainers-operator
description: A Helm chart for installing the CBContainers operator
type: application
version: 1.0.0
appVersion: v5.6.0
version: 2.0.0
appVersion: v5.6.2
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ roleRef:
subjects:
- kind: ServiceAccount
name: cbcontainers-agent-node
namespace: {{ default "cbcontainers-dataplane" .Values.agentNamespace }}
namespace: {{ default "cbcontainers-dataplane" .Values.operatorNamespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -128,7 +128,7 @@ roleRef:
subjects:
- kind: ServiceAccount
name: cbcontainers-enforcer
namespace: {{ default "cbcontainers-dataplane" .Values.agentNamespace }}
namespace: {{ default "cbcontainers-dataplane" .Values.operatorNamespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -141,7 +141,7 @@ roleRef:
subjects:
- kind: ServiceAccount
name: cbcontainers-image-scanning
namespace: {{ default "cbcontainers-dataplane" .Values.agentNamespace }}
namespace: {{ default "cbcontainers-dataplane" .Values.operatorNamespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -154,7 +154,7 @@ roleRef:
subjects:
- kind: ServiceAccount
name: cbcontainers-monitor
namespace: {{ default "cbcontainers-dataplane" .Values.agentNamespace }}
namespace: {{ default "cbcontainers-dataplane" .Values.operatorNamespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -167,7 +167,7 @@ roleRef:
subjects:
- kind: ServiceAccount
name: cbcontainers-runtime-resolver
namespace: {{ default "cbcontainers-dataplane" .Values.agentNamespace }}
namespace: {{ default "cbcontainers-dataplane" .Values.operatorNamespace }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
Expand All @@ -180,4 +180,4 @@ roleRef:
subjects:
- kind: ServiceAccount
name: cbcontainers-state-reporter
namespace: {{ default "cbcontainers-dataplane" .Values.agentNamespace }}
namespace: {{ default "cbcontainers-dataplane" .Values.operatorNamespace }}
Loading