انتقل إلى المحتوى
أمين أبوزيد
MID-054

الأسرار والتشفير

  • 6 درس
  • 2 ساعة تدريب (تقدير)
في هذه الصفحة 8 موضوعات

نص الدروس والتمارين باللغة الإنجليزية، بينما تبقى واجهة الموقع وعناوين الدروس بالعربية.

نظرة عامة

الموضوعات

  • التشفير أثناء النقل وعند التخزين
  • مفاهيم إدارة المفاتيح
  • التدوير (Rotation)

تعلّم أولًا

2 ساعة تدريب (تقدير)

مخرجات التعلم

  1. Explain symmetric vs asymmetric encryption, hashing, and signatures, and when each is used.
  2. Configure TLS correctly, including for service-to-service and database connections.
  3. Store and rotate secrets with a secrets manager (Vault or cloud equivalent).
  4. Explain envelope encryption and key management services, and encrypt sensitive columns.

الدروس

  1. 01التشفير للمهندسين
  2. 02TLS عمليًا
  3. 03التشفير عند التخزين
  4. 04إدارة المفاتيح والتشفير المغلّف (Envelope Encryption)
  5. 05مديرو الأسرار والتدوير
  6. 06عرض عملي: تدوير كلمة مرور قاعدة البيانات دون توقف

المختبر والتمارين

Lab

MID-054-LAB1 · Secrets in Shop

Outcomes: 1–4 · Time: ~2 h Move every Shop secret into a secrets manager (Vault or the cloud equivalent), fetched by workload identity. Rotate the database credentials live under load. Encrypt stored customer phone numbers with envelope encryption. Enable TLS to the database with certificate verification. Add a secret scanner to CI. Acceptance: no secret in images, manifests, or Git; live rotation with no failed requests.

Exercises (assessment: quiz plus lab)

IDOutcomeTask
MID-054-EX011Choose hash, symmetric, asymmetric, or signature for: passwords, a phone column, a JWT, key exchange.
MID-054-EX022Write the JDBC URL and explain each part for a verified TLS connection to PostgreSQL.
MID-054-EX032A teammate sets trustAll=true in a dev client. Explain the risk and the correct fix.
MID-054-EX044Describe envelope encryption and how rotating the master key affects stored data.
MID-054-EX053Write the rotation steps for a database password with two valid credentials.
MID-054-EX063Find a leaked secret in a sample repository history and state the response.
أظهر الحلول
  • EX01 Passwords: slow salted hash. Phone column: symmetric (AES-GCM) via envelope encryption. JWT: signature (asymmetric or HMAC). Key exchange: asymmetric.
  • EX02 ?sslmode=verify-full&sslrootcert=/certs/ca.pem: encrypt, verify the certificate chain and host name against the given CA.
  • EX03 Man-in-the-middle exposure; add the CA to the trust store or use the proper dev certificate.
  • EX04 Data key encrypts data, KMS key encrypts the data key; rotating the master key re-wraps data keys only, not the data.
  • EX05 Create credential B, store it, let the app reload, verify, revoke credential A, repeat later in the other direction.
  • EX06 Treat as compromised: rotate the secret first, then remove it from history and add a scanner; deleting the commit alone is not enough.

Outcome 3 is also covered by lab criterion "live rotation with no failed requests" and quiz Q07–Q09.

الاختبار

Outcomes: O1 primitives · O2 TLS · O3 secrets managers and rotation · O4 envelope encryption and KMS.

اختبار ذاتي لك: لا توجد درجات، ولا يُحفظ أو يُرسل أي شيء. اختر إجابة ثم تحقق منها، ويمكنك المحاولة مرة أخرى كما تشاء.

  1. 1For storing passwords use:O1
  2. 2A digital signature proves:O1
  3. 3Which is a correct approach to algorithms?O1
  4. 4Disabling certificate validation:O2
  5. 5sslmode=verify-full makes PostgreSQL clients:O2
  6. 6Safe rotation order is:O3
  7. 7Which place is worst for a secret?O3
  8. 8Environment variables are risky for secrets because:O3
  9. 9In envelope encryption the master key:O4
  10. 10Disk encryption does NOT protect against:O4

الجزء العملي

Quiz plus lab MID-054-LAB1. Pass: quiz at least 8/10, no secret in images, manifests, or Git, and a live database credential rotation without failed requests.

أخطاء شائعة

Inventing crypto; disabling certificate validation; secrets in environment dumps.

التقييم

Quiz plus lab.

الصلة بالمسار الوظيفي

Security architecture (ARC-028).

اكتب للبحث في المستويات والمراحل والوحدات والدروس.