Kernel Lockdown & Secure Boot Hardening Prompt
Review and harden a Linux host's boot-chain integrity — Secure Boot, kernel lockdown mode, and module signing — so unsigned or malicious code cannot load into the kernel.
- Target user
- Platform/security engineers hardening fleet boot integrity
- Difficulty
- Advanced
- Tools
- Claude, ChatGPT
The prompt
You are a Linux platform security engineer who has rolled out Secure Boot and kernel lockdown across mixed hardware and cloud fleets, including the parts that break in practice. I will provide: - Distro, kernel version, and boot method (UEFI/BIOS, GRUB/systemd-boot) - Current `mokutil --sb-state`, `cat /sys/kernel/security/lockdown` - Whether out-of-tree modules are used (NVIDIA, DKMS, ZFS, eBPF tooling) - Hardware/cloud mix (bare metal, VM, cloud images) - Risk tolerance and change-management constraints Your job: 1. **Boot-chain threat model** — explain what Secure Boot + lockdown actually defend against (unsigned kernels/modules, kexec into rogue images, `/dev/mem` tampering, runtime kernel modification) and what they do NOT (userspace compromise, supply-chain in signed artifacts). 2. **Secure Boot review** — verify SB is enabled and enforcing, audit enrolled keys (PK/KEK/db/dbx), check dbx revocation currency, and flag shim/MOK trust that widens the surface. Recommend whether to enroll a custom MOK or stay on distro keys. 3. **Lockdown mode** — compare `integrity` vs `confidentiality` modes, list what each blocks (kexec, hibernation, BPF, `/dev/kmem`, MSR writes, module params), and recommend the mode per host role. Show how to set it via kernel cmdline and confirm it can't be downgraded at runtime. 4. **Module signing** — design a signing workflow for in-tree and out-of-tree modules: key generation/storage, `sign-file`, enforcing `module.sig_enforce=1`, and how DKMS rebuilds get re-signed automatically. 5. **Breakage matrix** — for each control, list what commonly breaks (proprietary GPU drivers, eBPF observability, hibernation, crash dumps) and the supported mitigation. 6. **Verification** — exact commands to prove SB enforcing, lockdown active, and that loading an unsigned module is rejected. 7. **Rollout** — staged plan: audit-only inventory, canary hosts, fleet enforcement, and a tested rollback (since SB/lockdown changes can brick boot). Output: (a) current-state findings table with severity, (b) target hardened config (cmdline + key setup), (c) module-signing runbook, (d) breakage/mitigation matrix, (e) staged rollout with rollback. Bias toward: enforcing where the fleet can tolerate it, never bricking boot, every control mapped to a concrete threat.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
SELinux Targeted Policy Troubleshooting Prompt
Diagnose SELinux denials from audit logs and produce minimal, least-privilege policy fixes — booleans, file contexts, or scoped custom modules — instead of disabling enforcement.
-
Unattended-Upgrades Patch Coverage Audit Prompt
Audit Debian/Ubuntu unattended-upgrades and dnf-automatic configuration to confirm security patches actually apply and reboots happen safely
-
auditd Rule-Set Design Prompt
Design a focused, low-noise Linux auditd rule-set that captures the events that actually matter for forensics and compliance without drowning the audit log in irrelevant syscalls.
-
Linux Server Hardening Prompt
Walk an AI through a CIS-style hardening review of a Linux server — services, users, SSH, kernel parameters, file permissions — with safe, ordered remediation.
More DevOps Security & Hardening prompts & error guides
Browse every DevOps Security & Hardening prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.