Hardening a kops Default Deployment with Kube-bench

1 hour
  • 4 Learning Objectives

About this Hands-on Lab

This lab guides the student through the creation of a Kubernetes cluster using the kops installer. After the cluster is initialized, the Aquasec kube-bench utility is used to evaluate the master node configuration against the CIS Benchmark. Then, three failed tests are remediated, by manually updating the kube-apiserver manifest.

Learning Objectives

Successfully complete this lab by achieving the following learning objectives:

Use kops to Create the Cluster
  1. Run the provided k8s script and create the Kubernetes cluster.
  2. Validate the cluster.

    Note: This will take some time to come up. Give this step 5 to 10 minutes to complete.

Retrieve a Connect String from Amazon AWS and Connect to the Master Node
  1. Use the Amazon AWS Console and retrieve a connect string for the master node. Then use ssh to connect to the master node.

    Note: You can get the connection information from the output provided when you create the cluster.

Run the AquaSec kube-bench Utility on the Master Node
  1. Using Docker, pull down the latest kube-bench image.
  2. Execute a kube-bench run against the master node and output the results to a file.
Remediate Failed Tests 1.1.2, 1.1.5, and 1.1.6
  1. Use the process status command to look at the current apiserver arguments.
  2. Use the vi editory as super user to edit the kube apiserver manifest.
  3. Edit the test recommendations per the remediation listed in the kube-bench report.
  4. Rerun the kube-bench report after the api server has restarted.
  5. Compare the old and new reports using the Linux diff command.

Additional Resources

To perform this lab you should have a basic understanding af Kubernetes and a good familiarity with Linux. Some familiarity with Amazon AWS is also helpful.

What are Hands-on Labs

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?