agentleFS
kryptophonikkryptophonik/SRE-Skills/skills/sre-expiry-audit/SKILL.md

sre-expiry-audit

Skill4 starsChanged 23 days agoMITView on GitHub

Use when asked what expires soon: TLS certs (endpoints, cert-manager), domain registrations, ACM/IAM certs, Secrets Manager rotation, GCP Secret/Certificate Manager, Azure Key Vault. Read-only metadata; flags 30/14/7 days.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Wait for explicit human approval before any prod-changing command, MCP write tool, or external post.

    line 12
  2. Very specific:

    Metadata only: Read names, dates, issuers and rotation settings.

    line 21
  3. Very specific:

    Pin the target: Every command names the account/profile and region, the project, the subscription, or the kube context.

    line 22
  4. Distinctive:

    Default windows are 30 / 14 / 7 days (override with the user's N).

    line 28
  5. Very specific:

    Ask for scope: which endpoints, domains, clusters, accounts/projects/subscriptions, and N if not 30/14/7.

    line 42

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill 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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Expiry audit

Safety gates (REQUIRED)

  1. Read-only diagnosis first.
  2. Propose each change with risk (low/med/high) and reversibility.
  3. Wait for explicit human approval before any prod-changing command, MCP write tool, or external post.
  4. Act only as approved, verify, and stop and escalate if anything gets worse.

Full rules: sre-safety-gates. Read-only MCP setup: sre-safety-gates/references/mcp.md.

Cloud access: sre-aws, sre-gcp, sre-azure (read-only profiles). Kubernetes access: sre-k8s-triage rules.

Rules

  • Metadata only. Read names, dates, issuers and rotation settings. Never read a secret value: no get-secret-value, no gcloud secrets versions access, no az keyvault secret show, no kubectl get secret -o yaml/json. For a TLS secret, check the endpoint that serves it instead of decoding tls.crt (the same object holds tls.key).
  • Pin the target. Every command names the account/profile and region, the project, the subscription, or the kube context. Run per region: ACM and Secrets Manager are regional (CloudFront certificates live in us-east-1).
  • Bounded. --limit/--max-items on lists; sort by date; report only items inside the window, plus a count of the rest.
  • Renewal and rotation are out of scope. Report the finding and the owner; the fix is a separate, gated change (see Proposals).

Tiers

Default windows are 30 / 14 / 7 days (override with the user's N). Every finding gets one tier:

TierDays leftMeaning
EXPIRED< 0already broken or about to be
7d0–6page-worthy: renew today
14d7–13renew this week
30d14–29plan renewal
ok≥ 30count only

Auto-renewing items (ACM AMAZON_ISSUED in use, cert-manager, Google-managed certs) are only a finding when they are inside a window, because that means renewal is failing. Report the renewal status next to them.

Start here

  1. Ask for scope: which endpoints, domains, clusters, accounts/projects/subscriptions, and N if not 30/14/7.
  2. Endpoints and files (bundled, read-only TLS handshake only). The script has two thresholds (WARN/CRIT). Run it with --warn 30 --crit 7 and put each line into a tier using its DAYS_LEFT column:

    bash scripts/cert-expiry.sh --warn 30 --crit 7 --timeout 10 <host>[:<port>] ... | awk '{d=$2; t=(d=="-")?"ERROR":(d<0)?"EXPIRED":(d<7)?"7d":(d<14)?"14d":(d<30)?"30d":"ok"; print t, $0}'
    bash scripts/cert-expiry.sh --warn 30 --crit 7 --file <cert.pem>

    Output: STATUS DAYS_LEFT NOT_AFTER TARGET SUBJECT; exit 0 all OK, 1 something inside a window, 2 usage or connection error (the worst result wins, for endpoints and files alike). --file takes one or more files; list hosts before it. It checks the leaf only unless you add --chain, which also checks intermediates; see references/tls.md for IPv6 ([addr]:port) and non-HTTPS ports.

  3. Domains (bundled, RDAP):

    bash scripts/domain-expiry.sh --warn 30 --crit 7 <domain> ... | awk '{d=$2; t=(d=="-")?"CHECK":(d<0)?"EXPIRED":(d<7)?"7d":(d<14)?"14d":(d<30)?"30d":"ok"; print t, $0}'

    NO-RDAP http-<status> (lookup failed, or the TLD has no RDAP) and UNKNOWN (no expiration event) are not "ok": list them for a manual registrar or WHOIS check. Details: references/domains.md.

  4. Kubernetes certificates (cert-manager and TLS secrets, metadata only): references/kubernetes.md.
  5. Cloud certificates and secrets (AWS ACM, IAM server certificates, Secrets Manager; GCP Certificate Manager, Compute SSL certificates, Secret Manager; Azure Key Vault): references/cloud.md.
  6. Merge everything into one table sorted by days left.

Read these correctly

  • aws acm list-certificates by default returns only RSA_1024/RSA_2048 certificates that have at least one domain, and leaves out ACME-origin certificates. Pass --includes keyTypes=... with every key type and --certificate-key-pair-origins to see everything (references/cloud.md). An audit without them misses every EC and RSA-3072/4096 certificate.
  • GCP Secret Manager expireTime is the time Google deletes the secret and every version, irreversibly. It is not a rotation marker. Rotation is rotation.nextRotationTime (a Pub/Sub notification; your rotator does the work). A secret with expireTime inside the window is a data-loss finding, not a "rotate soon" finding.
  • AWS Secrets Manager: NextRotationDate null means rotation is not configured or disabled. LastRotatedDate far behind the rotation schedule means rotation is failing.
  • Azure Key Vault: attributes.expires (REST exp) is set by the owner and may be empty. Empty means "no expiry recorded", not "never expires" for a certificate: check the certificate's own date.

Proposals (renewal, rotation)

This skill does not renew, rotate, re-import or change expiry dates. For each finding, give the owner, the item, the tier, and the path the owner uses. Typical paths: re-issue through cert-manager or the CA, re-import into ACM, rotate through the Secrets Manager rotation function, add a new Key Vault version, renew at the registrar. Each of those is a production change: run it through sre-change-safety with risk and reversibility.

Gate: approval required. Any renewal, rotation, expiry change or deletion. The approval names the exact item and the account/project/subscription/cluster. Removing or moving a GCP expireTime is also a change.

Output

  • Scope checked (targets, accounts/projects/subscriptions, clusters, regions) and anything that could not be checked, with the reason.
  • One table: tier | days left | expires (UTC) | item | where | owner | auto-renew / rotation status | next step, sorted by days left, ok items as a count.
  • Data-loss findings (GCP expireTime) called out separately.

Bundled scripts and references

bash scripts/cert-expiry.sh [--warn 30] [--crit 7] [--timeout 10] [--chain] [host[:port]|[ipv6]:port...] [--file cert.pem [cert.pem...]]
bash scripts/domain-expiry.sh [--warn 30] [--crit 7] [--timeout 20] domain...
bash scripts/tests/run_tests.sh   # offline tests
  • references/tls.md · references/domains.md · references/kubernetes.md · references/cloud.md

Last reviewed: 2026-10-17

SOURCES

Fetched and checked 2026-10-17.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.