Analysis environment
Tooling
The tools that will be used during the workshop are:
- OWASP Threat Dragon for modelling the cyberthreats for a given application;
- Gitleaks for scanning a Git repository for leaked secrets;
- OSV-Scanner for scanning dependencies for vulnerabilities;
- flawfinder for statically analysing C code to find security concerns;
- Bandit for statically analysing Python code to find security concerns;
- Semgrep for code querying;
- AFL++ for fuzzing C code; and
- KLEE for symbolically executing C code.
Docker infrastructure
For the analysed application and the above tooling, the workshop provides a Docker Compose infrastructure with the following services/containers:
Sand Castle
- Service name:
sandcastle - Description: Demo Sand Castle instance
- Docker Compose profiles
sandcastleall
Dockerfilein theossfortressrepository:sandcastle/Dockerfile- Hosted image:
iosifache/sandcastle:mainin GitHub Container Registry - Exposed ports:
8000for the web UI - User:
root - Credentials: N/A
- Relevant folders: N/A
OWASP Threat Dragon
- Service name:
owasp_threat_dragon - Description: OWASP Threat Dragon instance, accessible from
localhost - Docker Compose profiles
threat-modellingall
Dockerfilein theossfortressrepository: N/A- Hosted image:
owasp/threat-dragon:latestin Docker Hub - Exposed ports:
8001for the web UI - User:
root - Credentials: N/A
- Relevant folders: N/A
Coder
- Service name:
coder - Description: Coder instance, accessible from
localhost - Docker Compose profiles
threat-modellingall
Dockerfilein theossfortressrepository:tooling/coder/Dockerfile- Hosted image:
iosifache/coder:mainin GitHub Container Registry - Exposed ports:
8002for the web UI - User:
coder - Credentials:
ossfortressas the password for authenticating in the user interface - Relevant folders
/home/coder/codebasefor Sand Castle's codebase/home/coder/toolingfor the tooling-related information/home/coder/analysisfor files resulted during the analysis of the vulnerable codebase
Static analysers
- Service name:
static-analysers - Description: Ubuntu container with static analysers (Gitleaks, OSV-Scanner, flawfinder, Bandit, and Semgrep) installed
- Docker Compose profiles
static-analysisall
Dockerfilein theossfortressrepository:tooling/static-analysers/Dockerfile- Hosted image:
iosifache/static-analysers:mainin GitHub Container Registry - Exposed ports: N/A
- User:
root - Credentials: N/A
- Relevant folders
/root/codebasefor the Sand Castle codebase/root/toolingfor the tooling-related information/root/analysisfor files resulted during the analysis of the vulnerable codebase
AFL++
- Service name:
aflplusplus - Description: Container with AFL++ installed
- Docker Compose profiles
dynamic-analysisall
Dockerfilein theossfortressrepository:tooling/aflplusplus/Dockerfile- Hosted image:
iosifache/aflplusplus:mainin GitHub Container Registry - Exposed ports: N/A
- User:
root - Credentials: N/A
- Relevant folders
/root/codebasefor the Sand Castle codebase/root/toolingfor the tooling-related information/root/analysisfor files resulted during the analysis of the vulnerable codebase
KLEE
- Service name:
klee - Description: Container with KLEE installed
- Docker Compose profiles
dynamic-analysisall
Dockerfilein theossfortressrepository: N/A- Hosted image:
klee/klee:latestin GitHub Container Registry - Exposed ports: N/A
- User:
root - Credentials: N/A
- Relevant folders
/root/codebasefor the Sand Castle codebase/root/toolingfor the tooling-related information/root/analysisfor files resulted during the analysis of the vulnerable codebase
Overview
The below infrastructure presents the recommended workflow for analysis, using the recommended tooling and Docker Compose services.
Setup
The infrastructure can be setup:
- Manually: Follow the installation guide provided in the documentation of each each tool. The documentations are linked in the pages for each tool.
- By using the provided Docker Compose infrastructure.
Docker Compose
Please ensure you have installed Docker Engine and Docker Compose.
On Debian-based operating systems, it's as easy as running the convenience script and installing docker-compose-plugin via apt.
Clone the GitHub repository as follows:
git clone https://github.com/iosifache/ossfortress
You can use docker-compose --profile all pull to pull the GHCR images. Otherwise, use docker-compose --profile all build for building the images from scratch. If the build fails, try running again after setting the DOCKER_BUILDKIT environment variable as follows: export DOCKER_BUILDKIT=1.
docker-compose --profile all up will spin up the services.