nginx-hardening

nginx-hardening is a skill for Claude Code from trumb/claude-nginx-hardening. It costs 52 tokens per session (2,969 once invoked), scanned B, original, MIT.

A security review and rule-management guide for Nginx, the web server that receives and routes website requests.

In plain words
What is it for?
It supports checking Nginx configurations, reviewing access logs, creating rules to block scanners or attacks, handling indicators of compromise, and applying approved hardening changes.
Why use it?
It helps find attack patterns and risky settings while keeping proposed changes for human review before they affect live traffic.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Claude Code.

Part of the claude-nginx-hardening plugin — 1 skill, 8 commands, 3 agents shipped together

Good fit It supports checking Nginx configurations, reviewing access logs, creating rules to block scanners or attacks, handling indicators of compromise, and applying approved hardening changes.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/trumb/claude-nginx-hardening/nginx-hardening
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add trumb/claude-nginx-hardening --skill nginx-hardening
Clone the repo
git clone --depth 1 https://github.com/trumb/claude-nginx-hardening

Made for: Claude Code.

Or install claude-nginx-hardening, the plugin that ships this one along with the rest of its 1 skill, 8 commands, 3 agents.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for nginx-hardening

README.md
[![agentmods](https://agentmods.dev/badge/skills/trumb/claude-nginx-hardening/nginx-hardening/github.svg)](https://agentmods.dev/skills/trumb/claude-nginx-hardening/nginx-hardening)
Your own site
<a href="https://agentmods.dev/skills/trumb/claude-nginx-hardening/nginx-hardening"><img src="https://agentmods.dev/badge/skills/trumb/claude-nginx-hardening/nginx-hardening/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for nginx-hardening

Your own site · 80×15
<a href="https://agentmods.dev/skills/trumb/claude-nginx-hardening/nginx-hardening"><img src="https://agentmods.dev/badge/skills/trumb/claude-nginx-hardening/nginx-hardening.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,969 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00052 $0.02969
Opus 5 $0.00026 $0.01484
Sonnet 5 $0.00010 $0.00594
Haiku 4.5 $0.00005 $0.00297

Measured 11d ago against content hash a201a65f33d0, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-11, from the pricing page.

Security

Grade B, and why

nginx-hardening scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 11d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Reaches for credential filesmediumPrivilege escalation

SSH keys, cloud credentials, git-credentials, .npmrc, /etc/shadow: reading these is how a config file becomes a credential leak.

| 25 | SSH key/cloud creds | Credential file theft | `/.ssh/id_rsa`, `/.aws/credentials`, `/.gcp/credentials.json` |

Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.

skills/nginx-hardening/SKILL.md · 162 lines

How it starts

The opening of the file, as written. The whole thing — 162 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Nginx Hardening Skill — Core Reference

1. Overview

This plugin provides full-lifecycle nginx security hardening through Claude Code. It audits static configs, analyzes access logs for attack patterns, generates blocking rules, and deploys changes through a gated pipeline.

Design goals:

  • Preserve availability — never propose a rule that could block legitimate traffic without explicit human approval
  • Never expose raw attacker data to LLM — all log data is hex-encoded or sanitized before reaching any agent layer
  • Additive-only — rules are appended, never modify or remove existing directives
  • Deterministic writes — all file mutations happen through non-LLM scripts (sanitizer.py, invariant-checker.py), never by agent output
  • Staged recommendation by default — findings are presented for human review; enforcement requires explicit opt-in

2. Operating Modes

Mode Permission Trigger Actions
Recommendation (default) R0 (read config), R1 (read logs) Any audit or analysis command Static analysis, log parsing, finding generation, rule proposals — all read-only
Enforcement W1 (stage files), W2 (write config), X1 (reload nginx) Explicit --enforce flag or human acceptance at decision gate Backup, write rule, run invariant checks, nginx -t, deploy, reload

Recommendation Mode never modifies any file. Enforcement Mode requires passing all 5 pipeline layers including human approval at Layer 4.

3. Analysis Levels

Level Scope Checks Activation
L1 — Static Config nginx conf files Headers (HSTS, CSP, X-Frame, X-Content-Type, Referrer-Policy, Permissions-Policy), TLS floor (protocol versions, cipher posture), unsafe directives (autoindex, server_tokens, merge_slashes off), include hierarchy (circular, missing, duplicated), duplicate/shadowed directives, location block precedence and regex ordering, wildcard server_name, access/error logging presence, rate-limiting configuration (limit_req_zone, limit_conn_zone), proxy header safety (X-Forwarded-For, X-Real-IP, Host passthrough) Always
L2 — Log Analysis access/error logs Scanner UA detection, brute-force patterns (auth endpoints, rate), exploit path probing (by category 1-35), suspicious HTTP methods (TRACE, OPTIONS flood, CONNECT), status code distributions and anomalies, IoC hit matching (IP, path, UA), request rate anomalies per IP/subnet, malicious User-Agent fingerprints If logs present
L3 — Live Test HTTP(S) requests Response header verification (security headers present and correct), TLS handshake verification (protocol, cipher), response code checks (blocked paths return 404), deny-behavior verification (scanner UA gets 444/403), health endpoint reachability Opt-in only

Read the full file on GitHub · 162 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 11d ago First seen · 162 lines · 52 tokens per session scan B a201a65f33d0

Subscribe to this mod's changes

nginx-hardening is a skill published in the GitHub repository trumb/claude-nginx-hardening (3 stars, last pushed 5mo ago), licensed MIT. It adds 52 tokens to every session and 2,969 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it B with 1 finding (reaches for credential files). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

local-ai-agents

Build local-first AI agents that run entirely on a developer workstation with Microsoft Foundry Local and Qwen function-calling models. Covers Small Language Models (SLMs), the OpenAI-compatible local endpoint, sandboxed local tools, local RAG with Chroma, local MCP servers, hybrid cloud/local routing, and the…

microsoft/ai-agents-for-beginners · 200 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

insight-error-page

Write or audit an insight-kind error page for the Next.js dev overlay. Use when creating a new errors/ .mdx page, auditing an existing one, or checking that a page matches the framework fix cards. Covers page structure, title alignment, FixCard cards with Copy prompt button, code snippets, terminology verification…

vercel/next.js · 83 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens

next-partial-prefetching-adoption

Turn on Partial Prefetching in a Next.js app and work through the insights it surfaces. Use when the user wants to enable or adopt Partial Prefetching, flip the partialPrefetching flag, opt routes in with export const prefetch = 'partial', audit Link prefetch={true} behavior, preserve existing prefetched UI with…

vercel/next.js · 103 tokens