f3ccc09c3d
Build comprehensive malware analysis knowledge base from 3 sources: - SANS FOR610 course: 120 tools, 47 labs, 15 workflows, 27 recipes - REMnux salt-states: 340 packages parsed from GitHub - REMnux docs: 280+ tools scraped from docs.remnux.org Master inventory merges all sources into 447 tools with help tiers (rich/standard/basic). Pipeline generates: tools.db (397 entries), 397 cheatsheets with multi-tool recipes, 15 workflow guides, 224 TLDR pages, and coverage reports. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
95 lines
3.5 KiB
Makefile
95 lines
3.5 KiB
Makefile
.PHONY: help build-upstream build-scratch build-kali build-all test clean push generate-data generate-master coverage-report
|
|
|
|
# Default target
|
|
help:
|
|
@echo "File Analysis Container - Build System"
|
|
@echo ""
|
|
@echo "Available targets:"
|
|
@echo " build Build from REMnux upstream image (recommended, default)"
|
|
@echo " build-scratch Build from Ubuntu 20.04 base (full control)"
|
|
@echo " build-all Build all variants"
|
|
@echo " test Run tests on all builds"
|
|
@echo " test-remnux Test REMnux build"
|
|
@echo " test-scratch Test scratch build"
|
|
@echo " push Push images to Docker Hub"
|
|
@echo " clean Remove all built images"
|
|
@echo " shell Interactive shell (REMnux build)"
|
|
@echo " shell-scratch Interactive shell (scratch build)"
|
|
@echo " coverage Check help coverage"
|
|
@echo " generate-data Convert FOR610 YAML to JSON"
|
|
@echo " generate-master Build master inventory and all help artifacts"
|
|
@echo " coverage-report Generate tool coverage gap report"
|
|
@echo ""
|
|
|
|
# Build targets
|
|
build:
|
|
@echo "Building REMnux-based file analysis container..."
|
|
docker build -t tabledevil/file-analysis:latest .
|
|
docker tag tabledevil/file-analysis:latest tabledevil/file-analysis:remnux
|
|
@echo "✓ Build complete: tabledevil/file-analysis:latest"
|
|
|
|
build-scratch:
|
|
@echo "Building from scratch (Ubuntu 20.04 base)..."
|
|
docker build -f Dockerfile.scratch -t tabledevil/file-analysis:latest .
|
|
@echo "✓ Build complete: tabledevil/file-analysis:latest"
|
|
|
|
|
|
# Test targets
|
|
test:
|
|
@echo "Testing REMnux build..."
|
|
@docker run --rm tabledevil/file-analysis:latest bash -c "which fhelp && fhelp cheat pdfid"
|
|
@docker run --rm tabledevil/file-analysis:latest bash -c "which pdfid.py && which capa && which visidata"
|
|
@docker run --rm tabledevil/file-analysis:latest bash -c "zsh --version && fish --version"
|
|
@echo "✓ REMnux build tests passed"
|
|
|
|
|
|
# Docker Hub push
|
|
push:
|
|
@echo "Pushing images to Docker Hub..."
|
|
docker push tabledevil/file-analysis:latest
|
|
@echo "✓ Images pushed successfully"
|
|
|
|
# Clean up
|
|
clean:
|
|
@echo "Removing built images..."
|
|
-docker rmi tabledevil/file-analysis:latest
|
|
-docker rmi tabledevil/file-analysis:remnux
|
|
-docker rmi tabledevil/file-analysis:scratch
|
|
@echo "✓ Cleanup complete"
|
|
|
|
# Interactive shells for testing
|
|
shell:
|
|
docker run -it --rm -v "$$(pwd):/data" tabledevil/file-analysis:latest
|
|
|
|
|
|
# Run help coverage check
|
|
coverage:
|
|
@echo "Checking help coverage..."
|
|
@docker run --rm tabledevil/file-analysis:latest /usr/local/bin/check-help-coverage.sh || true
|
|
|
|
# Generate JSON from FOR610 YAML knowledge base
|
|
generate-data:
|
|
@echo "Generating JSON from FOR610 YAML files..."
|
|
@mkdir -p data/generated
|
|
@for f in data/for610/*.yaml; do \
|
|
name=$$(basename "$$f" .yaml); \
|
|
python3 -c "import yaml,json; json.dump(yaml.safe_load(open('$$f')),open('data/generated/$$name.json','w'),indent=2)"; \
|
|
echo " ✓ $$name.json"; \
|
|
done
|
|
@echo "✓ JSON files generated in data/generated/"
|
|
|
|
# Build master inventory from all 3 sources and generate all help artifacts
|
|
generate-master: generate-data
|
|
@echo "Building master tool inventory..."
|
|
python3 scripts/parse-salt-states.py
|
|
python3 scripts/scrape-remnux-docs.py
|
|
python3 scripts/build-master-inventory.py
|
|
python3 scripts/generate-help-artifacts.py
|
|
python3 scripts/generate-coverage-report.py
|
|
@echo "✓ Master inventory and all artifacts generated"
|
|
|
|
# Generate coverage report only (requires tools-master.yaml to exist)
|
|
coverage-report:
|
|
python3 scripts/generate-coverage-report.py
|
|
@echo "Report: data/generated/coverage-report.md"
|