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がスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
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.
人気
- GitHubのスター
- 48k
- ランキング
- #4241
- ライセンス
- MIT
- 更新日
- 2026/10/15
コメント
- …
このリポジトリの他のスキル
00-andruia-consultant
48kエージェントがAIプロジェクトの立ち上げや改善を支援します。コードを分析し、ツールを提案し、スペイン語で行動計画を作成します。
007
48kエージェントがセキュリティ監査と脅威モデリングを行えるようにします。攻撃や脆弱性からプロジェクトを守るのに役立ちます。
10-andruia-skill-smith
48kエージェントがAIツールの作成や改善を支援します。ツールの動作を定義し、ドキュメントを書き、構造を検証します。
20-andruia-niche-intelligence
48kエージェントが特定の業界に関する要約を作成できるようにします。信頼できる情報源を使って、プロジェクトの背景、ルール、利用パターン、リスクを把握するのに役立ちます。
似ているスキル
reverse-engineer-anything
422kREAツールを使って、出荷済みのアプリやパッケージの中身を調べ、機能の説明、版の比較、再構築の手順をエージェントが支援します。
1password
394k1Password CLIをセットアップし、サインインして、秘密情報の値を会話に表示せずに読み取ったり注入したりするようエージェントを支援します。
healthcheck
394kOpenClawを動かすコンピューターやサーバーを、SSH、ファイアウォール、更新、バックアップなどのセキュリティリスクについて監査し、安全な修正案を提案するようエージェントを支援します。