So far you’ve seen how ACS can handle security issues concerning Build and Deploy stages. But ACS is also able to detect and secure container runtime behaviour. Let’s have a look…
As a scenario let’s assume you want to protect container workloads against attackers who are trying to install software. ACS comes with pre-configured policies for Ubuntu and Red Hat-based containers to detect if a package management tool is installed, this can be used in the Build and Deploy stages:
And, more important for this section about runtime security, a policy to detect the execution of a package manager as a runtime violation, using Kernel instrumentation:
In the ACS Portal, go to Platform Configuration->Policy Management, search for the policies by e.g. typing policy
and then red hat
into the filter. Open the policy detail view by clicking it and have a look at what they do.
You can use the included policies as they are but you can always e.g. clone and adapt them to your needs or write completely new ones.
As you can see the Red Hat Package Manager Execution policy will alert as soon as a process rpm or dnf or yum is executed.
Like with most included policies it is not set to enforce!
To see how the alert would look like, we have to trigger the condition:
yum search test
yum
commands in the terminal and check back with the Violations view:
But the real fun starts when you enforce the policy. Using the included policy, it’s easy to just “switch it on”:
Now trigger the policy again by opening a terminal into the pod in the OpenShift Web Console and executing yum
. See what happens: