Upgrade to Pro — share decks privately, control downloads, hide ads and more …

kubecon-meetup-m-sign-20221124.pdf

Yuji Watanabe
November 28, 2022
330

 kubecon-meetup-m-sign-20221124.pdf

KubeCon + CNCon North America 2022 Recap セッション

マニフェスト署名とソフトウェアサプライチェーンセキュリティ
- "Trust But Verify: Bringing Supply Chain Integrity To CD GitOps" (Kubecon NA) https://sched.co/182HF
- "Policy-Based Governance For End-to-End Integrity Control of Policies" (SecurityCon) https://sched.co/1AOji
- "Securing Kubernetes Manifests with Sigstore and Kyverno" (SigstoreCon)
https://sched.co/1Ayky

Yuji Watanabe

November 28, 2022
Tweet

Transcript

  1. KubeCon + CNCon North America 2022 Recap セッション マニフェスト署名とソフトウェアサプライチェーンセキュリティ -

    "Trust But Verify: Bringing Supply Chain Integrity To CD GitOps" (Kubecon NA) - "Policy-Based Governance For End-to-End Integrity Control of Policies" (SecurityCon) - "Securing Kubernetes Manifests with Sigstore and Kyverno" (SigstoreCon) 渡邊 裕治 (⽇本IBM)
  2. ⾃⼰紹介 • 渡邊 裕治 (わたなべゆうじ), IBM研究員, STSM • Cloud securityに関する研究プロジェクトのリード

    • いくつかのOpen Sourceプロジェクトのメンテナーをしてます。 • Sigstoreマニフェスト署名 (https://github.com/sigstore/k8s-manifest-sigstore) • ArgoCD Interlace (https://github.com/argoproj-labs/argocd-interlace) • Ansible Risk Insgiht (https://github.com/ansible/ansible-risk-insight)
  3. アプリをクラスターにデプロイする Registry CI Pipeline Git Repo Git Repo (Source) Manifest

    Image CD Pipeline Image Application Cluster build & package deploy & maintain アプリをデプロイする際にイメージとマニフェストが⽤いられる
  4. デリバリー時のインテグリティの課題 Registry CI Pipeline Git Repo Git Repo (Source) Manifest

    Image CD Pipeline Image Application Cluster build & package deploy & maintain イメージの改ざん YAMLマニフェストの 改ざん デプロイした後の マニフェストの改 ざん
  5. サプライチェーンのインテグリティ保護 Registry CI Pipeline Git Repo Git Repo (Source) Manifest

    Image CD Pipeline Image Application Cluster build & package deploy & maintain インテグリティを保護するために・・・
  6. サプライチェーンのインテグリティ保護 Registry CI Pipeline Git Repo Git Repo (Source) Manifest

    Image CD Pipeline Image Application Cluster build & package deploy & maintain SIG SIG SIG SIG SIG SIG SIG インテグリティを保護するために・・・ イメージの署名 +YAMLマニフェストの署名
  7. Controller Current State Desired State Kubernetes リソースマニフェスト • Kubernetesは declarativeな構成管理シ

    ステム • ユーザは、desired stateをYAMLでGitレ ポなどに定義します。 • Kubernetesのコントローラーはdesired stateになるようにシステム構成を管 理します。
  8. k8s-manifest-sigstore CLI https://github.com/sigstore/k8s-manifest-sigstore Kyverno Kyverno Policy rules: validate: manifests: K8s

    resource K8s resource kubectl sigstore sign -f cm.yml --key cosign.key Signature check K8s-manifest-sigstore マニフェストを保護する • YAMLリソースを Sigstore CLIで署名する • Kyvernoを使ってリソースの署名を検証する (v1.8.0から有効) https://youtu.be/NsuhabTaJTE
  9. HTTP Handler Authn / Authz Mutating Admission Validating Admission Schema

    Validation etcd API Request Kyverno Webhooks Webhooks Webhooks Mutation 課題: アドミッション制御による変更
  10. Kyverno K8s-manifest-sigstore Admission request 1. Decode message (original YAML) 2.

    Create a dry-run request using original YAML Dry-run 3. Compare the inserted attributes and compute expected diffs Webhooks Webhooks Webhooks Mutation API Request DRY-RUNによる変更自動チェック
  11. マルチクラスター管理のポリシーの インテグリティを保護する ハブ・クラスター Policy Policy Policy sig 管理対象クラスター Policy Policy

    署名されたポリ シーのみ有効 Admission Control Policy Admission Control ポリシーが署名なし で変更されたらブ ロック apply apply apply 署名 Policy Policy Policy Kyverno Integrity Shield https://youtu.be/1grSrQ2daxI
  12. マニフェストのビルド(kustomize) ソースファイル kustomize build <base_dir> | kubectl apply -f -

    kubectl apply –k <base_dir> ⽣成された マニフェスト テンプレート パラメータ 外部依存ファ イル
  13. CD GitOps Git Repo ソースファイ ル 署名する⼈ クラスタ Admission Control

    SIG CDエンジン Build Deploy ⽣成されたマ ニフェスト GitOps ⾃動同期 ソースと 異なる 署名がない
  14. CD GitOpsにおけるマニフェストの課題 Git Repo Source Materials Signer Cluster Admission Control

    SIG CD Build Deploy ⽣成されたマ ニフェスト Q1. ソースの署名は検 証されたか︖ Q3. ビルドは適切に⾏われ たか︖ Q4. マニフェストは改ざ んされていないか︖ Trust, so not verify Q2. 依存する外部ソースは正し く利⽤されたか︖
  15. 処理内容(プロベナ ンス)の記録 Interlace – "trust but verify" アプローチ Git Repo

    Source Materials Signer Cluster Admission Control SIG ArgoCD Build Deploy ⽣成されたマ ニフェスト Interlace マニフェストへの署名付与 ソースの 署名検証 Interlaceは、より強固なインテグリティ検証のた めにArgoCDのGitOps同期を機能拡張します。 SIG https://youtu.be/dcCbtYrbjzE
  16. ArgoCD Interlace • ArgoCDではApplicationカスタムリソースに基づいてGitOps Syncを管理します。 • ArgoCDはソースのGitレポを監視し、変更を⾃動的にターゲットクラスタへ反映します。 • Interlaceは、そのSyncイベントを検出し、ソース検証・マニフェスト署名・プロベナンス⽣成を⾏います。 https://github.com/argoproj-labs/argocd-interlace

    Application CR Application CR Application CR ArgoCD Interlace Controller updates (source git repo, rev, commit, resources, etc.) Provenance Store (e.g. Rekor) Publish manifest build info as provenance record Git Repo status status status ArgoCD API verify Target Cluster Signature Resources OCI Registry OCI Artifact (manifest) Signature package & sign Interlace Profile application selector Interlace Profile get manifest s from API Admission Control https://github.com/argoproj-labs/argocd-interlace
  17. Thank you! Q & A Resources Interlace - https://github.com/argoproj-labs/argocd-interlace Manifest

    Signing - https://github.com/sigstore/k8s-manifest-sigstore Integrity Shield - https://github.com/stolostron/integrity-shield Kyverno - https://github.com/kyverno/kyverno Ansible Risk Insight - https://github.com/rurikudo/ansible-risk-insight Yuji Watanabe twitter.com/ywatan1 linkedin.com/in/yuji-watanabe-0108322/ github.com/yuji-watanabe-jp