Detects Nitro Enclaves launched with --debug-mode via CloudTrail KMS-from-enclave events. Debug enclaves produce attestations with zeroed image/kernel/application PCRs (PCR0/1/2); the check flags every KMS key that received such a call. Configurable via enclave_debug_lookback_window_hours (default 2160h / 90d) and enclave_debug_max_events (5000).
Risk
Debug mode zeros the image, kernel and application PCRs (PCR0/1/2) in the attestation document, so PCR-bound key policies release material to enclaves whose measurement cannot be trusted. A debug enclave calling this KMS key is functionally equivalent to no enclave at all.
prowler aws --checks kms_key_enclave_debug_attestation_detected
Recommendation
Never run production Nitro Enclaves with --debug-mode. Enforce non-debug launch flags in the enclave orchestration pipeline and pair with strict PCR bindings on KMS policies so debug enclaves are rejected at the key-policy layer.
Remediation
nitro-cli run-enclave --cpu-count <n> --memory <mib> --eif-path <path>
- Identify the enclave that produced the zeroed-PCR attestation from the CloudTrail event's
attestationDocumentModuleId(embeds the parent instance-id). - On the flagged host, terminate the debug enclave and relaunch without
--debug-mode. - Audit the enclave orchestration pipeline for hardcoded
--debug-modethat leaked into production. - Tighten the KMS key policy to bind non-zero PCR values so future debug enclaves fail closed at the key-policy layer.
Source Code
Resource Type
AwsKmsKey
References
Related To
- kms_key_enclave_attestation_not_enforced
- kms_key_enclave_attestation_no_deployment_binding