container-image-hardening
Harden Dockerfiles and container images — multi-stage builds, non-root users, minimal base images, and vulnerability gates. Use when building production containers or reviewing Dockerfiles.
v2026.8.26-b2b6b523 התקנות+3 ב-7 ימים0 כוכביםסונכרן לפני 19 שעות
התקנה
עדיין אין לכם את ה-CLI של NotHoly? התקינו אותו קודם.
$ curl -fsSL https://notholy.com/install.sh | sh$ notholy skills install securityskills/container-image-hardeningנכתב אל ~/.notholy/skills אחרי בדיקת החתימה וה-SHA-256.
חתימהחתום, ed25519
חבילה3b9b73b2…dc5aa40a
3b9b73b2cb51…804bdc5aa40aקובץ אחד · 1.1 KBסריקהבינוניממצא אחד
- לא נמצא רישיון
מקורgithub.com/securityskills/skills/tree/main/container-security/docker/container-image-hardening@b2b6b52
הפריט הזה עדיין לא נכתב בעברית, ולכן הוא מוצג בשפה אחרת: English.
בעמוד הזה
Review and fix Dockerfiles and images for production safety.
Dockerfile Review Checklist
- Base image: official, specific tag or digest, minimal variant (
alpine,distroless,slim); neverlatest - Multi-stage builds: build toolchains (compilers, package managers) excluded from final image
- Non-root user:
USERdirective with a dedicated UID; no sudo in image - No secrets: no
ENVwith credentials, noCOPY .env, no secrets baked into layers (they persist even if deleted later) - Pinned dependencies: lockfiles used (
npm ci,pip install -r requirements.txtwith hashes) - Healthchecks defined;
ENTRYPOINToverCMDfor enforced init - Layer hygiene: combine apt operations and clean lists in one layer;
.dockerignorecovers.git, build artifacts
Scan and Gate
trivy image --severity HIGH,CRITICAL --exit-code 1 <image>
grype <image>
docker scout cves <image>- Fail CI on critical CVEs with available fixes
- Track base image updates (renovate/dependabot for Dockerfiles)
Runtime Hardening
read_only: true
cap_drop: ["ALL"]
security_opt: ["no-new-privileges:true"]
tmpfs: [/tmp]- Resource limits set (CPU/memory) to blunt DoS
- Root filesystem read-only; writable paths explicit tmpfs
Verification
docker history <image>— no secret-looking layersdive <image>— image efficiency and wasted space- Run as the image user:
docker run --rm <image> idshows non-root
Output
Hardened Dockerfile, scan report before/after, and CI gate configuration.
הקבצים בגרסה הזו
- SKILL.md1.8 KB
הרשאות
| הרשאה | הוצהר | נמצא בסריקה |
|---|---|---|
| קורא קבצים | לא | לא |
| כותב קבצים | לא | לא |
| מריץ פקודות shell | כן | כן |
| משתמש ברשת | לא | לא |
| משתמש במחברים | לא | לא |
| שולט בדפדפן | לא | לא |
ממצאי הסריקה
נבדק ב-13 בנוב׳ 2026
- בינוניתרישיון · לא נמצא רישיון
סריקה נקייה מורידה את הסיכון, אבל לא מוכיחה שהחבילה בטוחה. כדאי לקרוא מה מתקינים.
| גרסה | פורסמה | Commit | SHA-256 | חתימה | שינוי בהרשאות |
|---|---|---|---|---|---|
| v2026.8.26-b2b6b52 | 13 בנוב׳ 2026 | b2b6b52 | 3b9b73b2 | חתומה | – |
עוד מ-securityskills
הכול מהמפרסם הזהעוד בקטגוריה Linux, ענן וקונטיינרים
לקטגוריה- detecting-aws-credential-exposure-with-trufflehogmukul975/detecting-aws-credential-exposure-with-trufflehog5
- cloud-gcpnoorqureshi/cloud-gcp4
- performing-cloud-incident-containment-proceduresmukul975/performing-cloud-incident-containment-procedures3
- implementing-taxii-server-with-opentaxiimukul975/implementing-taxii-server-with-opentaxii3
- detecting-cryptomining-in-cloudmukul975/detecting-cryptomining-in-cloud3
- detecting-azure-service-principal-abusemukul975/detecting-azure-service-principal-abuse3
שאלו כל מה שהסקופ מאפשר.
יוצרים חשבון, מוסיפים קרדיטים ושואלים את השאלה הראשונה בצ׳אט או בטרמינל.
- 1/3
יצירת חשבון
פרטי או חברה. אפשר לעבור לחשבון חברה אחר כך בלי לאבד יתרה או מפתחות.
פרטיחברה - 2/3
הוספת קרדיטים
בכרטיס אשראי. תשלום לפי טוקן, בלי מנוי.
$5.00טעינה מינימלית - 3/3
שאלה ראשונה
בצ׳אט, או להתקין את ה-CLI ולהריץ notholy login בטרמינל.
$ notholy login