Skip to content

Commit c5ffd91

Browse files
hyperpolymathclaude
andcommitted
feat: CloudGuard CLI — standalone Cloudflare domain security tool
Rust CLI built with clap providing: - cloudguard audit: compliance check against hardening policy (16 constraints) - cloudguard harden: apply security settings with --dry-run support - cloudguard sync download: offline config export to JSON - cloudguard dns list|add|delete|bulk-add: DNS management + security templates - cloudguard zones list|status: zone inventory - JSON output mode (--format json) for CI/CD automation - Rate-limited CF API client (333ms interval) - Auth via CLOUDFLARE_API_TOKEN env or ~/.config/cloudguard/credentials Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
0 parents  commit c5ffd91

159 files changed

Lines changed: 18084 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.clinerules

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}>
3+
# Authoritative source: docs/AI-CONVENTIONS.md
4+
5+
# STARTUP: Read 0-AI-MANIFEST.a2ml first, then .machine_readable/STATE.a2ml.
6+
7+
# LICENSE
8+
# All original code: PMPL-1.0-or-later.
9+
# Never AGPL-3.0. MPL-2.0 only as platform-required fallback.
10+
# SPDX header required on every source file.
11+
# Copyright: {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}>
12+
13+
# STATE FILES (.machine_readable/ ONLY)
14+
# Never create in repo root: STATE.a2ml, META.a2ml, ECOSYSTEM.a2ml,
15+
# AGENTIC.a2ml, NEUROSYM.a2ml, PLAYBOOK.a2ml.
16+
# The .machine_readable/ directory is the single source of truth.
17+
18+
# BANNED PATTERNS
19+
# Idris2: believe_me, assert_total, assert_smaller, unsafePerformIO
20+
# Haskell: unsafeCoerce, unsafePerformIO, undefined, error
21+
# OCaml: Obj.magic, Obj.repr, Obj.obj
22+
# Coq: Admitted
23+
# Lean: sorry
24+
# Rust: transmute (unless FFI with // SAFETY: comment)
25+
26+
# BANNED LANGUAGES
27+
# TypeScript -> ReScript
28+
# Node.js / npm / bun -> Deno
29+
# Go -> Rust
30+
# Python -> Julia or Rust
31+
32+
# CONTAINERS
33+
# Runtime: Podman (never Docker).
34+
# File: Containerfile (never Dockerfile).
35+
# Base: cgr.dev/chainguard/wolfi-base:latest or cgr.dev/chainguard/static:latest.
36+
37+
# ABI/FFI
38+
# ABI: Idris2 with dependent types (src/abi/).
39+
# FFI: Zig with C ABI (ffi/zig/).
40+
# Headers: generated/abi/.
41+
42+
# BUILD: Use just (justfile) for all tasks.
43+
# STYLE: Descriptive names. Document all files. SPDX headers everywhere.

.cursorrules

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}>
3+
# Authoritative source: docs/AI-CONVENTIONS.md
4+
5+
# Read 0-AI-MANIFEST.a2ml in the repo root FIRST for canonical file locations.
6+
7+
# LICENSE
8+
# All original code: PMPL-1.0-or-later (SPDX header required on every file).
9+
# Never use AGPL-3.0. Fallback to MPL-2.0 only when platform requires it.
10+
# Copyright: {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}>
11+
12+
# STATE FILES
13+
# .a2ml metadata files go in .machine_readable/ ONLY.
14+
# Never create STATE.a2ml, META.a2ml, ECOSYSTEM.a2ml, AGENTIC.a2ml,
15+
# NEUROSYM.a2ml, or PLAYBOOK.a2ml in the repository root.
16+
17+
# BANNED PATTERNS
18+
# Idris2: believe_me, assert_total, assert_smaller, unsafePerformIO
19+
# Haskell: unsafeCoerce, unsafePerformIO, undefined, error
20+
# OCaml: Obj.magic, Obj.repr, Obj.obj
21+
# Coq: Admitted
22+
# Lean: sorry
23+
# Rust: transmute (unless FFI with // SAFETY: comment)
24+
25+
# BANNED LANGUAGES
26+
# TypeScript -> use ReScript
27+
# Node.js / npm / bun -> use Deno
28+
# Go -> use Rust
29+
# Python -> use Julia or Rust
30+
31+
# CONTAINERS
32+
# Runtime: Podman (never Docker)
33+
# File: Containerfile (never Dockerfile)
34+
# Base: cgr.dev/chainguard/wolfi-base:latest
35+
36+
# ABI/FFI STANDARD
37+
# ABI definitions: Idris2 with dependent types (src/abi/)
38+
# FFI implementation: Zig with C ABI (ffi/zig/)
39+
# Generated C headers: generated/abi/
40+
41+
# BUILD SYSTEM
42+
# Use just (justfile) for all build, test, lint, and format tasks.
43+
44+
# CODE STYLE
45+
# Use descriptive variable names.
46+
# Annotate and document all files.
47+
# Add SPDX-License-Identifier header to every source file.

.devcontainer/Containerfile

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}>
3+
#
4+
# Dev Container image for {{PROJECT_NAME}}
5+
# Base: Chainguard Wolfi (minimal, supply-chain-secure)
6+
# Build: podman build -t {{PROJECT_NAME}}-dev -f .devcontainer/Containerfile .
7+
8+
FROM cgr.dev/chainguard/wolfi-base:latest
9+
10+
# Install common development tools
11+
RUN apk update && apk add --no-cache \
12+
bash \
13+
curl \
14+
git \
15+
openssh-client \
16+
ca-certificates \
17+
build-base \
18+
posix-libc-utils \
19+
shadow \
20+
&& rm -rf /var/cache/apk/*
21+
22+
# Create non-root dev user (matches devcontainer.json remoteUser)
23+
RUN groupadd -g 1000 nonroot || true \
24+
&& useradd -m -u 1000 -g 1000 -s /bin/bash nonroot || true
25+
26+
# Set workspace directory
27+
WORKDIR /workspaces/{{PROJECT_NAME}}
28+
29+
# Default shell
30+
ENV SHELL=/bin/bash
31+
32+
USER nonroot

.devcontainer/README.adoc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// SPDX-License-Identifier: PMPL-1.0-or-later
2+
= Dev Container Usage
3+
:author: {{AUTHOR}} <{{AUTHOR_EMAIL}}>
4+
5+
== Overview
6+
7+
This dev container uses `cgr.dev/chainguard/wolfi-base` with git, curl, bash, and just pre-installed. Dev container features add git, just, and nickel automatically.
8+
9+
== VS Code (Local)
10+
11+
. Install the *Dev Containers* extension (`ms-vscode-remote.remote-containers`).
12+
. Set `dev.containers.dockerPath` to `podman` in VS Code settings.
13+
. Open the repo folder, then choose **Reopen in Container** from the command palette.
14+
15+
== GitHub Codespaces
16+
17+
. From the repository on GitHub, click **Code > Codespaces > New codespace**.
18+
. The container builds automatically from this configuration.
19+
20+
== Gitpod
21+
22+
. Prefix the repo URL with `https://gitpod.io/#` to launch a workspace.
23+
. Gitpod reads `devcontainer.json` and builds the environment.
24+
25+
== Customization
26+
27+
Replace `{{PROJECT_NAME}}` placeholders in both `devcontainer.json` and `Containerfile` with your actual project name. Run `just deps` to verify the environment after first launch.

.devcontainer/devcontainer.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// SPDX-License-Identifier: PMPL-1.0-or-later
2+
// Copyright (c) {{CURRENT_YEAR}} {{AUTHOR}} ({{OWNER}}) <{{AUTHOR_EMAIL}}>
3+
//
4+
// Dev Container configuration for {{PROJECT_NAME}}
5+
// Works with: VS Code Dev Containers, GitHub Codespaces, Gitpod
6+
// Container runtime: Podman (recommended) or any OCI-compliant runtime
7+
{
8+
"name": "{{PROJECT_NAME}}",
9+
10+
"build": {
11+
"dockerfile": "Containerfile",
12+
"context": ".."
13+
},
14+
15+
"features": {
16+
"ghcr.io/devcontainers/features/git:1": {
17+
"ppa": false,
18+
"version": "latest"
19+
},
20+
"ghcr.io/jdx/devcontainer-features/just:1": {},
21+
"ghcr.io/nickel-lang/devcontainer-feature:0": {}
22+
},
23+
24+
"postCreateCommand": "just deps",
25+
26+
"remoteUser": "nonroot",
27+
28+
"containerEnv": {
29+
"EDITOR": "code --wait",
30+
"LANG": "C.UTF-8"
31+
},
32+
33+
"customizations": {
34+
"vscode": {
35+
"extensions": [
36+
"EditorConfig.EditorConfig",
37+
"eamodio.gitlens",
38+
"streetsidesoftware.code-spell-checker",
39+
"timonwong.shellcheck",
40+
"tamasfe.even-better-toml",
41+
"skellock.just",
42+
"redhat.vscode-yaml",
43+
"DavidAnson.vscode-markdownlint",
44+
"asciidoctor.asciidoctor-vscode",
45+
"usernamehw.errorlens"
46+
],
47+
"settings": {
48+
"editor.formatOnSave": true,
49+
"editor.insertSpaces": true,
50+
"editor.tabSize": 2,
51+
"files.trimTrailingWhitespace": true,
52+
"files.insertFinalNewline": true,
53+
"files.trimFinalNewlines": true,
54+
"[makefile]": {
55+
"editor.insertSpaces": false
56+
}
57+
}
58+
},
59+
"codespaces": {
60+
"openFiles": [
61+
"README.adoc"
62+
]
63+
}
64+
},
65+
66+
"forwardPorts": [],
67+
68+
"shutdownAction": "stopContainer"
69+
}

.editorconfig

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# RSR-template-repo - Editor Configuration
2+
# https://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
end_of_line = lf
9+
indent_size = 2
10+
indent_style = space
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
[*.md]
15+
trim_trailing_whitespace = false
16+
17+
[*.adoc]
18+
trim_trailing_whitespace = false
19+
20+
[*.rs]
21+
indent_size = 4
22+
23+
[*.ex]
24+
indent_size = 2
25+
26+
[*.exs]
27+
indent_size = 2
28+
29+
[*.zig]
30+
indent_size = 4
31+
32+
[*.ada]
33+
indent_size = 3
34+
35+
[*.adb]
36+
indent_size = 3
37+
38+
[*.ads]
39+
indent_size = 3
40+
41+
[*.hs]
42+
indent_size = 2
43+
44+
[*.res]
45+
indent_size = 2
46+
47+
[*.resi]
48+
indent_size = 2
49+
50+
[*.ncl]
51+
indent_size = 2
52+
53+
[*.rkt]
54+
indent_size = 2
55+
56+
[*.scm]
57+
indent_size = 2
58+
59+
[*.nix]
60+
indent_size = 2
61+
62+
[Justfile]
63+
indent_style = space
64+
indent_size = 4
65+

.envrc

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Activate development environment
3+
# Install direnv: https://direnv.net/
4+
5+
# Load .tool-versions if asdf is available
6+
if has asdf; then
7+
use asdf
8+
fi
9+
10+
# Load Guix shell if guix.scm exists
11+
if has guix && [ -f guix.scm ]; then
12+
use guix
13+
fi
14+
15+
# Load Nix flake if flake.nix exists
16+
if has nix && [ -f flake.nix ]; then
17+
use flake
18+
fi
19+
20+
# Project environment variables
21+
export PROJECT_NAME="{{PROJECT_NAME}}"
22+
export RSR_TIER="infrastructure"
23+
# export DATABASE_URL="..."
24+
# export API_KEY="..."
25+
26+
# Source .env if it exists (gitignored)
27+
dotenv_if_exists

.gitattributes

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# RSR-compliant .gitattributes
3+
4+
* text=auto eol=lf
5+
6+
# Source
7+
*.rs text eol=lf diff=rust
8+
*.ex text eol=lf diff=elixir
9+
*.exs text eol=lf diff=elixir
10+
*.jl text eol=lf
11+
*.res text eol=lf
12+
*.resi text eol=lf
13+
*.ada text eol=lf diff=ada
14+
*.adb text eol=lf diff=ada
15+
*.ads text eol=lf diff=ada
16+
*.hs text eol=lf
17+
*.chpl text eol=lf
18+
*.scm text eol=lf
19+
*.ncl text eol=lf
20+
*.nix text eol=lf
21+
22+
# Docs
23+
*.md text eol=lf diff=markdown
24+
*.adoc text eol=lf
25+
*.txt text eol=lf
26+
27+
# Data
28+
*.json text eol=lf
29+
*.yaml text eol=lf
30+
*.yml text eol=lf
31+
*.toml text eol=lf
32+
33+
# Config
34+
.gitignore text eol=lf
35+
.gitattributes text eol=lf
36+
Justfile text eol=lf
37+
Makefile text eol=lf
38+
Containerfile text eol=lf
39+
40+
# Scripts
41+
*.sh text eol=lf
42+
43+
# Binary
44+
*.png binary
45+
*.jpg binary
46+
*.gif binary
47+
*.pdf binary
48+
*.woff2 binary
49+
*.zip binary
50+
*.gz binary
51+
52+
# Lock files
53+
Cargo.lock text eol=lf -diff
54+
flake.lock text eol=lf -diff

.github/CODEOWNERS

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# CODEOWNERS - Define code review assignments
3+
# See: https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
4+
#
5+
# Replace {{OWNER}} with your GitHub username or team
6+
7+
# Default owners for everything
8+
* @{{OWNER}}
9+
10+
# Security-sensitive files require explicit review
11+
SECURITY.md @{{OWNER}}
12+
.github/workflows/ @{{OWNER}}
13+
Trustfile.a2ml @{{OWNER}}
14+
.machine_readable/ @{{OWNER}}

0 commit comments

Comments
 (0)