graph LR
A[Security Tools] --> B[Network Scanning]
A --> C[Penetration Testing]
A --> D[Forensics]
B --> E[Nmap]
B --> F[Wireshark]
C --> G[Metasploit]
C --> H[Burp Suite]
D --> I[Volatility]
Category |
Tools |
Deployment Method |
Network Scanning |
Nmap, Netcat |
Direct Container |
Vulnerability Assessment |
OpenVAS, Nessus |
Dedicated Container |
Penetration Testing |
Metasploit, Kali Linux |
Isolated Network |
Nmap Container Dockerfile
FROM ubuntu:22.04
RUN apt-get update && \
apt-get install -y nmap \
iputils-ping \
net-tools
WORKDIR /nmap-tools
ENTRYPOINT ["nmap"]
Building and Running Nmap Container
## Build Nmap container
docker build -t labex/nmap-tool:v1 .
## Run Nmap scan
docker run --rm labex/nmap-tool:v1 -sV target_ip
Docker Compose for Security Lab
version: '3'
services:
kali:
image: kalilinux/kali-rolling
networks:
- security-net
privileged: true
metasploit:
image: metasploitframework/metasploit-framework
networks:
- security-net
vulnerable-web:
image: vulnerables/web-dvwa
networks:
- security-net
networks:
security-net:
driver: bridge
Launching Compose Environment
## Initialize docker-compose
docker-compose up -d
## Check running containers
docker-compose ps
Volume Mapping for Persistent Data
## Create persistent storage for tools
docker run -v /host/logs:/tool-logs \
-v /host/reports:/tool-reports \
labex/security-toolkit
Inter-Container Communication
## Create custom network
docker network create security-lab
## Run containers in network
docker run --network security-lab \
--name nmap-scanner \
labex/nmap-tool
- Use minimal base images
- Implement least privilege principle
- Regularly update tool containers
- Use multi-stage builds
- Implement secure network segmentation
Monitoring and Logging
## Centralized logging
docker run -d \
-v /var/log/docker:/var/log \
labex/log-collector
## Real-time container monitoring
docker stats
By leveraging Docker's flexibility, LabEx users can create dynamic, reproducible security testing environments with minimal overhead and maximum configurability.