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.
In this repository84 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/sre-safety-gates.mdcCursor rule
- sre-awsSkill
- sre-azureSkill
- sre-capacity-planningSkill
- sre-change-safetySkill
- sre-chaos-engineeringSkill
- sre-cloud-cost-reviewSkill
- sre-database-triageSkill
- sre-datadogSkill
- sre-dependency-mappingSkill
- sre-diagnosticsSkill
- sre-dr-backup-testSkill
- sre-dynatraceSkill
- sre-emudhra-ca-checkSkill
- sre-engineerSkill
- sre-expiry-auditSkill
- sre-gcpSkill
- sre-incident-commandSkill
- sre-incident-communicationSkill
- sre-k8s-safe-remediationSkill
- sre-k8s-triageSkill
- sre-k8s-upgrade-autopilotSkill
- sre-message-queue-triageSkill
- sre-migration-safetySkill
- sre-observability-cost-cutterSkill
- sre-observability-query-cookbookSkill
- sre-oncall-auditSkill
- sre-oncall-handoffSkill
- sre-pagerduty-opsgenieSkill
- sre-php2shell-checkSkill
- sre-postmortem-templatesSkill
- sre-production-readinessSkill
- sre-prometheus-grafanaSkill
- sre-remediation-actionsSkill
- sre-runbook-templatesSkill
- sre-safety-gatesSkill
- sre-security-incident-triageSkill
- sre-service-mesh-triageSkill
- sre-slo-alertingSkill
- sre-slo-burn-rate-rulesSkill
- sre-terraformSkill
- sre-toil-reviewSkill
- sre-awsSkill
- sre-azureSkill
- sre-capacity-planningSkill
- sre-change-safetySkill
- sre-chaos-engineeringSkill
- sre-cloud-cost-reviewSkill
- sre-database-triageSkill
- sre-datadogSkill
- sre-dependency-mappingSkill
- sre-diagnosticsSkill
- sre-dr-backup-testSkill
- sre-dynatraceSkill
- sre-emudhra-ca-checkSkill
- sre-engineerSkill
- sre-gcpSkill
- sre-incident-commandSkill
- The first 60 shown.
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
- Distinctive: line 12
Wait for explicit human approval before any prod-changing command, MCP write tool, or external post.
- Very specific: line 21
Metadata only: Read names, dates, issuers and rotation settings.
- Very specific: line 22
Pin the target: Every command names the account/profile and region, the project, the subscription, or the kube context.
- Distinctive: line 28
Default windows are 30 / 14 / 7 days (override with the user's N).
- Very specific: line 42
Ask for scope: which endpoints, domains, clusters, accounts/projects/subscriptions, and N if not 30/14/7.
≈ “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.
Files
Expiry audit
Safety gates (REQUIRED)
- Read-only diagnosis first.
- Propose each change with risk (low/med/high) and reversibility.
- Wait for explicit human approval before any prod-changing command, MCP write tool, or external post.
- 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, nogcloud secrets versions access, noaz keyvault secret show, nokubectl get secret -o yaml/json. For a TLS secret, check the endpoint that serves it instead of decodingtls.crt(the same object holdstls.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-itemson 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:
| Tier | Days left | Meaning |
| EXPIRED | < 0 | already broken or about to be |
| 7d | 0–6 | page-worthy: renew today |
| 14d | 7–13 | renew this week |
| 30d | 14–29 | plan renewal |
| ok | ≥ 30 | count 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
- Ask for scope: which endpoints, domains, clusters, accounts/projects/subscriptions, and N if not 30/14/7.
Endpoints and files (bundled, read-only TLS handshake only). The script has two thresholds (WARN/CRIT). Run it with
--warn 30 --crit 7and put each line into a tier using itsDAYS_LEFTcolumn: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).--filetakes 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.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) andUNKNOWN(no expiration event) are not "ok": list them for a manual registrar or WHOIS check. Details: references/domains.md.- Kubernetes certificates (cert-manager and TLS secrets, metadata only): references/kubernetes.md.
- 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.
- Merge everything into one table sorted by days left.
Read these correctly
aws acm list-certificatesby 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-originsto see everything (references/cloud.md). An audit without them misses every EC and RSA-3072/4096 certificate.- GCP Secret Manager
expireTimeis the time Google deletes the secret and every version, irreversibly. It is not a rotation marker. Rotation isrotation.nextRotationTime(a Pub/Sub notification; your rotator does the work). A secret withexpireTimeinside the window is a data-loss finding, not a "rotate soon" finding. - AWS Secrets Manager:
NextRotationDatenull means rotation is not configured or disabled.LastRotatedDatefar behind the rotation schedule means rotation is failing. - Azure Key Vault:
attributes.expires(RESTexp) 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.
openssl s_client(-servername,-showcerts: "as sent by the server ... not a verified chain"): https://docs.openssl.org/3.0/man1/openssl-s_client/ ·openssl x509(-enddate,-checkend): https://docs.openssl.org/3.0/man1/openssl-x509/- RDAP JSON responses,
eventAction: expiration: https://www.rfc-editor.org/rfc/rfc9083.html · bootstrap redirector: https://rdap.org - cert-manager
CertificatestatusnotAfter,renewalTime: https://cert-manager.io/docs/reference/api-docs/ ·renewBefore/duration: https://cert-manager.io/docs/usage/certificate/ aws acm list-certificates(--includes keyTypes, default RSA_1024/RSA_2048 with at least one domain;--certificate-key-pair-origins, ACME excluded by default;NotAfter,InUse,RenewalEligibility,Typein the summary): https://docs.aws.amazon.com/cli/latest/reference/acm/list-certificates.html · API filters: https://docs.aws.amazon.com/acm/latest/APIReference/API_ListCertificates.html · https://docs.aws.amazon.com/acm/latest/APIReference/API_Filters.htmlaws acm describe-certificate(RenewalSummary.RenewalStatus, AMAZON_ISSUED only): https://docs.aws.amazon.com/cli/latest/reference/acm/describe-certificate.html · managed renewal eligibility: https://docs.aws.amazon.com/acm/latest/userguide/managed-renewal.html- CloudFront certificates in
us-east-1: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/cnames-and-https-requirements.html - Route 53 domains
list-domains(Expiry,AutoRenew): https://docs.aws.amazon.com/cli/latest/reference/route53domains/list-domains.html - Kubernetes Secret
typefield selector: https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/ ·kubeadm certs check-expiration: https://kubernetes.io/docs/tasks/administer-cluster/kubeadm/kubeadm-certs/ aws iam list-server-certificates(Expiration): https://docs.aws.amazon.com/cli/latest/reference/iam/list-server-certificates.htmlaws secretsmanager describe-secret(no secret value;RotationEnabled,NextRotationDate,LastRotatedDate): https://docs.aws.amazon.com/cli/latest/reference/secretsmanager/describe-secret.html ·list-secrets: https://docs.aws.amazon.com/cli/latest/reference/secretsmanager/list-secrets.html- GCP Secret Manager
expireTimedeletes the secret and all versions irreversibly;rotation.nextRotationTime: https://cloud.google.com/secret-manager/docs/reference/rest/v1/projects.secrets · https://cloud.google.com/secret-manager/docs/creating-and-managing-expiring-secrets · https://cloud.google.com/secret-manager/docs/secret-rotation ·gcloud secrets list: https://cloud.google.com/sdk/gcloud/reference/secrets/list - GCP Certificate Manager
expireTime: https://cloud.google.com/certificate-manager/docs/reference/certificate-manager/rest/v1/projects.locations.certificates ·gcloud certificate-manager certificates list: https://cloud.google.com/sdk/gcloud/reference/certificate-manager/certificates/list · Compute SSL certificate fields (type,managed.status,expireTime): https://cloud.google.com/compute/docs/reference/rest/v1/sslCertificates ·gcloud compute ssl-certificates list: https://cloud.google.com/sdk/gcloud/reference/compute/ssl-certificates/list - Azure Key Vault list returns identifiers and attributes only (
exp): https://learn.microsoft.com/rest/api/keyvault/secrets/get-secrets/get-secrets ·az keyvault secret list: https://learn.microsoft.com/cli/azure/keyvault/secret ·az keyvault certificate list: https://learn.microsoft.com/cli/azure/keyvault/certificate ·az keyvault key list: https://learn.microsoft.com/cli/azure/keyvault/key
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.

