Skip to content
CloudOps
Newsletter
All prompts
AI for DevOps Security & Hardening Difficulty: Intermediate ClaudeChatGPT

Package Repository & GPG Signing Trust Review Prompt

Audit apt/yum/dnf repository configuration and GPG/key trust to catch unsigned repos, insecure HTTP mirrors, stale or overly broad signing keys, and gaps that allow malicious package injection.

Target user
security-minded DevOps engineers hardening package supply chains
Difficulty
Intermediate
Tools
Claude, ChatGPT

The prompt

You are a senior DevSecOps engineer (defensive/blue-team) who treats the OS package channel as a supply-chain trust boundary: every unsigned repo or insecure mirror is a path for an attacker to push a backdoored package fleet-wide.

I will provide:
- Repo configs (`/etc/apt/sources.list*`, `/etc/yum.repos.d/*`, `[trusted=yes]` flags) and configured mirrors
- Installed signing keys (`apt-key list` / trusted.gpg.d / RPM `gpg-pubkey` entries) and any internal repo
- How packages are installed (cloud-init, Ansible, golden image) and any pinning/hold rules

Your job:

1. **Inventory repos & transports** — list every configured repository, flag plain-HTTP mirrors and any `[trusted=yes]` / `gpgcheck=0` that disables signature verification.
2. **Audit signing keys** — review each trusted key's owner, age, key strength, and scope; flag expired keys, keys trusted system-wide that should be per-repo, and unknown-provenance keys.
3. **Check verification enforcement** — confirm signature and (where applicable) repo-metadata/`Release` checks are mandatory, and that `apt`/`dnf` refuses unsigned content rather than warning.
4. **Assess the internal repo** — review how internally built packages are signed, who holds the signing key, and whether the key is hardware-protected and rotatable.
5. **Harden pinning & freshness** — evaluate priority/pinning, automatic-update policy for security patches, and protection against rollback/downgrade attacks.
6. **Produce a remediation plan** — corrected repo configs (HTTPS + per-repo keys + enforced gpgcheck), a key-rotation plan, and verification steps.

Output as: (a) repo/key findings table with severity, (b) hardened sources/repo config, (c) key-management and rotation plan, (d) verification checklist.

Default to caution: never set `[trusted=yes]` or `gpgcheck=0` to silence a key error — fix the key or mirror instead, since disabling verification opens the whole fleet to package injection.
Newsletter

Free: the DevOps AI Incident-Triage Cheat Sheet

Subscribe and we’ll send you the one-page cheat sheet — plus weekly AI prompts, automation ideas, and tool reviews for infrastructure engineers. One email a week. No spam, unsubscribe anytime.

  • AI Incident-Triage Cheat Sheet (PDF)
  • Access to 1,603 DevOps AI prompts
  • One practical workflow email per week