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

الإعدادات الآمنة

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

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

نظرة عامة

الموضوعات

  • أساسيات إدارة الأسرار
  • HTTPS
  • تحديث الاعتماديات
  • التسجيل الآمن

تعلّم أولًا

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

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

  1. Supply secrets through environment variables or a secret store, never source control.
  2. Enforce HTTPS-only behavior (redirects, HSTS) and secure headers.
  3. Restrict Actuator endpoints in production.
  4. Scan dependencies for known vulnerabilities and keep them updated (Dependabot or OWASP Dependency-Check).
  5. Audit logs for sensitive data.

الدروس

  1. 01أساسيات إدارة الأسرار
  2. 02HTTPS وترويسات الأمان
  3. 03إحكام إغلاق Actuator
  4. 04الاعتماديات الضعيفة أمنيًا
  5. 05قائمة التسجيل الآمن
  6. 06عرض عملي: تحصين ملف prod

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

Lab

JNR-042-LAB1 · Production hardening

Outcomes: 1–5 · Time: ~2 h Create a prod profile with secrets from the environment, restricted Actuator, security headers, and dependency scanning in the build. Acceptance: completes the capstone's security controls document.

Exercises (assessment: hardening checklist review)

IDOutcomeTask
JNR-042-EX011Move a hard-coded database password and JWT key out of application.yml into environment variables.
JNR-042-EX021A secret was committed. List the steps to respond.
JNR-042-EX032Check response headers with curl and list which security headers are present or missing.
JNR-042-EX042Explain HSTS and when it is safe to enable.
JNR-042-EX053Configure Actuator so only health and info are exposed and verify /actuator/env returns 404.
JNR-042-EX064Add a dependency scanner to the build and triage one finding.
JNR-042-EX075Audit sample logs and list every sensitive item found, with the fix.
JNR-042-EX081-5Review a prod configuration against a hardening checklist.
أظهر الحلول
  • EX01 password: ${DB_PASSWORD} and jwt.key: ${JWT_SIGNING_KEY}; set values in the environment or secret store; keep a sample file with placeholders only.
  • EX02 Rotate the secret first, then remove it from the code; consider history cleanup; check access logs for misuse; add a secret scanner.
  • EX03 curl -I https://...; check X-Content-Type-Options, Strict-Transport-Security, Content-Security-Policy, cache and referrer headers; add what is missing.
  • EX04 HSTS makes browsers use HTTPS only for a period; enable once HTTPS works for the whole domain, starting with a short max-age.
  • EX05 management.endpoints.web.exposure.include=health,info; curl /actuator/env returns 404 (or 401 when protected).
  • EX06 Add the scanner plugin or Dependabot; for a finding, update the library, or record the reason and a review date.
  • EX07 Typical findings: password in a request body log, Authorization header, personal data in debug lines; remove, mask, or lower the log level.
  • EX08 Cover secrets, HTTPS/headers, Actuator, dependencies, and logging, giving a pass or fix note for each.

الاختبار

Outcomes: O1 secrets · O2 HTTPS and headers · O3 Actuator · O4 dependency scanning · O5 secure logging.

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

  1. 1Production secrets should come from:O1
  2. 2A key was committed and then deleted. You should:O1
  3. 3HSTS tells browsers to:O2
  4. 4X-Content-Type-Options: nosniff stops:O2
  5. 5Which Actuator endpoint is safe to expose publicly?O3
  6. 6Exposing all Actuator endpoints in production is:O3
  7. 7A dependency scanner reports:O4
  8. 8Dependabot mainly:O4
  9. 9Which must never be logged?O5
  10. 10Error responses to clients should be:O5

الجزء العملي

Eight exercises JNR-042-EX01 to EX08 plus the lab; the hardening checklist review (EX08) is the assessment. Pass: at least seven exercises correct, /actuator/env not reachable, and no secrets in code or logs.

أخطاء شائعة

Exposing /actuator/env; ignoring scanner warnings forever.

التقييم

Hardening checklist review.

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

Dependency security (MID-053) and secrets (MID-054).

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