implementing-envelope-encryption-with-aws-kms
ما الذي تفعله
تساعد هذه المهارة على حماية بياناتك المهمة. تستخدم مفتاحًا سريًا لتشفير البيانات، وتستخدم مفتاحًا رئيسيًا لحماية ذلك المفتاح السري، مما يجعل تخزين ملفات كثيرة أو كبيرة في السحابة أكثر أمانًا.
متى تستخدمها
- ✓عندما تخطط لحماية ملفات كثيرة في السحابة.
- ✓عندما تحتاج إلى الالتزام بقواعد أمنية محددة.
- ✓عندما تبني أمان النظام أو تحسّنه.
رابط المهارة
https://github.com/mukul975/Anthropic-Cybersecurity-Skills/blob/main/skills/implementing-envelope-encryption-with-aws-kms/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“كيف أستطيع استخدام هذه التقنية لحماية مستنداتي المهمة في السحابة؟”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
أولًا يُنشأ مفتاح مؤقت لتشفير بياناتك محليًا. ثم يُحمى هذا المفتاح المؤقت بمفتاح رئيسي تحتفظ به AWS. ولقراءة البيانات تُعكس العملية.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
Implementing Envelope Encryption with AWS KMS
Overview
Envelope encryption is a strategy where data is encrypted with a data encryption key (DEK), and the DEK itself is encrypted with a master key (KEK) managed by AWS KMS. This approach allows encrypting large volumes of data locally while keeping the master key secure in a hardware security module (HSM) managed by AWS. This skill covers implementing envelope encryption using AWS KMS GenerateDataKey API.
When to Use
- When deploying or configuring implementing envelope encryption with aws kms capabilities in your environment
- When establishing security controls aligned to compliance requirements
- When building or improving security architecture for this domain
- When conducting security assessments that require this implementation
Prerequisites
- Familiarity with cryptography concepts and tools
- Access to a test or lab environment for safe execution
- Python 3.8+ with required dependencies installed
- Appropriate authorization for any testing activities
Objectives
- Understand the envelope encryption pattern and its advantages
- Generate data encryption keys using AWS KMS GenerateDataKey
- Encrypt/decrypt data locally using DEKs
- Store encrypted DEK alongside ciphertext
- Implement key caching to reduce KMS API calls
- Handle key rotation with automatic re-encryption
- Implement multi-region encryption for disaster recovery
Key Concepts
Envelope Encryption Flow
- Call
kms:GenerateDataKeyto get plaintext DEK + encrypted DEK - Use plaintext DEK to encrypt data locally (AES-256-GCM)
- Store encrypted DEK alongside ciphertext
- Discard plaintext DEK from memory
- For decryption: call
kms:Decrypton encrypted DEK, then decrypt data
Advantages Over Direct KMS Encryption
| Aspect | Direct KMS | Envelope Encryption |
|---|---|---|
| Max data size | 4 KB | Unlimited |
| Latency | Network round-trip per operation | Local encryption |
| Cost | $0.03/10,000 requests | Fewer KMS requests |
| Offline | Not possible | Yes (with cached DEKs) |
KMS Key Types
- AWS Managed: AWS creates and manages (
aws/s3,aws/ebs) - Customer Managed: You create and manage policies
- Custom Key Store: Backed by CloudHSM cluster
Security Considerations
- Never store plaintext DEK; only keep encrypted DEK
- Use key policies to restrict who can call GenerateDataKey and Decrypt
- Enable AWS CloudTrail logging for all KMS API calls
- Implement key rotation (automatic annual rotation for CMKs)
- Use encryption context for authenticated encryption metadata
- Handle KMS throttling with exponential backoff
Validation Criteria
- GenerateDataKey returns plaintext and encrypted DEK
- Data encrypts correctly with plaintext DEK using AES-256-GCM
- Encrypted DEK can be decrypted via KMS Decrypt API
- Decrypted DEK recovers the original data
- Plaintext DEK is wiped from memory after use
- Encryption context is validated during decryption
- Key rotation re-encrypts DEKs with new master key
الأسئلة الشائعة
ما الفرق بين التشفير المباشر عبر AWS واستخدام هذه التقنية؟
التشفير المباشر محدود بالملفات الصغيرة ويكون أبطأ. أما هذه التقنية فتتيح تشفير الملفات الكبيرة بسرعة وتكلفة أقل، لأنها تُجري عددًا أقل من الاستدعاءات لـ AWS.
هل يمكنني استخدام هذه التقنية للملفات الكبيرة جدًا؟
نعم، هذه التقنية مثالية لتشفير كميات كبيرة من البيانات، لأن التشفير الأساسي يتم محليًا دون قيود حجم الاستدعاءات المباشرة لـ AWS.
هل من الآمن تخزين المفتاح الرئيسي؟
نعم، يديره AWS في بيئة آمنة (HSM)، وأنت تتحكم في من يستطيع استخدامه عبر سياسات الوصول.
التفاصيل
الوصف الأصلي من المؤلف
Implements envelope encryption with AWS KMS, encrypting data locally with a data encryption key (DEK) and protecting that DEK with a KMS-managed key (KEK), covering the encrypt/decrypt flow, KMS key types, and security validation criteria. Use when designing key management for encrypting large or numerous data objects on AWS, or when reducing direct KMS API call volume.
الشعبية
- نجوم GitHub
- 35k
- الترتيب
- #8038
- الترخيص
- Apache-2.0
- آخر تحديث
- 31/8/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
abusing-dpapi-for-credential-access
35kيمنح وكيل الذكاء الاصطناعي تعليمات جاهزة لمهمة محددة، ليؤديها بشكل أفضل وأسرع.
abusing-shadow-credentials-for-privesc
35kيعلّم وكيل الذكاء الاصطناعي لديك كتابة نص واضح ومنظم جيدًا.
achieving-cmmc-level-2-compliance
35kيساعد وكيلك على تجهيز بيئة للامتثال لمستوى CMMC 2. يطبق متطلبات الأمان ويدير الوثائق اللازمة.
acquiring-disk-image-with-dd-and-dcfldd
35kيساعد وكيلك على إنشاء نسخ مطابقة تمامًا لأقراص التخزين. هذا مفيد لضمان عدم فقدان أي معلومات أو تغييرها أثناء التحقيقات.
مهارات مشابهة
openclaw-update
394kيساعد وكيلك على تحديث بوابة OpenClaw Gateway الموجودة، مع اختيار طريقة التحديث المناسبة لطريقة تثبيتها والحفاظ على جلستك.
diagnose-gateway
394kيساعد وكيلك على معرفة سبب فشل بوابة OpenClaw Gateway عبر فحص الإعدادات والقنوات والمنافذ دون تغيير أي شيء.
crabbox-apps
394kيساعد وكيلك على فتح تطبيق وتشغيله على جهاز سحابي مؤقت، ثم عرض واجهته في الشريط الجانبي للدردشة.