examples/nginx-kms: Lockdown kms-init service with systemd hardening
The kms-init service has been changed to run as a dedicated unprivileged user instead of root. The symmetric key is stored in a restricted runtime directory accessible only to the kms-init group, with nginx gaining access through group membership.
Comprehensive systemd sandboxing has been applied based on systemd’s security analysis recommendations, including filesystem isolation, process visibility restrictions, capability dropping, and device access controls limited to the TPM device.
Signed-off-by: Marius Knaust mknaust@amazon.com
版权所有:中国计算机学会技术支持:开源发展技术委员会
京ICP备13000930号-9
京公网安备 11010802032778号
NitroTPM Attestation Samples
This repository contains configurations and examples for creating Attestable AMIs. At the moment, this includes:
Nix Attestable AMI Builder
The Nix Attestable AMI Builder helps creating Attestable AMIs which are confidential, attestable, and reproducible EC2 AMI images. It’s designed for workloads that require enhanced security, where the initial state of the EC2 instance needs to be cryptographically measured and verified before any confidential data is bootstrapped on the system. It provides the Nix framework to build read-only, bit-by-bit reproducible, and measurable EC2 AMIs. These AMIs contain attestation logic and helper tools to extract NitroTPM attestation documents and decrypt secrets from KMS with the help of NitroTPM Attestation Documents.
Nix Web Server Example
For an example for how you can use the builder flake to create your own Attestable AMIs, you can look at the Nix Web Server Example. This example demonstrates how to build a minimalistic Attestable AMI with NGINX serving incoming decryption requests. The decryption is performed using a symmetric key, which is itself decrypted using AWS KMS based on attestation policy with AMI measurements.
You can use it as a starting point to create your own Attestable AMI.
Amazon Linux 2023 example
You can also create Attestable AMIs based on Amazon Linux using kiwi-ng. For templates and examples, see the kiwi-image-descriptions-examples repository as well as the EC2 Instance Attestation documentation.