본문으로 건너뛰기
Skillpedia
보안48k · #4241

container-hardening

하는 일

이 도구는 컨테이너(소프트웨어 패키지)를 더 안전하게 만드는 데 도움을 줍니다. 공격하기 더 어렵도록 컨테이너를 설정하는 방법을 제안합니다.

사용하는 경우

  • ✓새 컨테이너를 만들 때.
  • ✓기존 컨테이너를 업데이트할 때.
  • ✓보안이 가장 중요한 우선순위인 경우.

스킬 링크

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/container-hardening/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/container-hardening/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“Docker 컨테이너를 더 안전하게 만들려면 어떻게 해야 할까요?”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

도구는 컨테이너 설정을 분석하고 변경을 제안합니다. 예를 들어 더 적은 권한으로 컨테이너를 실행하거나 더 안전한 이미지를 사용하도록 합니다. 이는 코드 예제와 모범 사례를 통해 이루어집니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Container Hardening

Secure container images and runtime configurations.

When to Use This Skill

Use this skill when:

  • Building secure container images
  • Hardening container deployments
  • Meeting container security requirements
  • Implementing defense in depth

Dockerfile Security

# Example for an application binary already built for this Alpine/musl runtime.
# Pin an approved immutable digest for real builds; refresh supported base images.
FROM alpine:3.24
RUN addgroup -g 1001 -S appgroup && \
    adduser -u 1001 -S appuser -G appgroup
WORKDIR /app
# Copy only the intended reviewed build artifact, not credentials or the entire repo.
COPY --chown=appuser:appgroup myapp /app/myapp
USER 1001:1001
ENTRYPOINT ["/app/myapp"]

Runtime Security

# Run with security options
docker run -d \
  --read-only \
  --tmpfs /tmp:rw,noexec,nosuid,size=64m \
  --security-opt=no-new-privileges:true \
  --cap-drop=ALL \
  --user 1001:1001 \
  myapp@sha256:<reviewed-image-digest>

Kubernetes Security Context

apiVersion: v1
kind: Pod
metadata:
  name: hardened-example
spec:
  securityContext:
    runAsNonRoot: true
    runAsUser: 1001
    fsGroup: 1001
  containers:
  - name: app
    image: myapp@sha256:<reviewed-image-digest>
    resources:
      requests: {cpu: "100m", memory: "64Mi"}
      limits: {cpu: "500m", memory: "256Mi"}
    securityContext:
      allowPrivilegeEscalation: false
      readOnlyRootFilesystem: true
      capabilities:
        drop: ["ALL"]

Image Scanning

# Scan with Trivy
trivy image --severity HIGH,CRITICAL myapp@sha256:<reviewed-image-digest>

# Consider a maintained distroless image only when the actual application is compatible;
# FROM belongs in a Dockerfile, not this shell scanning example.

Best Practices

  • Use minimal base images
  • Run as non-root user
  • Enable read-only filesystem
  • Drop all capabilities
  • Scan images regularly
  • Sign and verify images
  • Use secrets management

Related Skills

  • container-scanning (container-scanning) - Vulnerability scanning
  • kubernetes-hardening (kubernetes-hardening) - K8s security

Limitations

  • The Dockerfile needs a reviewed executable myapp built for the selected ABI; it is not bundled. Build dependencies were never installed in this stage, so do not run apk del against a nonexistent virtual group. Prefer a separate builder stage when compilation is needed.
  • Replace digest placeholders with verified image identities before execution. The Pod YAML is a template; tune actual resource budgets and approved volumes, network policy and workload permissions. No Docker build, cluster application or scanner execution is claimed.
  • Read-only filesystems and dropped capabilities reduce privileges but are not a complete sandbox. Add writable paths only where required; low ports do not justify NET_BIND_SERVICE by default. Scanning can disclose artifacts or use network databases, so review data paths and policies first.
  • Docs-only import: upstream scripts and templates not bundled.

Example

# Read-only first: inventory before any active step.
command -v docker
docker --version

Adapted from BagelHole/DevOps-Security-Agent-Skills (MIT); frontmatter, When to Use/Limitations, and safety boundaries added for upstream compliance. Docs-only import: helper scripts and templates not bundled.

자주 묻는 질문

컨테이너란 무엇인가요?

프로그램과 실행에 필요한 모든 것을 함께 묶은 상자와 같습니다. 어느 곳에서나 같은 방식으로 작동하도록 해 줍니다.

컨테이너 보안이 왜 중요한가요?

안전하지 않은 컨테이너는 해커가 데이터에 접근하거나 서비스를 방해하는 데 악용될 수 있습니다.

이 도구가 문제를 자동으로 고치나요?

아니요, 고치는 방법에 대한 지침과 예제를 제공하지만, 최종 적용은 사용자가 결정합니다.

상세 정보

작성자의 원본 설명

Secure Docker images and container runtime configurations.

repo: sickn33/agentic-awesome-skills

인기도

GitHub 스타
48k
순위
#4241
라이선스
MIT
업데이트
2026. 10. 15.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬