Skip to content

armgit / ARES

Public Imported from GitHub
0

ARES - authorized red-team engagement automation with dashboard, campaign scope, module orchestration, OPSEC controls, encrypted vault, and reporting.

2.7 KB
Raw Blame
# ARES Production nginx config
# Place TLS certs in docker/certs/ares.crt and docker/certs/ares.key

# TLS access logs use $uri, which omits one-time WebSocket ticket queries.
# Do not replace $uri with $request_uri in the production access log format.
log_format ares_redacted '$remote_addr - $remote_user [$time_local] '
    '"$request_method $uri [REDACTED_QUERY] $server_protocol" '
    '$status $body_bytes_sent "$http_referer" "$http_user_agent"';
map $request_uri $redacted_uri {
    ~^(?P<path>[^?]*)      $path;
}

#
# IMPORTANT: Replace server_name with your actual FQDN before deploying.
# Using server_name _ (catch-all) accepts connections from any hostname.
# Example: server_name ares.corp.local;

# HTTP to HTTPS redirect deliberately uses $uri. The unsupported
# plaintext queries are dropped instead of reflected. Production clients must
# connect with HTTPS/WSS directly.
server {
    listen 80;
    server_name _;  # TODO: replace with FQDN, e.g. ares.corp.local
    access_log /var/log/nginx/ares_access.log ares_redacted;
    return 308 https://$host$uri;
}

server {
    listen 443 ssl http2;
    server_name _;  # TODO: replace with FQDN, e.g. ares.corp.local

    ssl_certificate     /etc/nginx/certs/ares.crt;
    ssl_certificate_key /etc/nginx/certs/ares.key;
    ssl_protocols       TLSv1.2 TLSv1.3;
    ssl_ciphers         ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305;
    ssl_prefer_server_ciphers off;
    ssl_session_cache   shared:SSL:10m;

    # $uri omits one-time ticket queries. This format does not log Cookie,
    # Authorization, Set-Cookie, or any query string.
    access_log /var/log/nginx/ares_access.log ares_redacted;

    # Security headers
    add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
    add_header X-Frame-Options DENY always;
    add_header X-Content-Type-Options nosniff always;
    add_header Referrer-Policy strict-origin-when-cross-origin always;

    # Proxy to ARES API
    location / {
        proxy_pass         http://ares-api:8080;
        proxy_set_header   Host $host;
        proxy_set_header   X-Real-IP $remote_addr;
        proxy_set_header   X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header   X-Forwarded-Proto $scheme;
        proxy_read_timeout 120s;
        client_max_body_size 10m;
    }

    # WebSocket support
    location /ws/ {
        proxy_pass         http://ares-api:8080;
        proxy_http_version 1.1;
        proxy_set_header   Upgrade $http_upgrade;
        proxy_set_header   Connection "upgrade";
        proxy_set_header   Host $host;
        proxy_read_timeout 3600s;
    }
}