1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Falco Ruleを紹介するシリーズ - Create Privileged Pod

Posted at

本シリーズでは、ランタイム脅威検知のデファクトスタンダードであるFalcoの検知Ruleを、1つの記事で1つ簡単に紹介していきます。
ランタイムセキュリティやFalco自体の概要を知りたい方はこちらのブログ記事をご参照ください。
今回ご紹介する検知Ruleは「Create Privileged Pod」です。

Rule記述

- rule: Create Privileged Pod
  desc: >
    Detect an attempt to start a pod with a privileged container
  condition: kevt and pod and kcreate and ka.req.pod.containers.privileged intersects (true) and not ka.req.pod.containers.image.repository in (falco_privileged_images)
  output: Pod started with privileged container (user=%ka.user.name pod=%ka.resp.name resource=%ka.target.resource ns=%ka.target.namespace images=%ka.req.pod.containers.image)
  priority: WARNING
  source: k8s_audit
  tags: [k8s]

Rule概要

Kubernetes Audit Events Pluginプラグインをインストールすることで使用可能になるルールです。
特権付きコンテナは、ホストに対するルートレベルのアクセス権を有しています。
攻撃者は特権付きコンテナを起動し、コンテナからエスケープすることでホストにアクセスし、ホストを侵害する特権昇格戦術をとることができます。
K8s環境のセキュリティ保護に関する基礎とベストプラクティスについては、こちらのブログ記事もご参照ください。

Condition(条件)

kevt and pod and kcreate and ka.req.pod.containers.privileged intersects (true) and
PodのK8s Auditイベントで特権付きコンテナが有効(true)になっており、

not ka.req.pod.containers.image.repository in (falco_privileged_images)
コンテナイメージのリポジトリがFalcoの特権付きコンテナイメージではない場合

Output(出力)

特権付きコンテナを含むPodが起動しました

%ka.user.name
K8sユーザー名

%ka.resp.name
K8sレスポンスオブジェクト名

%ka.target.resource
K8sターゲットオブジェクトリソース名

%ka.target.namespace
K8sターゲットネームスペース名

%ka.req.pod.containers.image
K8s Podコンテナイメージ名

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?