enforcer
A Helm chart for the Aqua Enforcer
About this chart
Aqua Security Enforcer Helm Chart
These are Helm charts for installation and maintenance of Aqua Container Security Enforcer
Contents
- Aqua Security Enforcer Helm Chart
- Contents
- Prerequisites
- Container Registry Credentials
- Installing the Chart
- Installing Aqua Enforcer from Helm Private Repository
- Migrating from Aqua Operator
- Configuring Enforcer mTLS with Gateway/Envoy
- Create Root CA (Done once)
- Create the certificate and key for enforcer from existing rootca cert
- Create secrets with generated certs and change
values.yamlas mentioned below
- Guide how to create enforcer group in Kubernetes
- Integrate Aqua Enforcer with Hashicorp Vault to Load Token
- Configurable Variables
- Enforcer
- Special cases
- Issues and feedback
Prerequisites
Container Registry Credentials
Link
Installing the Chart
Follow the steps in this section for production grade deployments. You can either clone aqua-helm git repo or you can add our helm private repository (https://helm.aquasec.com)
Installing Aqua Enforcer from Helm Private Repository
- Add Aqua Helm Repository
helm repo add aqua-helm https://helm.aquasec.com
helm repo update
- Check for available chart versions either from Changelog or by running the below command
helm search repo aqua-helm/enforcer --versions
- Install Aqua Enforcer
-
Install enforcer on linux nodes:
helm upgrade --install --namespace aqua aqua-enforcer aqua-helm/enforcer --set global.imageCredentials.create=<>,global.imageCredentials.username=<>,global.imageCredentials.password=<>,global.platform=<>,enforcerToken=<aquasec-token>(or)
-
Install enforcer on combination of linux and windows nodes:
helm upgrade --install --namespace aqua aqua-enforcer aqua-helm/enforcer --set global.imageCredentials.create=<>,global.imageCredentials.username=<>,global.imageCredentials.password=<>,global.platform=<>,enforcerToken=<aquasec-token>,windowsEnforcer.WinLinuxNodes.enable=true,windowsEnforcer.enforcerToken=<windows-enforcer-token>,windowsEnforcer.nodeSelector.key1=value1(or)
-
Install enforcer on windows nodes only:
helm upgrade --install --namespace aqua aqua-enforcer aqua-helm/enforcer --set global.imageCredentials.create=<>,global.imageCredentials.username=<>,global.imageCredentials.password=<>,global.platform=<>,enforcerToken=<aquasec-token>,windowsEnforcer.allWinNodes.enable=true,windowsEnforcer.enforcerToken=<windows-enforcer-token>,windowsEnforcer.nodeSelector.key1=value1
-
Migrating from Aqua Operator
When migrating from the Aqua Operator to the Helm chart, you can reuse existing RBAC resources (ClusterRole, ClusterRoleBinding, ServiceAccount) created by the operator. This avoids permission conflicts and allows for a smoother transition.
Migration Steps
-
Identify existing RBAC resources created by the operator:
kubectl get clusterrole,clusterrolebinding,serviceaccount -n aqua | grep -i enforcer -
Install the Helm chart with RBAC creation disabled:
helm upgrade --install --namespace aqua aqua-enforcer aqua-helm/enforcer \ --set clusterRole.create=false \ --set serviceAccount.create=false \ --set serviceAccount.name=<existing-sa-name> \ --set global.platform=<platform> \ --set enforcerToken=<token> -
If you need to reference a specific existing ClusterRole for the binding:
helm upgrade --install --namespace aqua aqua-enforcer aqua-helm/enforcer \ --set clusterRole.create=false \ --set clusterRole.roleRef=<existing-cluster-role-name> \ --set serviceAccount.create=false \ --set serviceAccount.name=<existing-sa-name> \ --set global.platform=<platform> \ --set enforcerToken=<token> -
After successful migration, you can clean up the operator resources:
# Remove the AquaEnforcer CR (this will NOT delete the enforcer pods managed by Helm) kubectl delete aquaenforcer <name> -n aqua
Note: When
clusterRole.create=false, no ClusterRole, ClusterRoleBinding, or platform-specific RBAC resources (OpenShift SCC, TKG RoleBinding) will be created by the chart. Ensure your existing RBAC setup has the required permissions.
Configuring Enforcer mTLS with Gateway/Envoy
By default, deploying Aqua Enterprise configures TLS-based encrypted communication, using self-signed certificates, between Aqua components. If you want to use self-signed certificates to establish mTLS between enforcer and gateway/envoy use the below instrictions to generate rootCA and component certificates
Note: mTLS communication and setup is only supported for self-hosted Aqua. It is not supported for Aqua ESE and Aqua SAAS
Create Root CA (Done once)
Important: The rootCA certificate used to generate the certificates for aqua server, gateway or envoy, use the same rootCA to generate enforcer certificates.
Create the certificate and key for enforcer from existing rootca cert
1. Create component key:
openssl genrsa -out aqua_enforcer.key 2048
2. Create the signing (csr):
The certificate signing request is where you specify the details for the certificate you want to generate. This request will be processed by the owner of the Root key (you in this case since you create it earlier) to generate the certificate.
Important: Please mind that while creating the signign request is important to specify the Common Name providing the IP address or domain name for the service, otherwise the certificate cannot be verified.
- Generating aqua_enforcer csr:
openssl req -new -sha256 -key aqua_enforcer.key \
-subj "/C=US/ST=MA/O=aqua/CN=aqua-agent" \
-out aqua_enforcer.csr
3. Verify the CSR content:
- verify the generated csr content(optional)
openssl req -in aqua_enforcer.csr -noout -text
4. Generate the certificate using the component csr and key along with the CA Root key:
openssl x509 -req -in aqua_enforcer.csr -CA rootCA.crt -CAkey rootCA.key -CAcreateserial -out aqua_enforcer.crt -days 500 -sha256
5. Verify the certificate content:
- verify the generated certificate content(optional)
openssl x509 -in aqua_enforcer.crt -text -noout
Create secrets with generated certs and change values.yaml as mentioned below
- Create Kubernetes secret for enforcer using the generated SSL certificates.
# Example:
# Change < certificate filenames > respectively
kubectl create secret generic aqua-enforcer-certs --from-file aqua_enforcer.key --from-file aqua_enforcer.crt --from-file rootCA.crt -n aqua
- Enable
TLS.enabledtotruein values.yaml - Add the certificates secret name
TLS.secretNamein values.yaml - Add respective certificate file names to
TLS.publicKey_fileName,TLS.privateKey_fileNameandTLS.rootCA_fileName(Add rootCA if certsare self-signed) in values.yaml - For enabling mTLS/TLS connection with self-signed or CA certificates between gateway and enforcer please setup mTLS/TLS config for gateway inserver chart as well server chart
Guide how to create enforcer group in Kubernetes
Please login into Aqua Web UI then go to Enforcers section under Administrator tab to create a new enforcer group. Following are the required parameters to create a new group
| Parameter | Description |
|---|---|
| Enforcer Type | Select Aqua Enforcer |
| Group Name | Enter the name for the Enforcer Group; this name will appear in the list of Enforcer groups |
| OS Type | Select the OS type for the host |
| Orchestrator | Select the orchestrator for which you are creating the Enforcer Group |
| Container Runtime | Select the container runtime environment from the drop-down list |
| Aqua Gateway | Select the Aqua Gateway(s) that the Enforcer will use to communicate with the Aqua Server. If there is only one Gateway, you need not select anything. |
For more details please visit Link
Integrate Aqua Enforcer with Hashicorp Vault to Load Token
- Hashicorp Vault is a secrets management tools.
- Aqua Enforcer charts supports to load token values from vault by vault-agent using annotations. To enable the Vault integration enable
vaultSecret.enable=true, add vault secret filepathvaultSecret.vaultFilepath= ""and uncomment thevaultAnnotations. vaultAnnotations- Change the vault annotations according as per your vault setup, Annotations support both self-hosted and SaaS Vault setups.
Configurable Variables
Enforcer
| Parameter | Description | Default | Mandatory |
|---|---|---|---|
serviceAccount.create | enable to create serviceaccount | false | YES - New cluster |
serviceAccount.name | service acccount name | aqua-sa | NO |
serviceAccount.attachImagePullSecret | attach image pull secret to created service account? | true | NO |
clusterRole.create | Set to false to skip ClusterRole and ClusterRoleBinding creation (useful for operator migration) | true | NO |
clusterRole.roleRef | cluster role reference name for cluster rolebinding | unset | NO |
platform | Orchestration platform name (Allowed values are aks, eks, gke, gke-autopilot, openshift, tkg, tkgi, k8s, rancher, gs, k3s) | unset | YES |
vaultSecret.enable | Enable to true once you have secrets in vault and annotations are enabled to load enforcer token from hashicorp vault | false | No |
vaultSecret.vaultFilepath | Change the path to "/vault/secrets/" as per the setup | | NO |
enforcerToken | enforcer token value | enforcer-token | YES if enforcerTokenSecretName is set to null |
expressMode | Install enforcer in EXPRESS MODE or not | false | YES |
enforcerTokenSecretName | enforcer token secret name if exists | null | NO |
enforcerTokenSecretKey | enforcer token secret key if exists | null | NO |
logicalName | Specify the Logical Name the Aqua Enforcer will register under. if not specify the name will be spec.nodeName | unset | NO |
nodelName | Specify the Node Name the Aqua Enforcer will register under. if not specify the name will be spec.nodeName | unset | NO |
securityContext.privileged | determines if any container in a pod can enable privileged mode. | false | NO |
securityContext.capabilities | Linux capabilities provide a finer grained breakdown of the privileges traditionally associated with the superuser. | add {} | NO |
podSecurityContext | Set Pod Security Context ( see: https://kubernetes.io/docs/tasks/configure-pod-container/security-context ) | unset | NO |
podSecurityPolicy.create | Enable Pod Security Policies with the required enforcer capabilities | false | NO |
podSecurityPolicy.privileged | Enable privileged permissions to the Enforcer | true if podSecurityPolicy.create is true | NO |
global.imageCredentials.create | Set if to create new pull image secret | false | YES - New cluster |
global.imageCredentials.name | Your Docker pull image secret name | aqua-registry-secret | YES - New cluster |
global.imageCredentials.repositoryUriPrefix | repository uri prefix for dockerhub set docker.io | registry.aquasec.com | YES - New cluster |
global.imageCredentials.registry | set the registry url for dockerhub set index.docker.io/v1/ | registry.aquasec.com | YES - New cluster |
global.imageCredentials.username | Your Docker registry (DockerHub, etc.) username | aqua-registry-secret | YES - New cluster |
global.imageCredentials.password | Your Docker registry (DockerHub, etc.) password | unset | YES - New cluster |
global.gateway.address | Gateway host address | aqua-gateway-svc | YES |
global.gateway.port | Gateway host port | 8443 | YES |
priorityClass.create | If true priority class will be created | False | NO |
priorityClass.name | Define the name of priority class or default value will be used | | NO |
priorityClass.preemptionPolicy | Preemption policy for priority class | PreemptLowerPriority | NO |
priorityClass.value | The integer value of the priority | 1000000 | NO |
image.repository | the docker image name to use | enforcer | YES |
image.tag | The image tag to use. | 2022.4 | YES |
image.pullPolicy | The kubernetes image pull policy. | Always | NO |
healthMonitor.enabled | Enabling health monitoring for enforcer liveness and readiness | true | YES |
resources | Resource requests and limits | {} | NO |
nodeSelector | Kubernetes node selector | {} | NO |
tolerations | Kubernetes node tolerations |
Deploy enforcer with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has enforcer on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartenforcer is pinned at v2022.4.30 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply