Skip to content
5th Anniversary
Celebrating five years of engineering-led delivery and client success.Our story
Celebrating five years of engineering-led delivery and client success.Our story
Kubernetes & SecOpsEKS Security

RunTime Threat Mapping for AWS EKS using Deepfence ThreatMapper

If we want to unify the development and DevOps perspectives of the application and the environment with the SecOps view, we need to have tools that can observe what's happening...

475

Malware Scans

12K

Vulnerabilities

711

Secrets

RunTime Threat Mapping for AWS EKS using Deepfence ThreatMapper

Introduction

If we want to unify the development and DevOps perspectives of the application and the environment with the SecOps view, we need to have tools that can observe what's happening, identify threats, and provide security.

Deepfence ThreatMapper:

Deepfence ThreatMapper is an open-source security observability platform that helps teams identify active threats and vulnerability exposure in production, especially in cloud-native environments.

How can Deepfence ThreatMapper help us?

The applications are built on various open-source technology stacks, pulling in third-party modules. With developers constantly pushing the code and images into repositories, and the operations team integrating various agents on the production workload for several purposes like logging, how can we ensure that our applications are protected against vulnerabilities, malware, and exposed secrets?

Deepfence ThreatMapper helps identify these risks and vulnerabilities.

Objective:

Monitor the AWS EKS cluster to uncover vulnerabilities in the software components, malware, and exposed secrets within the environment using ThreatMapper.

Installation:

The core components of ThreatMapper are the management console and sensor agents. ThreatMapper can be deployed as a containerized application on a single Docker host or across a distributed Kubernetes cluster. In this guide, we install ThreatMapper on an Amazon EC2 Ubuntu instance.

System Requirements:

Resources: 4 vCPU, 16GB RAM.

Port configurations: HTTPS (443)

Instance type: t2.xlarge

Docker: Minimum version 18.06.0

Tune the system limits on mmap counts:

sudo systemctl -w vm.max_map_count=262144

Deploy Management console:

Steps:

1

SSH into an EC2 instance.

2
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
3

Install docker:

curl -fsSL https://download.docker.com/linux/ubuntu/gpg |
sudo apt-key add sudo add-apt-repository "deb [arch=amd64]
https://download.docker.com/linux/ubuntu focal stable"
apt-cache policy docker-ce
sudo apt install -y docker-ce

Check the docker version by using the "docker info" command.

4

Install docker-compose:

sudo curl -L
https://github.com/docker/compose/releases/latest/download/
docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
5

Download the docker-compose YAML file from the Deepfence GitHub repository:

sudo wget https://github.com/deepfence/ThreatMapper/raw/master/deployment-scripts/docker-compose.yml

Check that the docker-compose.yml file is available.

6

Execute the command to install the management console:

sudo docker-compose up --detach
7

Check whether all the containers are running:

docker ps
8

Access the Deepfence ThreatMapper management console using the ec2 instance public IP https://X.X.X.X

We will get an invalid certificate error because we have not configured it, then go further.

ThreatMapper Console
deepfence

Sign In With Your Credentials

Email
Password
Forgot Password?Register
Login

The console may take one to two minutes to load.

9

Register and create a new account.

10

Add and manage new users from the management console. Obtain an API Key for installing sensor agents in the targeted environments.

Deploy sensor agents in the Kubernetes environment:

1

Using helm chart, we can deploy the agents.

Note down the name of the Kubernetes cluster (CLUSTERNAME), copy the Deepfence Management console url (X.X.X.X) and API key from the Deepfence User Management.

2

Execute these commands and add the noted down values:

helm repo add deepfence
helm repo add deepfence https://deepfence-helm-charts.s3.amazonaws.com/threatmapper
helm show readme deepfence/deepfence-agent
helm show values deepfence/deepfence-agent
 
helm install deepfence-agent deepfence/deepfence-agent \
--set managementConsoleUrl=X.X.X.X \
--set deepfenceKey=APIKEY \
--set image.tag=1.5.0 \
--set image.clusterAgentImageTag=1.5.0 \
--set clusterName=CLUSTERNAME \
--set mountContainerRuntimeSocket.containerdSock=true \
--set mountContainerRuntimeSocket.dockerSock=false \
--set mountContainerRuntimeSocket.crioSock=false \
--set mountContainerRuntimeSocket.containerdSockPath="/run/containerd/containerd.sock" \
--namespace deepfence \
--create-namespace
3

Check whether the pods are running.

kubectl get pods -n deepfence

After deploying the sensor agents, we can view the details of the K8s environment on the management console. Deepfence provides a feature called "topology-based view" that allows us to visualize the live infrastructure either graphically or through a tabular interface if it is a complex one. We have our workloads in the AWS Cloud, which runs in the ap-south-1 (Mumbai) region. The installed agents are collecting the network traffic coming from the internet to the hosts and the containers.

Topology · Cloud View
The InternetRFQ-prod-eks

AWS · ap-south-1 (Mumbai) · Kubernetes cluster nodes streaming traffic to hosts & containers

Now we can run a vulnerability scan, a secret scan, or a malware scan by selecting any of the Kubernetes hosts or specific containers. Also, we can run a one-time scan of our whole Kubernetes cluster. They will scan both the container images for vulnerabilities within a pod and also the host operating system. These scans sit and run in the background, gathering SBOM (software bill of materials) information and reporting back. Finally, we got the scan results for our individual host.

Malware Scans

475

Total

283

High

42

Medium

150

Low

No Data Available

Vulnerabilities · Most Exploitable

Most exploitable vulnerabilities and top attack paths

3
6
5
The Internet

Most vulnerable attack paths

Paths with direct internet exposure

Paths with indirect internet exposure

Secret Scans

218

Total

44 High53 Medium121 Low

Most importantly, ThreatMapper has the ability to stack-rank vulnerabilities so that we know what to fix first.

Secret Scans

With the ThreatMapper Cloud scanner, we can run a compliance scan on our cloud service account and evaluate results against benchmark controls.

Posture · Compliance
AWSGoogle CloudAzureKubernetesLinux Host

1

Total accounts

39%

Compliance %

1

Total scans

783

Total cloud resources

Account IDCloud ProviderActiveCompliance %Actions
aws YES 39%
Start scanView resultsView inventory

We can also use ThreatMapper to perform the same scans against workloads that are hosted in registries.

Registries · Vulnerability Scan
AWS ECR
Azure
Google GCR
Docker Hub
Docker (self hosted)
Quay
Harbor
Gitlab
JFrog

Please feel free to reach out to me at manigandhan@refactorq.com in case you need any help or have any doubts about integrating ThreatMapper in your cloud setup.

Reference links:

www.deepfence.io/threatmapper

github.com/deepfence/threatmapper

Related Engineering Practice

Cloud Security Engineering

Audit cloud attack surfaces, secure Kubernetes workloads, enforce least-privilege IAM, and automate vulnerability remediation.

Explore Cloud Security Engineering Services
Start a conversation

Have a production bottleneck or modernization initiative?

Tell us where your software architecture or cloud environment is experiencing friction. A senior engineer will review your challenge and outline an actionable technical roadmap.

Book a call (opens Microsoft Bookings in a new tab)30 minutes with a senior engineer

A senior engineer reads every enquiry and replies within one business day