K8sAttackMap
Getting Started

Installation

Install K8sAttackMap via pre-built native binary or build from source with GraalVM.

Download the latest pre-built binary for your platform from the GitHub Releases page.

Linux / macOS

# Make executable
chmod +x k8sattackmap

# Verify it works
./k8sattackmap --version

# (Optional) Move to a directory on your PATH for global access
sudo mv k8sattackmap /usr/local/bin/

Windows

# In PowerShell or Command Prompt
k8sattackmap.exe --help

Tip: Add the directory containing k8sattackmap.exe to your system PATH for convenient global access.


Option 2 — Build from Source

Use this option if you want to modify the tool, contribute, or build for an unsupported platform.

Prerequisites for Building

ToolVersionPurpose
GraalVM25 (JDK 25)Compile and build native images
Maven3.9+Build system
Trivy≥ 0.70.0CVE scanning (runtime)
GitanyVersion control

1. Fork & Clone

# Fork the repository on GitHub, then:
git clone https://github.com/<your-username>/K8sAttackMap.git
cd K8sAttackMap

# Add upstream remote
git remote add upstream https://github.com/SaptarshiSarkar12/K8sAttackMap.git

2. Set Up GraalVM Environment

export GRAALVM_HOME=/path/to/graalvm
export PATH=$GRAALVM_HOME/bin:$PATH
export LD_LIBRARY_PATH=$GRAALVM_HOME/lib:$LD_LIBRARY_PATH

# Verify
java -version   # Should show GraalVM JDK 25
native-image --version

3. (Optional) Regenerate GraalVM Metadata

Only needed if you add new code paths that use reflection, serialization, or dynamic class loading:

# Uses testdata/cluster-state.json by default
mvn -P generate-graalvm-metadata exec:exec@java-agent

This runs the tool under the GraalVM agent, which observes runtime behaviour and writes metadata to src/main/resources/META-INF/native-image/. Commit updated metadata files with your change.

4. Build the Native Binary

mvn clean package

The compiled binary is written to target/K8sAttackMap. This step compiles both the Java sources and runs native-image to produce a standalone native executable.

./target/K8sAttackMap --version

Running Tests Only (No Native Image)

mvn test

Tests run against the JVM without requiring native-image. See Contributing → Testing for details on writing and running tests.

On this page