Skip to content

my-check — Unified Security Scanner

A CLI tool for web and Kubernetes infrastructure security scanning.

Quick Start

bash
# Install
make install

# Launch the interactive wizard (one command to rule them all)
make cli

That's it. The wizard guides you through every option step by step.

Interactive Wizard

make cli (or uv run my-check) opens a 5-step interactive form:

Step 1 — What do you want to scan?   web / k8s / all
Step 2 — Web target URL               (reads default from .env)
Step 3 — Kubernetes cluster           context, kubeconfig, namespace
Step 4 — Select checks                all or toggle individual checks
Step 5 — Output format                terminal / json / html / all
         Confirm & run

Non-interactive (CI / scripting)

bash
# Web scan
uv run my-check web https://example.com

# K8s scan
uv run my-check k8s --context my-cluster

# Full scan — web + k8s
uv run my-check all https://example.com --context my-cluster --output terminal,json

Configuration

All defaults are loaded from .env at the project root. Copy .env.example:

bash
cp .env.example .env
# Edit .env with your targets, k8s context, etc.

Key variables

VariableDescriptionExample
MY_CHECK_WEB_TARGETDefault web scan URLhttps://example.com
MY_CHECK_K8S_CONTEXTKubeconfig context namek3s, kind-local
MY_CHECK_K8S_KUBECONFIGPath to kubeconfig/home/you/.kube/config
MY_CHECK_K8S_SERVEROverride K8s API server URLhttps://192.168.1.10:6443
MY_CHECK_K8S_NAMESPACEScope to one namespacedefault
MY_CHECK_OUTPUTDefault reportersterminal,json
MY_CHECK_SARIFEmit SARIF 2.1 for GitHub Code Scanningtrue
MY_CHECK_WEBHOOK_URLSlack / custom webhookhttps://hooks.slack.com/…
API_PORTDocker API port (old web-check)8001

Priority: CLI flags > my-check.config.json > .env > built-in defaults

Available Checks

Web

CheckDescription
web-tlsCertificate expiry, chain validation, CT log presence
web-headersCSP, HSTS, X-Frame-Options, Permissions-Policy
web-dnsDNSSEC validation, CAA records, SPF / DMARC
web-portsCommon exposed ports via TCP connect
web-redirectsFull redirect chain, HTTP→HTTPS downgrade
web-subdomain-takeoverCNAME resolution, decommissioned service detection

Kubernetes

CheckDescription
k8s-rbacWildcard verbs, automount tokens, anonymous bindings
k8s-workloadsRoot pods, privileged containers, missing limits
k8s-network-policiesZero-policy namespaces, exposed admin endpoints
k8s-secretsPlain env var secrets, missing sealed secrets
k8s-imageslatest tag without SHA digest
k8s-kube-benchCIS benchmarks (requires kube-bench)
k8s-trivyVulnerability scan (requires trivy)
k8s-polarisBest practices (requires polaris)
k8s-falcoRuntime security DaemonSet health

Output Formats

FormatDescription
terminalColored Rich table with ✓/⚠/✗ icons and global score
jsonoutputs/my-check-results.json
htmloutputs/my-check-report.html — standalone, diff-aware
webhookPOST to Slack or custom URL

CI Integration

See .github/workflows/security-scan.yml for a full example.

yaml
- name: Run security scan
  run: uv run my-check all ${{ vars.SCAN_TARGET_URL }} --output terminal,json

- uses: github/codeql-action/upload-sarif@v3
  with:
    sarif_file: outputs/my-check-results.sarif

Commands

my-check web <url>

Run web security checks against a target URL.

CheckDescription
web-tlsCertificate expiry, chain validation, CT log presence
web-headersCSP, HSTS, X-Frame-Options, Permissions-Policy
web-dnsDNSSEC validation, CAA records, SPF / DMARC
web-portsCommon exposed ports via TCP connect
web-redirectsFull redirect chain, HTTP→HTTPS downgrade
web-subdomain-takeoverCNAME resolution, decommissioned service detection

my-check k8s [options]

Run Kubernetes security checks.

CheckDescription
k8s-rbacWildcard verbs, automount tokens, anonymous bindings
k8s-workloadsRoot pods, privileged containers, missing limits
k8s-network-policiesZero-policy namespaces, exposed admin endpoints
k8s-secretsPlain env var secrets, missing sealed secrets
k8s-imageslatest tag without SHA digest
k8s-kube-benchCIS benchmarks (requires kube-bench)
k8s-trivyVulnerability scan (requires trivy)
k8s-polarisBest practices (requires polaris)
k8s-falcoRuntime security DaemonSet health

my-check all <url> [options]

Run both web and Kubernetes checks in a single pass.

Options

FlagDescription
--output, -oComma-separated reporters: terminal, json, html, webhook
--config, -cPath to my-check.config.json
--contextKubeconfig context name
--kubeconfigPath to kubeconfig file
--namespace, -nKubernetes namespace scope
--verbose, -vEnable debug logging

Configuration

Create a my-check.config.json at the project root:

json
{
  "web": {
    "targets": ["https://example.com"],
    "enabled_checks": ["web-tls", "web-headers", "web-dns"],
    "timeout": 30
  },
  "k8s": {
    "context": "my-cluster",
    "enabled_checks": ["k8s-rbac", "k8s-workloads"],
    "timeout": 60
  },
  "output": {
    "formats": ["terminal", "json"],
    "output_dir": "outputs",
    "sarif": true
  }
}

Output Formats

Terminal

Colored table with ✓/⚠/✗ icons, global score, and per-category breakdown.

JSON

Structured my-check-results.json in the output directory. Optionally emit SARIF 2.1 for GitHub Advanced Security with "sarif": true.

HTML

Self-contained my-check-report.html with score gauges and diff support against a previous report.

Webhook

POST results to a Slack incoming webhook or custom endpoint:

json
{ "output": { "formats": ["webhook"], "webhook_url": "https://hooks.slack.com/..." } }

CI Integration

Add to .github/workflows/security-scan.yml:

yaml
- name: Run security scan
  run: my-check all ${{ vars.SCAN_TARGET_URL }} --output terminal,json

- uses: github/codeql-action/upload-sarif@v3
  with:
    sarif_file: outputs/my-check-results.sarif

See .github/workflows/security-scan.yml for a complete example with a kind cluster.