Sign inSign up

htunnthuthu/offsec-ai

By htunnthuthu

•Updated 16 days ago
Archived

network reconnaissance with modern AI/LLM security testing

Image
Security
Machine learning & AI
0

4.3K

htunnthuthu/offsec-ai repository overview

⁠offsec-ai — Docker Documentation

🐳 Official Docker Hub Repository: htunnthuthu/offsec-ai⁠

A comprehensive, lightweight Docker container for network security testing, port scanning, L7 protection detection, SSL/TLS certificate analysis, AI/LLM OWASP scanning, MCP security scanning, and mTLS authentication testing. Perfect for DevSecOps pipelines, security assessments, and network troubleshooting.

ā šŸ“¦ Available Tags

TagDescriptionSizeArchitectures
latestLatest stable release~60MBlinux/amd64, linux/arm64
v2.0.2v2.0.2 — Docker Hub fix, author metadata, docs cleanup~60MBlinux/amd64, linux/arm64
v2.0.1v2.0.1 — logo fix, docs cleanup~60MBlinux/amd64, linux/arm64
v2.0.0v2.0.0 — AI/LLM scanner, MCP scanner, Gemini judge~60MBlinux/amd64, linux/arm64

Recommendation: Use latest for the most recent features, or pin to specific version tags for production deployments.

ā šŸš€ Quick Start

# Run a basic port scan
docker run --rm htunnthuthu/offsec-ai:latest scan example.com

# Check for L7 protection (WAF/CDN)
docker run --rm htunnthuthu/offsec-ai:latest l7-check example.com

# Analyze SSL/TLS certificate chain
docker run --rm htunnthuthu/offsec-ai:latest cert-check example.com

# Full security scan with all features
docker run --rm htunnthuthu/offsec-ai:latest full-scan example.com

ā ļø Usage Examples

⁠Basic Port Scanning
# Scan common ports
docker run --rm htunnthuthu/offsec-ai:latest scan google.com

# Scan specific ports
docker run --rm htunnthuthu/offsec-ai:latest scan example.com --ports 80,443,8080,9000

# Scan multiple targets
docker run --rm htunnthuthu/offsec-ai:latest scan google.com cloudflare.com --concurrent 10
⁠L7 Protection Detection
# Basic L7 protection check
docker run --rm htunnthuthu/offsec-ai:latest l7-check example.com

# L7 check with DNS tracing
docker run --rm htunnthuthu/offsec-ai:latest l7-check example.com --trace-dns

# Check multiple sites for protection
docker run --rm htunnthuthu/offsec-ai:latest l7-check site1.com site2.com
⁠Certificate Chain Analysis
# Basic certificate analysis
docker run --rm htunnthuthu/offsec-ai:latest cert-check github.com

# Complete certificate chain analysis
docker run --rm htunnthuthu/offsec-ai:latest cert-chain example.com

# Detailed certificate information with PEM format
docker run --rm htunnthuthu/offsec-ai:latest cert-info example.com --show-pem

# Certificate analysis with custom port
docker run --rm htunnthuthu/offsec-ai:latest cert-check example.com --port 8443

# Save certificate analysis results
docker run --rm -v $(pwd)/results:/app/output \
  htunnthuthu/offsec-ai:latest cert-chain example.com \
  --output /app/output/cert-analysis.json

# Verify hostname against certificate
docker run --rm htunnthuthu/offsec-ai:latest cert-check example.com --no-verify-hostname

# Enable revocation checking (OCSP/CRL)
docker run --rm htunnthuthu/offsec-ai:latest cert-chain example.com --check-revocation
⁠mTLS Authentication Testing
# Check mTLS support
docker run --rm htunnthuthu/offsec-ai:latest mtls-check example.com

# Test with client certificates (mount volume)
docker run --rm -v /path/to/certs:/certs \
  htunnthuthu/offsec-ai:latest mtls-check example.com \
  --client-cert /certs/client.crt --client-key /certs/client.key

# Generate test certificates
docker run --rm -v $(pwd)/certs:/output \
  htunnthuthu/offsec-ai:latest mtls-gen-cert test.example.com \
  --output-dir /output
⁠Comprehensive Security Scanning
# Full scan with all features
docker run --rm htunnthuthu/offsec-ai:latest full-scan example.com

# Save results to host system
docker run --rm -v $(pwd)/results:/app/output \
  htunnthuthu/offsec-ai:latest full-scan example.com \
  --output /app/output/security-report.json

# Verbose output with detailed logging
docker run --rm htunnthuthu/offsec-ai:latest full-scan example.com --verbose

ā šŸ—ļø Integration Examples

⁠CI/CD Pipeline Integration
⁠GitHub Actions
- name: Security Port Scan
  run: |
    docker run --rm -v ${{ github.workspace }}/reports:/app/output \
      htunnthuthu/offsec-ai:latest full-scan ${{ env.TARGET_HOST }} \
      --output /app/output/security-scan.json

- name: Certificate Analysis
  run: |
    docker run --rm -v ${{ github.workspace }}/reports:/app/output \
      htunnthuthu/offsec-ai:latest cert-chain ${{ env.TARGET_HOST }} \
      --output /app/output/cert-analysis.json --check-revocation
⁠GitLab CI
security_scan:
  image: docker:latest
  script:
    - docker run --rm -v $PWD/reports:/app/output 
        htunnthuthu/offsec-ai:latest full-scan $TARGET_HOST 
        --output /app/output/security-scan.json
    - docker run --rm -v $PWD/reports:/app/output
        htunnthuthu/offsec-ai:latest cert-chain $TARGET_HOST
        --output /app/output/cert-analysis.json
  artifacts:
    reports:
      paths:
        - reports/security-scan.json
        - reports/cert-analysis.json
⁠Jenkins Pipeline
pipeline {
    agent any
    stages {
        stage('Security Scan') {
            steps {
                sh '''
                    docker run --rm -v $WORKSPACE/reports:/app/output \
                      htunnthuthu/offsec-ai:latest full-scan $TARGET_HOST \
                      --output /app/output/security-scan.json
                '''
                sh '''
                    docker run --rm -v $WORKSPACE/reports:/app/output \
                      htunnthuthu/offsec-ai:latest cert-chain $TARGET_HOST \
                      --output /app/output/cert-analysis.json --verbose
                '''
                archiveArtifacts artifacts: 'reports/*.json'
            }
        }
    }
}
⁠Docker Compose Integration
version: '3.8'
services:
  port-scanner:
    image: htunnthuthu/offsec-ai:latest
    command: full-scan example.com --output /app/output/results.json
    volumes:
      - ./scan-results:/app/output
    environment:
      - TARGET_HOST=example.com
      
  cert-analyzer:
    image: htunnthuthu/offsec-ai:latest
    command: cert-chain example.com --output /app/output/cert-analysis.json --check-revocation
    volumes:
      - ./cert-results:/app/output
    environment:
      - TARGET_HOST=example.com
⁠Kubernetes Job
apiVersion: batch/v1
kind: Job
metadata:
  name: security-port-scan
spec:
  template:
    spec:
      containers:
      - name: port-scanner
        image: htunnthuthu/offsec-ai:latest
        command: ["offsec-ai", "full-scan", "example.com"]
        volumeMounts:
        - name: results-volume
          mountPath: /app/output
      volumes:
      - name: results-volume
        persistentVolumeClaim:
          claimName: scan-results-pvc
      restartPolicy: Never
---
apiVersion: batch/v1
kind: Job
metadata:
  name: certificate-analysis
spec:
  template:
    spec:
      containers:
      - name: cert-analyzer
        image: htunnthuthu/offsec-ai:latest
        command: ["offsec-ai", "cert-chain", "example.com", "--output", "/app/output/cert-analysis.json"]
        volumeMounts:
        - name: cert-volume
          mountPath: /app/output
      volumes:
      - name: cert-volume
        persistentVolumeClaim:
          claimName: cert-results-pvc
      restartPolicy: Never

⁠� Certificate Analysis Features

⁠Certificate Chain Analysis
  • āœ… Complete SSL/TLS certificate chain extraction
  • āœ… Certificate validation and trust path verification
  • āœ… Missing intermediate certificate detection
  • āœ… Certificate expiration and validity checking
  • āœ… Hostname validation against certificate SAN/CN
⁠Certificate Information
  • āœ… Certificate subject and issuer details
  • āœ… Public key algorithm and key size analysis
  • āœ… Digital signature algorithm identification
  • āœ… Certificate extensions parsing (Key Usage, EKU, etc.)
  • āœ… Subject Alternative Names (SAN) extraction
⁠Trust and Security Analysis
  • āœ… Chain of trust validation
  • āœ… Self-signed certificate detection
  • āœ… CA certificate identification
  • āœ… OCSP and CRL URL extraction for revocation checking
  • āœ… Certificate fingerprint generation (SHA-1, SHA-256)

ā šŸ¤– AI / LLM Security Usage

The image ships with openai and anthropic pre-installed ([ai] extra). Pass an API key at runtime to enable the LLM Judge for smarter semantic vulnerability detection.

⁠AI OWASP Top 10 Scan (rule-based, no key required)
docker run --rm htunnthuthu/offsec-ai:latest \
  ai-owasp-scan https://api.example.com/v1/chat/completions
⁠AI OWASP Top 10 Scan with LLM Judge
# OpenAI judge
docker run --rm \
  -e OPENAI_API_KEY=sk-... \
  htunnthuthu/offsec-ai:latest \
  ai-owasp-scan https://api.example.com/v1/chat/completions --llm-judge

# Anthropic judge
docker run --rm \
  -e ANTHROPIC_API_KEY=sk-ant-... \
  htunnthuthu/offsec-ai:latest \
  ai-owasp-scan https://api.example.com/v1/chat/completions --llm-judge

# Google Gemini judge (no extra package needed)
docker run --rm \
  -e GEMINI_API_KEY=AIzaSy... \
  htunnthuthu/offsec-ai:latest \
  ai-owasp-scan https://api.example.com/v1/chat/completions --llm-judge

# Custom OpenAI-compatible endpoint (Ollama, LM Studio, Azure OpenAI, etc.)
docker run --rm \
  -e OFFSEC_LLM_BASE_URL=http://host.docker.internal:11434/v1 \
  -e OFFSEC_LLM_MODEL=llama3 \
  htunnthuthu/offsec-ai:latest \
  ai-owasp-scan https://api.example.com/v1/chat/completions --llm-judge
⁠MCP Security Scan
# Scan an MCP endpoint
docker run --rm htunnthuthu/offsec-ai:latest \
  mcp-scan https://mcp.example.com/mcp

# Active MCP attack (requires authorization flag)
docker run --rm htunnthuthu/offsec-ai:latest \
  mcp-attack https://mcp.example.com/mcp --i-have-authorization --mode deep

ā šŸ”§ Configuration & Environment

⁠LLM / AI Judge Environment Variables
VariableProviderDescription
OPENAI_API_KEYOpenAIEnables OpenAI judge (e.g. gpt-4o-mini)
ANTHROPIC_API_KEYAnthropicEnables Anthropic judge (e.g. claude-3-haiku)
GEMINI_API_KEYGoogleEnables Gemini judge (e.g. gemini-1.5-flash)
OFFSEC_LLM_BASE_URLAny OpenAI-compatibleUse a custom/local endpoint as the judge backend
OFFSEC_LLM_MODELAllOverride the default model name

Provider is auto-detected from whichever key is set; OFFSEC_LLM_BASE_URL takes precedence over OPENAI_API_KEY.

⁠General Environment Variables
# Set timeout for operations
docker run --rm -e TIMEOUT=30 htunnthuthu/offsec-ai:latest scan example.com

# Enable debug logging
docker run --rm -e DEBUG=1 htunnthuthu/offsec-ai:latest l7-check example.com

# Certificate analysis timeout
docker run --rm -e CERT_TIMEOUT=15 htunnthuthu/offsec-ai:latest cert-chain example.com
⁠Volume Mounts
# Mount configuration directory
docker run --rm -v /host/config:/app/config \
  htunnthuthu/offsec-ai:latest scan example.com

# Mount output directory for reports
docker run --rm -v /host/reports:/app/output \
  htunnthuthu/offsec-ai:latest full-scan example.com \
  --output /app/output/report.json

# Mount certificate directory for mTLS
docker run --rm -v /host/certs:/app/certs \
  htunnthuthu/offsec-ai:latest mtls-check example.com \
  --client-cert /app/certs/client.crt --client-key /app/certs/client.key

ā šŸ”’ Security Features

⁠Non-Root User
  • āœ… Container runs as non-root user appuser (UID: 1000)
  • āœ… No privileged access required
  • āœ… Minimal attack surface
⁠Minimal Dependencies
  • āœ… Based on Debian slim for minimal footprint
  • āœ… Only essential packages included
  • āœ… Regular security updates via automated builds
⁠Security Scanning
  • āœ… Images scanned with Trivy for vulnerabilities
  • āœ… Security reports available in repository
  • āœ… SARIF format reports for integration

ā šŸ·ļø Image Specifications

⁠Base Image
  • OS: Debian GNU/Linux 12 Bookworm slim (python:3.12-slim-bookworm)
  • Python: 3.12+
  • Architecture: Multi-arch (AMD64, ARM64)
  • User: Non-root (appuser:appuser, UID/GID 1000)
⁠Installed Tools
  • āœ… offsec-ai (latest version)
  • āœ… Python runtime and required dependencies
  • āœ… openai & anthropic packages — bundled via [ai] extra; LLM judge activates automatically when you pass an API key env var
  • āœ… SSL/TLS libraries for certificate handling
  • āœ… DNS resolution utilities
  • āœ… nmap for port scanning
  • āœ… Cryptography libraries for certificate analysis
⁠Performance
  • Image Size: ~55MB compressed (with certificate analysis tools)
  • Startup Time: <2 seconds
  • Memory Usage: <100MB typical, <150MB with certificate analysis
  • CPU Usage: Optimized for concurrent operations
  • Certificate Analysis: <5 seconds for typical certificate chains

ā šŸ“Š Output Formats

⁠JSON Output
# Structured JSON for automation
docker run --rm htunnthuthu/offsec-ai:latest scan example.com --format json

# Pretty printed JSON
docker run --rm htunnthuthu/offsec-ai:latest scan example.com --format json --pretty

# Certificate analysis in JSON format
docker run --rm htunnthuthu/offsec-ai:latest cert-chain example.com --output cert-results.json
⁠Text Output
# Human readable text (default)
docker run --rm htunnthuthu/offsec-ai:latest scan example.com

# Verbose text output
docker run --rm htunnthuthu/offsec-ai:latest scan example.com --verbose
⁠CSV Output
# CSV format for spreadsheet import
docker run --rm htunnthuthu/offsec-ai:latest scan example.com --format csv

ā šŸ› Troubleshooting

⁠Common Issues
⁠Permission Denied
# Ensure proper volume permissions
docker run --rm -v $(pwd)/output:/app/output:Z \
  htunnthuthu/offsec-ai:latest scan example.com \
  --output /app/output/results.json
⁠Network Connectivity
# Test network connectivity
docker run --rm htunnthuthu/offsec-ai:latest scan google.com

# Use host networking if needed
docker run --rm --network host \
  htunnthuthu/offsec-ai:latest scan localhost
⁠Certificate Issues
# Debug certificate chain retrieval
docker run --rm htunnthuthu/offsec-ai:latest cert-check example.com --verbose

# Disable hostname verification for testing
docker run --rm htunnthuthu/offsec-ai:latest cert-check example.com --no-verify-hostname

# Test certificate with custom port
docker run --rm htunnthuthu/offsec-ai:latest cert-info example.com --port 8443

# Show certificate in PEM format for inspection
docker run --rm htunnthuthu/offsec-ai:latest cert-info example.com --show-pem
⁠Debug Mode
# Enable verbose logging
docker run --rm htunnthuthu/offsec-ai:latest scan example.com --verbose

# Get version information
docker run --rm htunnthuthu/offsec-ai:latest --version

# Display help
docker run --rm htunnthuthu/offsec-ai:latest --help

ā šŸ“ˆ Performance Tuning

⁠Concurrent Operations
# Adjust concurrency for better performance
docker run --rm htunnthuthu/offsec-ai:latest scan example.com --concurrent 20

# Scan multiple targets efficiently
docker run --rm htunnthuthu/offsec-ai:latest scan \
  site1.com site2.com site3.com --concurrent 10
⁠Resource Limits
# Set memory limits
docker run --rm --memory=512m htunnthuthu/offsec-ai:latest scan example.com

# Set CPU limits
docker run --rm --cpus=2 htunnthuthu/offsec-ai:latest full-scan example.com

ā ļæ½ļø Building & Publishing Locally

The Makefile provides convenience targets for building and pushing to Docker Hub.

# Build the image locally
make docker-build

# Build without cache
make docker-build-no-cache

# Build multi-arch (linux/amd64 + linux/arm64) — requires docker buildx
make docker-build-multi

# Push to Docker Hub (builds first, then tags + pushes :version and :latest)
make docker-push                              # uses DOCKER_USERNAME=htunnthuthu by default
make docker-push DOCKER_USERNAME=youruser     # override username

# Full release in one command
make docker-release                           # equivalent to docker-build + docker-push

# Test the local image
make docker-test

# Scan image for vulnerabilities (requires trivy)
make docker-scan

# Clean up local Docker artifacts
make docker-clean

The DOCKER_VERSION is read automatically from pyproject.toml, so the published tags match the package version exactly.


ā šŸ“„ License

This project is licensed under the MIT License - see the LICENSE⁠ file for details.

ā šŸ¤ Contributing

We welcome contributions! Please see our Contributing Guide⁠ for details.


Maintainer: htunnthuthu⁠ ([email protected]⁠)
Last Updated: June 29, 2026
Docker Hub: htunnthuthu/offsec-ai⁠

Tag summary

Content type

Image

Digest

sha256:8dba782bd…

Size

92.3 MB

Last updated

16 days ago

docker pull htunnthuthu/offsec-ai