implementing-aws-nitro-enclave-security
Skill này làm gì
Công cụ này giúp tạo môi trường an toàn trong AWS gọi là “Nitro Enclaves”. Chúng cô lập dữ liệu nhạy cảm, như thông tin cá nhân hoặc khóa mã hóa, trong một phần được bảo vệ của máy ảo, bảo đảm ngay cả quản trị viên cũng không thể truy cập.
Khi nào nên dùng
- ✓Bảo vệ dữ liệu cực kỳ nhạy cảm (như thông tin sức khỏe hoặc tài chính).
- ✓Đảm bảo mã xử lý bí mật chỉ chạy trong môi trường đã được xác minh.
- ✓Cho phép các môi trường an toàn khác nhau giao tiếp với nhau một cách đáng tin cậy.
Liên kết skill
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-aws-nitro-enclave-security/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Thiết lập môi trường an toàn trong AWS để xử lý dữ liệu bệnh nhân, đảm bảo chỉ mã được ủy quyền mới có thể giải mã thông tin.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Bạn dùng các công cụ AWS cụ thể để đóng gói mã thành “enclave image” và cấu hình chính sách bảo mật để đảm bảo chỉ image đó mới được truy cập khóa mã hóa.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
Implementing AWS Nitro Enclave Security
When to Use
- Processing sensitive data (PII, PHI, financial records, cryptographic secrets) that must be isolated from EC2 instance operators and administrators
- Building confidential computing pipelines where even root-level access on the parent instance cannot read enclave memory or state
- Implementing cryptographic attestation workflows that tie KMS decryption rights to a specific, verified enclave image hash
- Deploying multi-party computation environments where two or more enclaves authenticate each other via attestation before exchanging data
- Hardening existing workloads that currently decrypt secrets on the parent instance by migrating decryption into an enclave boundary
Do not use when the workload does not handle sensitive data that requires hardware-level isolation, when the instance type does not support Nitro Enclaves (requires Nitro-based instances with at least 4 vCPUs), or when latency constraints make the vsock communication overhead unacceptable.
Prerequisites
- An AWS account with permissions to launch Nitro-capable EC2 instances (m5.xlarge or larger, C5, R5, M6i families)
- AWS CLI v2 and the
nitro-clitoolset installed on the parent EC2 instance (Amazon Linux 2 or AL2023) - Docker installed on the parent instance for building enclave image files (EIF)
- An AWS KMS symmetric key with key policy permissions for the enclave's IAM role
- The
aws-nitro-enclaves-sdk-cor Pythonaws-encryption-sdkfor enclave-side KMS operations - The Nitro Enclaves allocator service configured with sufficient memory and vCPU allocation in
/etc/nitro_enclaves/allocator.yaml
Workflow
Step 1: Configure the Nitro Enclaves Environment
Set up the parent EC2 instance to support enclave launches:
- Install the Nitro Enclaves CLI: On Amazon Linux 2, install the tools and allocator:
sudo amazon-linux-extras install aws-nitro-enclaves-cli sudo yum install aws-nitro-enclaves-cli-devel -y sudo systemctl enable --now nitro-enclaves-allocator.service sudo systemctl enable --now docker sudo usermod -aG ne ec2-user sudo usermod -aG docker ec2-user - Configure memory and CPU allocation: Edit
/etc/nitro_enclaves/allocator.yamlto reserve resources for the enclave. The enclave requires dedicated memory that is carved from the parent instance:
Restart the allocator:--- memory_mib: 4096 cpu_count: 2sudo systemctl restart nitro-enclaves-allocator.service - Verify setup: Run
nitro-cli describe-enclavesto confirm the CLI can communicate with the Nitro hypervisor. An empty JSON array[]indicates no enclaves are running and the setup is correct.
Step 2: Build the Enclave Image File (EIF)
Package the sensitive workload into a signed enclave image:
Create the application Dockerfile: The enclave runs a minimal Linux environment. The application communicates exclusively through vsock:
FROM amazonlinux:2 RUN yum install -y python3 python3-pip && \ pip3 install boto3 cbor2 cryptography requests COPY enclave_app.py /app/enclave_app.py WORKDIR /app CMD ["python3", "enclave_app.py"]Build the EIF with nitro-cli: Convert the Docker image into an enclave image file, capturing the PCR measurements:
docker build -t enclave-app:latest . nitro-cli build-enclave \ --docker-uri enclave-app:latest \ --output-file enclave-app.eifThe output contains three critical PCR values:
- PCR0: SHA-384 hash of the enclave image file (the full image digest)
- PCR1: SHA-384 hash of the Linux kernel and bootstrap process
- PCR2: SHA-384 hash of the application code Record these values; they are used in KMS key policies for attestation-based access control.
Build a signed EIF (recommended for production): Generate a signing certificate and use it to produce PCR8:
openssl ecparam -name secp384r1 -genkey -noout -out enclave_key.pem openssl req -new -key enclave_key.pem -sha384 \ -nodes -subj "/CN=Enclave Signer" -out enclave_csr.pem openssl x509 -req -days 365 -in enclave_csr.pem \ -signkey enclave_key.pem -sha384 -out enclave_cert.pem nitro-cli build-enclave \ --docker-uri enclave-app:latest \ --output-file enclave-app.eif \ --private-key enclave_key.pem \ --signing-certificate enclave_cert.pem
…
Câu hỏi thường gặp
“Nitro Enclaves” là gì?
Đây là môi trường tính toán bảo mật, cô lập dữ liệu và mã trong một máy ảo AWS, bảo vệ chúng ngay cả trước quản trị viên hệ thống.
“Attestation” là gì?
Đây là quy trình xác minh, chứng minh mã của bạn đang chạy đúng như mong đợi trong môi trường an toàn và đáng tin cậy trước khi cho phép truy cập dữ liệu nhạy cảm.
Tôi có cần phần cứng đặc biệt không?
Có, bạn cần dùng máy ảo AWS hỗ trợ công nghệ Nitro và có ít nhất 4 vCPU.
Chi tiết
Mô tả gốc của tác giả
Build AWS Nitro Enclave confidential computing environments using nitro-cli to create enclave images, configure attestation-aware KMS policies with PCR condition keys, validate attestation documents against the Nitro PKI root, and set up vsock/kmstool-enclave-cli pipelines for processing PII, keys, and health records. Use for Nitro Enclave setup, attestation validation, or scoping KMS to an enclav
Độ phổ biến
- Sao GitHub
- 35k
- Vị trí xếp hạng
- #8000
- Giấy phép
- Apache-2.0
- Cập nhật
- 31/8/2026
Bình luận
- …
Thêm skill từ kho mã này
abusing-dpapi-for-credential-access
35kCung cấp cho agent AI của bạn hướng dẫn có sẵn cho một tác vụ cụ thể, giúp nó làm việc tốt hơn và nhanh hơn.
abusing-shadow-credentials-for-privesc
35kDạy agent AI của bạn viết văn bản rõ ràng và có cấu trúc tốt.
achieving-cmmc-level-2-compliance
35kGiúp agent của bạn chuẩn bị môi trường để tuân thủ CMMC Level 2. Triển khai các yêu cầu bảo mật và quản lý tài liệu cần thiết.
acquiring-disk-image-with-dd-and-dcfldd
35kGiúp agent của bạn tạo bản sao chính xác của ổ đĩa. Cách này đảm bảo không mất hay thay đổi thông tin trong quá trình điều tra.
Skill tương tự
reverse-engineer-anything
422kGiúp agent của bạn xem bên trong các app và package đã phát hành để giải thích tính năng, so sánh phiên bản hoặc hướng dẫn dựng lại bằng công cụ REA.
1password
394kGiúp agent của bạn cài đặt CLI của 1Password, đăng nhập, và đọc hoặc đưa thông tin bí mật vào mà không in giá trị ra cuộc trò chuyện.
healthcheck
394kGiúp agent của bạn rà soát bảo mật máy tính hoặc máy chủ đang chạy OpenClaw, như SSH, tường lửa, cập nhật và sao lưu, rồi đề xuất cách sửa an toàn.