Complete Devsecops Pipeline For Vm Based Workloads From Scratchのロゴ

Complete Devsecops Pipeline For Vm Based Workloads From Scratch

コミュニティ
selvarajmurugesan90
complete-devsecops-pipeline-for-vm-based-workloads-from-scratch

Builds the complete security-gate sequence for a VM-based DevSecOps pipeline from scratch — SAST, SCA, golden-image scanning and CIS benchmark hardening baked into the machine image itself, config- management-applied secrets via Ansible Vault (never plaintext), and an ongoing patch/drift-detection gate that runs independently of any single deploy, distinct from the per-deploy scanning in the Kubernetes and serverless variants. Use when the user asks to "build a DevSecOps pipeline for EC2/VM workloads from scratch," "harden a golden AMI to CIS benchmarks in the pipeline," "apply secrets with Ansible Vault instead of plaintext," or "add ongoing patch/drift detection for a VM fleet."

概要

公開者selvarajmurugesan90
リポジトリops-engineering-skills
スキル名complete-devsecops-pipeline-for-vm-based-workloads-from-scratch
スター
44
フォーク
18
同梱ファイル
指示のみ
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    selvarajmurugesan90がGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Complete Devsecops Pipeline For Vm Based Workloads From Scratch」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/selvarajmurugesan90/ops-engineering-skills/tree/main/plugins/devsecops/skills/complete-devsecops-pipeline-for-vm-based-workloads-from-scratch
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/selvarajmurugesan90/ops-engineering-skills.git /tmp/ops-engineering-skills
mkdir -p .claude/skills
cp -r /tmp/ops-engineering-skills/plugins/devsecops/skills/complete-devsecops-pipeline-for-vm-based-workloads-from-scratch .claude/skills/complete-devsecops-pipeline-for-vm-based-workloads-from-scratch
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでComplete Devsecops Pipeline For Vm Based Workloads From Scratchを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にComplete Devsecops Pipeline For Vm Based Workloads From Scratchを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Complete Devsecops Pipeline For Vm Based Workloads From Scratchは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Complete DevSecOps Pipeline Deployment for VM-Based Workloads, From Scratch

Purpose

A VM-based DevSecOps pipeline has a gate sequence with a genuinely different time dimension from the Kubernetes and serverless variants of this skill. Those two are almost entirely per-deploy gates: a scan runs, a decision is made, an artifact ships. A VM fleet built on long-lived, immutable golden images additionally needs an ongoing gate that has no equivalent in a pipeline that redeploys constantly — a golden AMI baked and CIS-hardened once can still drift out of compliance or accumulate newly-disclosed CVEs for months while sitting unchanged in an Auto Scaling Group, so patch/drift detection has to run as its own recurring check, independent of whether a new deploy happens at all. Secrets follow yet another distinct model here too: applied by a config-management tool (Ansible Vault) at provision/config-push time, encrypted at rest in the same repo as the playbooks, rather than a cluster-side operator (Kubernetes) or a runtime API call to a managed secrets service (serverless).

When to use

  • A VM-based pipeline has individual security tools bolted on ad hoc, and the user wants the full gate sequence — including golden-image CIS hardening and an ongoing drift-detection gate — designed coherently from scratch.
  • The user is building a new EC2/VM-based service's pipeline and wants security gates designed in from the start.
  • The user wants to understand why a VM-based pipeline needs a recurring, deploy-independent security gate in addition to its per-deploy scans — the property that most distinguishes it from the Kubernetes and serverless variants.
  • Diagnosing why a golden AMI that passed CIS benchmark scanning at bake time is now failing a compliance audit months later with no code change in between.

Prerequisites & environment

Step-by-step guidance

Phase 1 — SAST on the diff (PR-time)

Per sast-integration: unchanged from any other pipeline.

Phase 2 — SCA on the application dependency tree (PR-time)

Per software-composition-analysis-sca: scan the lockfile before baking anything, exactly as in the base VM CI/CD pipeline.

Phase 3 — Golden-image scanning and CIS benchmark hardening, baked into the image itself

This is the VM-specific gate: after Packer bakes the AMI (per complete-cicd-pipeline-for-vm-based-workloads-from-scratch), scan the resulting machine image — its OS packages, its configuration posture against CIS benchmarks — not just the application artifact that was installed onto it:

json
build {
  sources = ["source.amazon-ebs.payments_api"]
  provisioner "shell" { script = "scripts/install-app.sh" }
  provisioner "shell" {
    # CIS-aligned OS hardening applied at bake time, not left to the
    # instance's first boot or a later manual pass
    script = "scripts/cis-harden.sh"
  }
  provisioner "shell" {
    inline = ["sudo cis-cat-lite --benchmark rhel9 --profile level1-server --report /tmp/cis-report.html"]
  }
  post-processor "manifest" {}
}

Fail the pipeline (or require an explicit, expiring waiver) on any Level-1 CIS finding, per cis-benchmarks-hardening's guidance on interpreting PASS/FAIL/WARN against the actual benchmark text rather than treating a scan pass as a compliance certification. This is the machine-image analog of container-image-hardening's non-root/read-only/minimal-base discipline, applied to a whole bootable OS instead of a container layer.

Phase 4 — Config-management-applied secrets via Ansible Vault, never plaintext

Where Kubernetes fetches secrets cluster-side and serverless fetches them via a runtime API call, the VM-based model applies secrets at config-push/provision time through Ansible, with the secret values encrypted at rest in the same repo as the playbooks — never a plaintext variable file:

bash
ansible-vault encrypt group_vars/prod/vault.yml
yaml
# group_vars/prod/vault.yml (encrypted at rest via ansible-vault)
vault_db_password: "S3cr3tValueNeverPlaintextInGit"
yaml
# deploy.yml task referencing the vaulted variable
- name: Render application config with DB credentials
  ansible.builtin.template:
    src: templates/app-config.yml.j2
    dest: /etc/payments-api/config.yml
    mode: "0600"
  no_log: true

The playbook run itself decrypts vault.yml using a vault password supplied out-of-band (a CI secret referencing the vault password, or better, --vault-id backed by a secrets manager lookup) — the encrypted file is safe to commit, but the vault password itself follows the same never-hardcoded discipline as any other credential, per secrets-management and ansible-playbook-and-role-design. no_log: true on any task handling the decrypted value prevents it from being printed in Ansible's own execution output.

Phase 5 — Deploy (unchanged from the base CI/CD pipeline)

Blue-green instance refresh or Ansible config push, per complete-cicd-pipeline-for-vm-based-workloads-from-scratch.

Phase 6 — Ongoing patch/drift detection, independent of any single deploy

This is the gate with no equivalent in the Kubernetes or serverless variants: a golden image or a fleet of long-lived VMs can silently accumulate risk (new CVEs disclosed against already-installed package versions, manual ssh-and-fix drift from the golden config, a security group edited out-of-band) with zero code changes and zero new deploys. Schedule this as its own recurring job, not tied to the deploy pipeline trigger:

yaml
name: fleet-patch-and-drift-scan
on:
  schedule:
    - cron: '0 4 * * *'
jobs:
  patch-scan:
    runs-on: ubuntu-latest
    steps:
      - run: |
          aws ssm start-automation-execution \
            --document-name AWS-RunPatchBaseline \
            --parameters "Operation=Scan"
      - run: trivy image --severity CRITICAL,HIGH "${LATEST_GOLDEN_AMI_REPO_REF}"
  drift-scan:
    runs-on: ubuntu-latest
    steps:
      - run: ansible-playbook -i inventories/prod check-drift.yml --check --diff

check-drift.yml --check --diff runs every task in dry-run mode against the live fleet and reports any host whose actual state no longer matches the playbook's declared state — catching a manually-ssh'd config change on a running instance the same way gitops-workflow's selfHeal catches drift in Kubernetes, but as an explicit scheduled report rather than a continuously-reconciling controller, since Ansible push has no equivalent of an in-cluster operator watching state continuously.

Phase 7 — Verify

bash
aws ssm describe-instance-patch-states-for-patch-group --patch-group payments-api-prod
ansible-playbook -i inventories/prod check-drift.yml --check --diff | grep -c changed

A nonzero changed count from the drift check means at least one host has diverged from the declared playbook state and needs investigation before it's treated as routine.

Best practices

  • Bake CIS hardening into the golden image at build time (Phase 3), not as a post-boot script run once and never re-verified — an image that's hardened once at bake time and then re-baked on every pipeline run stays provably compliant; a post-boot script only run at first launch can be skipped, fail silently, or be undone by later manual changes.
  • Treat a CIS scan pass as a hardening signal, not a compliance certification, per cis-benchmarks-hardening — document any Level-1 waiver with an expiry and a reviewer, the same suppression discipline as SAST/SCA findings elsewhere in this repo.
  • Run the patch/drift gate (Phase 6) on a schedule independent of the deploy pipeline — a fleet that hasn't had a code deploy in three months still needs patch scanning during that entire window, since new CVEs are disclosed against already-running versions constantly.
  • Never commit an unencrypted Ansible variables file "temporarily" — ansible-vault encrypt before the first commit, not after a secret is discovered in git history; treat a plaintext secret found in a vars file with the same rotate-first response as any other leaked credential, per secrets-management.
  • Rebuild and rescan the golden image on a cadence even when application code hasn't changed, so newly-disclosed base-OS CVEs are caught by the next bake rather than only by the separate Phase 6 patch scan — the two gates are complementary, not redundant.

Common pitfalls

  • Symptom: A golden AMI passed its CIS scan at bake time six months ago, and a compliance audit today finds several Level-1 findings on instances still running that same AMI. Fix: This is expected without a recurring gate — a CIS scan result is only valid as of the moment it ran; without Phase 6's scheduled patch/drift scan (or a periodic rebake-and-rescan cadence), an unchanged golden image accumulates newly-disclosed findings silently. Add the scheduled scan, and treat "last CIS scan date" as a tracked fleet metric, not a one-time checkbox.

  • Symptom: An Ansible group_vars/prod/vault.yml was committed unencrypted "just for local testing," and by the time someone notices and runs ansible-vault encrypt, the plaintext secret is already in git history. Fix: Treat it as a leaked credential exactly like any other secret — rotate the underlying value at its source system first, then encrypt and re-commit, and only then consider the finding closed; encrypting the current version does not retroactively protect the plaintext already in history, per secrets-management.

  • Symptom: The drift-detection playbook (--check --diff) reports a handful of hosts as "changed" every single run, even right after a clean deploy, and the team starts ignoring the report entirely. Fix: This is usually a genuinely non-idempotent task (a command:/ shell: task with no changed_when guard that Ansible can't evaluate as idempotent) rather than real drift — audit the flagged tasks for idempotency per ansible-playbook-and-role-design before concluding the hosts have actually drifted, since a false-positive "changed" every run trains the team to stop reading the report, the same trust-erosion failure mode as a chronically-noisy SAST gate.

  • Symptom: A security group attached to the fleet was edited directly in the console "to open a port for debugging" and never reverted, and it's now a standing exposure nobody remembers creating. Fix: Manual cloud-console changes to fleet-supporting infrastructure (security groups, launch templates) are a different drift surface from the instance-level Ansible drift check — pair Phase 6's host-level drift scan with infrastructure-level drift detection per cloud-resource-post-provisioning-validation-and-drift-detection, since neither one alone covers both layers.

Worked example

Scenario: payments-api's VM fleet gets its full DevSecOps gate sequence: SAST/SCA at PR time, CIS-hardening baked into the golden AMI, database credentials applied via Ansible Vault, and a nightly patch/drift-detection job independent of the deploy pipeline.

yaml
# .github/workflows/ci-cd.yml (build/bake/deploy jobs per the base VM CI/CD skill)
jobs:
  sast: { /* per sast-integration */ }
  sca: { /* per software-composition-analysis-sca */ }
  bake-and-scan-image:
    needs: [sast, sca]
    runs-on: ubuntu-latest
    steps:
      - run: packer build payments-api.pkr.hcl
      - run: |
          AMI_ID=$(jq -r '.builds[-1].artifact_id' manifest.json | cut -d: -f2)
          # cis-cat-lite runs as a Packer provisioner during the bake (Phase 3);
          # its report is a build artifact reviewed here
          aws s3 cp cis-report.html "s3://payments-api-compliance-reports/${AMI_ID}.html"
  apply-config-and-secrets:
    needs: bake-and-scan-image
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: |
          ansible-playbook -i inventories/prod deploy.yml \
            --vault-password-file <(aws secretsmanager get-secret-value --secret-id ansible-vault-prod --query SecretString --output text)
yaml
# .github/workflows/fleet-patch-and-drift-scan.yml — independent schedule
name: fleet-patch-and-drift-scan
on:
  schedule: [{ cron: '0 4 * * *' }]
jobs:
  scan:
    runs-on: ubuntu-latest
    steps:
      - run: aws ssm start-automation-execution --document-name AWS-RunPatchBaseline --parameters "Operation=Scan"
      - uses: actions/checkout@v4
      - run: ansible-playbook -i inventories/prod check-drift.yml --check --diff

The nightly job runs whether or not payments-api had a deploy that day — catching newly-disclosed OS CVEs against the already-running golden image and any manual configuration drift on the live fleet, entirely independent of the per-deploy gate sequence above it.

Cross-references

よくある質問

AIスキル「Complete Devsecops Pipeline For Vm Based Workloads From Scratch」では何ができますか?

Builds the complete security-gate sequence for a VM-based DevSecOps pipeline from scratch — SAST, SCA, golden-image scanning and CIS benchmark hardening baked into the machine image itself, config- management-applied secrets via Ansible Vault (never plaintext), and an ongoing patch/drift-detection gate that runs independently of any single deploy, distinct from the per-deploy scanning in the Kubernetes and serverless variants. Use when the user asks to "build a DevSecOps pipeline for EC2/VM workloads from scratch," "harden a golden AMI to CIS benchmarks in the pipeline," "apply secrets with...

TypingMindでComplete Devsecops Pipeline For Vm Based Workloads From Scratchを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Complete Devsecops Pipeline For Vm Based Workloads From Scratchはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにComplete Devsecops Pipeline For Vm Based Workloads From Scratchをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/selvarajmurugesan90/ops-engineering-skills/tree/main/plugins/devsecops/skills/complete-devsecops-pipeline-for-vm-based-workloads-from-scratchを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Complete Devsecops Pipeline For Vm Based Workloads From Scratchを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Complete Devsecops Pipeline For Vm Based Workloads From Scratchで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもComplete Devsecops Pipeline For Vm Based Workloads From Scratchを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Complete Devsecops Pipeline For Vm Based Workloads From Scratch」は無料ですか?

はい。selvarajmurugesan90がApache-2.0ライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇