Skip to content

Commit 0a7fce6

Browse files
authored
Merge pull request #98777 from Makdaam/aro-privileged-containers
ARO privileged containers instructions
2 parents c51aa08 + ae6187e commit 0a7fce6

File tree

2 files changed

+229
-53
lines changed

2 files changed

+229
-53
lines changed
Lines changed: 174 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,174 @@
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.

articles/openshift/toc.yml

Lines changed: 55 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -2,71 +2,73 @@
22
href: index.yml
33
- name: Overview
44
items:
5-
- name: About Azure Red Hat OpenShift
6-
href: intro-openshift.md
5+
- name: About Azure Red Hat OpenShift
6+
href: intro-openshift.md
77
- name: Tutorials
88
items:
9-
- name: Create and manage an Azure Red Hat OpenShift cluster
10-
items:
11-
- name: 1 - Create an Azure Red Hat OpenShift cluster
12-
href: tutorial-create-cluster.md
13-
- name: 2 - Scale an Azure Red Hat OpenShift cluster
14-
href: tutorial-scale-cluster.md
15-
- name: 3 - Delete an Azure Red Hat OpenShift cluster
16-
href: tutorial-delete-cluster.md
9+
- name: Create and manage an Azure Red Hat OpenShift cluster
10+
items:
11+
- name: 1 - Create an Azure Red Hat OpenShift cluster
12+
href: tutorial-create-cluster.md
13+
- name: 2 - Scale an Azure Red Hat OpenShift cluster
14+
href: tutorial-scale-cluster.md
15+
- name: 3 - Delete an Azure Red Hat OpenShift cluster
16+
href: tutorial-delete-cluster.md
1717

1818
- name: Cluster administration
1919
items:
20-
- name: Azure Red Hat OpenShift cluster administration
21-
items:
22-
- name: 1 - Azure Red Hat OpenShift cluster administrator role
23-
href: cluster-administration-cluster-admin-role.md
24-
- name: 2 - Managing security context constraints
25-
href: cluster-administration-security-context-constraints.md
20+
- name: Azure Red Hat OpenShift cluster administration
21+
items:
22+
- name: 1 - Azure Red Hat OpenShift cluster administrator role
23+
href: cluster-administration-cluster-admin-role.md
24+
- name: 2 - Managing security context constraints
25+
href: cluster-administration-security-context-constraints.md
2626

2727
- name: How-to guides
2828
expanded: true
2929
items:
30-
- name: Set up your Azure Red Hat OpenShift dev environment
31-
href: howto-setup-environment.md
32-
expanded: true
33-
items:
34-
- name: Create an Azure AD tenant
35-
href: howto-create-tenant.md
36-
- name: Create an Azure AD app object and user
37-
href: howto-aad-app-configuration.md
38-
- name: Deploy a standalone prometheus in an Azure Red Hat OpenShift cluster
39-
href: howto-deploy-prometheus.md
40-
- name: Manage projects in an Azure Red Hat OpenShift cluster
41-
href: howto-manage-projects.md
42-
- name: Monitoring and logging
43-
items:
44-
- name: Azure Monitor for containers (preview)
30+
- name: Set up your Azure Red Hat OpenShift dev environment
31+
href: howto-setup-environment.md
32+
expanded: true
33+
items:
34+
- name: Create an Azure AD tenant
35+
href: howto-create-tenant.md
36+
- name: Create an Azure AD app object and user
37+
href: howto-aad-app-configuration.md
38+
- name: Deploy a standalone prometheus in an Azure Red Hat OpenShift cluster
39+
href: howto-deploy-prometheus.md
40+
- name: Manage projects in an Azure Red Hat OpenShift cluster
41+
href: howto-manage-projects.md
42+
- name: Monitoring and logging
4543
items:
46-
- name: Configure Azure Monitor for containers
47-
href: ../azure-monitor/insights/container-insights-azure-redhat-setup.md
48-
maintainContext: true
49-
- name: Disable Azure Monitor for containers
50-
href: ../azure-monitor/insights/container-insights-optout-openshift.md
51-
maintainContext: true
44+
- name: Azure Monitor for containers (preview)
45+
items:
46+
- name: Configure Azure Monitor for containers
47+
href: ../azure-monitor/insights/container-insights-azure-redhat-setup.md
48+
maintainContext: true
49+
- name: Disable Azure Monitor for containers
50+
href: ../azure-monitor/insights/container-insights-optout-openshift.md
51+
maintainContext: true
52+
- name: Run privileged containers in an Azure Red Hat OpenShift cluster
53+
href: howto-run-privileged-containers.md
5254
- name: Reference
5355
items:
54-
- name: Azure Red Hat OpenShift CLI
55-
href: /cli/azure/openshift
56-
- name: Azure Red Hat OpenShift REST APIs
57-
href: /rest/api/openshift
56+
- name: Azure Red Hat OpenShift CLI
57+
href: /cli/azure/openshift
58+
- name: Azure Red Hat OpenShift REST APIs
59+
href: /rest/api/openshift
5860

5961
- name: Resources
6062
items:
61-
- name: Common questions
62-
href: openshift-faq.md
63-
- name: Troubleshooting
64-
href: troubleshoot.md
65-
- name: Supported resources
66-
href: supported-resources.md
67-
- name: Regional availability
68-
href: https://azure.microsoft.com/regions/services/
69-
- name: Red Hat OpenShift documentation
70-
href: https://docs.openshift.com/aro/welcome/index.html
71-
- name: Azure Roadmap
72-
href: https://azure.microsoft.com/roadmap/
63+
- name: Common questions
64+
href: openshift-faq.md
65+
- name: Troubleshooting
66+
href: troubleshoot.md
67+
- name: Supported resources
68+
href: supported-resources.md
69+
- name: Regional availability
70+
href: https://azure.microsoft.com/regions/services/
71+
- name: Red Hat OpenShift documentation
72+
href: https://docs.openshift.com/aro/welcome/index.html
73+
- name: Azure Roadmap
74+
href: https://azure.microsoft.com/roadmap/

0 commit comments

Comments
 (0)