AgentsConfigHelper / rules
Cursor rule2 starsChanged 3 months agoMITView on GitHub
DevOps, CI/CD, and containers (pipeline hardening, artifacts, Docker/K8s images, virtual patching, toolchain)
We split this codeguard-0-devops-ci-cd-containers.mdc into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 23
Use --security-opt=no-new-privileges to prevent privilege escalation.
- Very specific: line 26
DO NOT enable TCP Docker daemon socket (-H tcp://0.0.0.0:XXX) without TLS.
- Very specific: line 27
Avoid - "/var/run/docker.sock:/var/run/docker.sock" in docker-compose files.
- Very specific: line 42
Use WAF/IPS/ModSecurity for immediate protection when code fixes are not yet possible.
- Distinctive: line 43
Prefer positive security rules (allow‑list) for accuracy.
≈ “Common” is an estimate: at least 1 in 5 of the 6,350 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
--- description: DevOps, CI/CD, and containers (pipeline hardening, artifacts, Docker/K8s images, virtual patching, toolchain) globs: **/*.bash,**/*.dockerfile,**/*.js,**/*.jsx,**/*.mjs,**/*.ps1,**/*.sh,**/*.wsdl,**/*.xml,**/*.xsd,**/*.xslt,**/*.yaml,**/*.yml,Dockerfile*,docker-compose* version: 1.0.1 --- rule_id: codeguard-0-devops-ci-cd-containers ## DevOps, CI/CD, and Containers Secure the build, packaging, and deployment supply chain: protect pipelines and artifacts, harden containers, and use virtual patching and toolchain flags when necessary. ### CI/CD Pipeline Security - Repos: protected branches; mandatory reviews; signed commits. - Secrets: never hardcode; fetch at runtime from vault/KMS; mask in logs. - Least privilege: ephemeral, isolated runners with minimal permissions. - Security gates in CI: SAST, SCA, DAST, IaC scanning; block on criticals. - Dependencies: pin via lockfiles; verify integrity; use private registries. - Sign everything: commits and artifacts (containers/jars) and verify prior to deploy; adopt SLSA provenance. ### Docker and Container Hardening - User: run as non‑root; set `USER` in Dockerfile - Use `--security-opt=no-new-privileges` to prevent privilege escalation. - Capabilities: `--cap-drop all` and add only what you need; never `--privileged`. - Daemon socket: never mount `/var/run/docker.sock` - DO NOT enable TCP Docker daemon socket (`-H tcp://0.0.0.0:XXX`) without TLS. - Avoid `- "/var/run/docker.sock:/var/run/docker.sock"` in docker-compose files. - Filesystems: read‑only root, tmpfs for temp write; resource limits (CPU/mem). - Networks: avoid host network; define custom networks; limit exposed ports. - Images: minimal base (distroless/alpine), pin tags and digests; remove package managers and tools from final image; add `HEALTHCHECK`. - Secrets: Docker/Kubernetes secrets; never in layers/env; mount via runtime secrets. - Scanning: scan images on build and admission; block high‑severity vulns. ### Node.js in Containers - Deterministic builds: `npm ci --omit=dev`; pin base image with digest. - Production env: `ENV NODE_ENV=production`. - Non‑root: copy with correct ownership and drop to `USER node`. - Signals: use an init (e.g., `dumb-init`) and implement graceful shutdown handlers. - Multi‑stage builds: separate build and runtime; mount secrets via BuildKit; use `.dockerignore`. ### Virtual Patching (Temporary Mitigation) - Use WAF/IPS/ModSecurity for immediate protection when code fixes are not yet possible. - Prefer positive security rules (allow‑list) for accuracy; avoid exploit‑specific signatures. - Process: prepare tooling in advance; analyze CVEs; implement patches in log‑only first, then enforce; track and retire after code fix. ### C/C++ Toolchain Hardening (when applicable) - Compiler: `-Wall -Wextra -Wconversion`, `-fstack-protector-all`, PIE (`-fPIE`/`-pie`), `_FORTIFY_SOURCE=2`, CFI (`-fsanitize=cfi` with LTO). - Linker: RELRO/now, noexecstack, NX/DEP and ASLR. - Debug vs Release: enable sanitizers in debug; enable hardening flags in release; assert in debug only. - CI checks: verify flags (`checksec`) and fail builds if protections missing. ### Implementation Checklist - Pipeline: secrets in vault; ephemeral runners; security scans; signed artifacts with provenance. - Containers: non‑root, least privilege, read‑only FS, resource limits; no daemon socket mounts. - Images: minimal, pinned, scanned; healthchecks; `.dockerignore` maintained. - Node images: `npm ci`, `NODE_ENV=production`, proper init and shutdown. - Virtual patching: defined process; accurate rules; logs; retirement after fix. - Native builds: hardening flags enabled and verified in CI.
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 3,978 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository24 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/codeguard-0-additional-cryptography.mdcCursor rule
- .cursor/rules/codeguard-0-api-web-services.mdcCursor rule
- .cursor/rules/codeguard-0-authentication-mfa.mdcCursor rule
- .cursor/rules/codeguard-0-authorization-access-control.mdcCursor rule
- .cursor/rules/codeguard-0-client-side-web-security.mdcCursor rule
- .cursor/rules/codeguard-0-cloud-orchestration-kubernetes.mdcCursor rule
- .cursor/rules/codeguard-0-data-storage.mdcCursor rule
- .cursor/rules/codeguard-0-file-handling-and-uploads.mdcCursor rule
- .cursor/rules/codeguard-0-framework-and-languages.mdcCursor rule
- .cursor/rules/codeguard-0-iac-security.mdcCursor rule
- .cursor/rules/codeguard-0-input-validation-injection.mdcCursor rule
- .cursor/rules/codeguard-0-logging.mdcCursor rule
- .cursor/rules/codeguard-0-mobile-apps.mdcCursor rule
- .cursor/rules/codeguard-0-privacy-data-protection.mdcCursor rule
- .cursor/rules/codeguard-0-safe-c-functions.mdcCursor rule
- .cursor/rules/codeguard-0-session-management-and-cookies.mdcCursor rule
- .cursor/rules/codeguard-0-supply-chain-security.mdcCursor rule
- .cursor/rules/codeguard-0-xml-and-serialization.mdcCursor rule
- .cursor/rules/codeguard-1-crypto-algorithms.mdcCursor rule
- .cursor/rules/codeguard-1-digital-certificates.mdcCursor rule
- .cursor/rules/codeguard-1-hardcoded-credentials.mdcCursor rule
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

