|
| 1 | +--- |
| 2 | +title: Run privileged containers in an Azure Red Hat OpenShift cluster | Microsoft Docs |
| 3 | +description: Run privileged containers to monitor security and compliance. |
| 4 | +author: makdaam |
| 5 | +ms.author: b-lejaku |
| 6 | +ms.service: container-service |
| 7 | +ms.topic: conceptual |
| 8 | +ms.date: 12/05/2019 |
| 9 | +keywords: aro, openshift, aquasec, twistlock, red hat |
| 10 | +#Customer intent: As a customer, I want to monitor security compliance of my ARO clusters. |
| 11 | +--- |
| 12 | + |
| 13 | +# Run privileged containers in an Azure Red Hat OpenShift cluster |
| 14 | + |
| 15 | +You can't run arbitrary privileged containers on Azure Red Hat OpenShift clusters. |
| 16 | +Two security monitoring and compliance solutions are allowed to run on ARO clusters. |
| 17 | +This document describes the differences from the generic OpenShift deployment documentation of the security product vendors. |
| 18 | + |
| 19 | + |
| 20 | +Read through these instructions before following the vendor's instructions. |
| 21 | +Section titles in product-specific steps below refer directly to section titles in the vendors' documentation. |
| 22 | + |
| 23 | +## Before you begin |
| 24 | + |
| 25 | +The documentation of most security products assumes you have cluster-admin privileges. |
| 26 | +Customer admins don't have all privileges in Azure Red Hat OpenShift. Permissions required to modify cluster-wide resources are limited. |
| 27 | + |
| 28 | +First, ensure the user is logged in to the cluster as a customer admin, by running |
| 29 | +`oc get scc`. All users that are members of the customer admin group have permissions to view the Security Context Constraints (SCCs) on the cluster. |
| 30 | + |
| 31 | +Next, ensure that the `oc` binary version is `3.11.154`. |
| 32 | +``` |
| 33 | +oc version |
| 34 | +oc v3.11.154 |
| 35 | +kubernetes v1.11.0+d4cacc0 |
| 36 | +features: Basic-Auth GSSAPI Kerberos SPNEGO |
| 37 | +
|
| 38 | +Server https://openshift.aqua-test.osadev.cloud:443 |
| 39 | +openshift v3.11.154 |
| 40 | +kubernetes v1.11.0+d4cacc0 |
| 41 | +``` |
| 42 | + |
| 43 | +## Product-specific steps for Aqua Security |
| 44 | +The base instructions that are going to be modified can be found in the [Aqua Security deployment documentation](https://docs.aquasec.com/docs/openshift-red-hat). The steps here will run in conjunction to the Aqua deployment documentation. |
| 45 | + |
| 46 | +The first step is to annotate the required SCCs that will be updated. These annotations prevent the cluster's Sync Pod from reverting any changes to these SSCs. |
| 47 | + |
| 48 | +``` |
| 49 | +oc annotate scc hostaccess openshift.io/reconcile-protect=true |
| 50 | +oc annotate scc privileged openshift.io/reconcile-protect=true |
| 51 | +``` |
| 52 | + |
| 53 | +### Step 1: Prepare prerequisites |
| 54 | +Remember to log in to the cluster as an ARO Customer Admin instead of the cluster-admin role. |
| 55 | + |
| 56 | +Create the project and the service account. |
| 57 | +``` |
| 58 | +oc new-project aqua-security |
| 59 | +oc create serviceaccount aqua-account -n aqua-security |
| 60 | +``` |
| 61 | + |
| 62 | +Instead of assigning the cluster-reader role, assign the customer-admin-cluster role to the aqua-account with the following command. |
| 63 | +``` |
| 64 | +oc adm policy add-cluster-role-to-user customer-admin-cluster system:serviceaccount:aqua-security:aqua-account |
| 65 | +oc adm policy add-scc-to-user privileged system:serviceaccount:aqua-security:aqua-account |
| 66 | +oc adm policy add-scc-to-user hostaccess system:serviceaccount:aqua-security:aqua-account |
| 67 | +``` |
| 68 | + |
| 69 | +Continue following the remaining instructions in Step 1. Those instructions describe setting up the secret for the Aqua registry. |
| 70 | + |
| 71 | +### Step 2: Deploy the Aqua Server, Database, and Gateway |
| 72 | +Follow the steps provided in the Aqua documentation for installing the aqua-console.yaml. |
| 73 | + |
| 74 | +Modify the provided `aqua-console.yaml`. Remove the top two objects labeled, `kind: ClusterRole` and `kind: ClusterRoleBinding`. These resources won't be created as the customer admin doesn't have permission at this time to modify `ClusterRole` and `ClusterRoleBinding` objects. |
| 75 | + |
| 76 | +The second modification will be to the `kind: Route` portion of the `aqua-console.yaml`. Replace the following yaml for the `kind: Route` object in the `aqua-console.yaml` file. |
| 77 | +``` |
| 78 | +apiVersion: route.openshift.io/v1 |
| 79 | +kind: Route |
| 80 | +metadata: |
| 81 | + labels: |
| 82 | + app: aqua-web |
| 83 | + name: aqua-web |
| 84 | + namespace: aqua-security |
| 85 | +spec: |
| 86 | + port: |
| 87 | + targetPort: aqua-web |
| 88 | + tls: |
| 89 | + insecureEdgeTerminationPolicy: Redirect |
| 90 | + termination: edge |
| 91 | + to: |
| 92 | + kind: Service |
| 93 | + name: aqua-web |
| 94 | + weight: 100 |
| 95 | + wildcardPolicy: None |
| 96 | +``` |
| 97 | + |
| 98 | +Follow the remaining instructions. |
| 99 | + |
| 100 | +### Step 3: Login to the Aqua Server |
| 101 | +This section isn't modified in any way. Follow the Aqua documentation. |
| 102 | + |
| 103 | +Use the following command to get the Aqua Console address. |
| 104 | +``` |
| 105 | +oc get route aqua-web -n aqua-security |
| 106 | +``` |
| 107 | + |
| 108 | +### Step 4: Deploy Aqua Enforcers |
| 109 | +Set the following fields when deploying enforcers: |
| 110 | + |
| 111 | +| Field | Value | |
| 112 | +| -------------- | ------------- | |
| 113 | +| Orchestrator | OpenShift | |
| 114 | +| ServiceAccount | aqua-account | |
| 115 | +| Project | aqua-security | |
| 116 | + |
| 117 | +## Product-specific steps for Prisma Cloud / Twistlock |
| 118 | + |
| 119 | +The base instructions we're going to modify can be found in the [Prisma Cloud deployment documentation](https://docs.paloaltonetworks.com/prisma/prisma-cloud/19-11/prisma-cloud-compute-edition-admin/install/install_openshift.html) |
| 120 | + |
| 121 | +Start by creating a new OpenShift project |
| 122 | +``` |
| 123 | +oc new-project twistlock |
| 124 | +``` |
| 125 | + |
| 126 | +You can follow the documentation until the "Install Console" section, use the Prisma Cloud container registry instead of creating an internal one. |
| 127 | + |
| 128 | +### Install Console |
| 129 | + |
| 130 | +During `oc create -f twistlock_console.yaml` in Step 2, you'll get an Error when creating the namespace. |
| 131 | +You can safely ignore it, the namespace has been created previously with the `oc new-project` command. |
| 132 | + |
| 133 | +### Create an external route to Console |
| 134 | + |
| 135 | +You can either follow the documentation, or the instructions below if you prefer the oc command. |
| 136 | +Copy the following Route definition to a file called twistlock_route.yaml on your computer |
| 137 | +``` |
| 138 | +apiVersion: route.openshift.io/v1 |
| 139 | +kind: Route |
| 140 | +metadata: |
| 141 | + labels: |
| 142 | + name: console |
| 143 | + name: twistlock-console |
| 144 | + namespace: twistlock |
| 145 | +spec: |
| 146 | + port: |
| 147 | + targetPort: mgmt-http |
| 148 | + tls: |
| 149 | + insecureEdgeTerminationPolicy: Redirect |
| 150 | + termination: edge |
| 151 | + to: |
| 152 | + kind: Service |
| 153 | + name: twistlock-console |
| 154 | + weight: 100 |
| 155 | + wildcardPolicy: None |
| 156 | +``` |
| 157 | +then run: |
| 158 | +``` |
| 159 | +oc create -f twistlock_route.yaml |
| 160 | +``` |
| 161 | + |
| 162 | +You can get the URL assigned to Twistlock console with this command: |
| 163 | +`oc get route twistlock-console -n twistlock` |
| 164 | + |
| 165 | +### Configure console |
| 166 | + |
| 167 | +Follow the Twistlock documentation. |
| 168 | + |
| 169 | +### Install Defender |
| 170 | + |
| 171 | +During `oc create -f defender.yaml` in Step 2, you'll get Errors when creating the Cluster Role and Cluster Role Binding. |
| 172 | +You can ignore them. |
| 173 | + |
| 174 | +Defenders will be deployed only on compute nodes. You don't have to limit them with a node selector. |
0 commit comments