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を紹介するシリーズ - Disallowed K8s User

Posted at

10/28(金)コンテナクラウドセキュリティで訊かれる「ランタイムセキュリティ」とは?と題してFalcoをSysdigが徹底解説するウェビナーを開催します。ご興味ある方はこちらから
https://go.sysdig.com/20221028JapanWebinar1.html

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

Rule記述

- rule: Disallowed K8s User
  desc: Detect any k8s operation by users outside of an allowed set of users.
  condition: kevt and non_system_user and not ka.user.name in (allowed_k8s_users) and not ka.user.name in (eks_allowed_k8s_users)
  output: K8s Operation performed by user not in allowed list of users (user=%ka.user.name target=%ka.target.name/%ka.target.resource verb=%ka.verb uri=%ka.uri resp=%ka.response.code)
  priority: WARNING
  source: k8s_audit
  tags: [k8s]

Rule概要

Kubernetes Audit Events Pluginをインストールすることで使用可能になるルールです。
Kubernetes(K8s)はコンテナオーケストレーションのデファクトスタンダードであり、クラウドネイティブ環境を実現する重要な基盤となっています。
そのため、K8s環境の操作は限られたユーザーに限定することが重要であり、このルールを使うことで許可されていないユーザーによるK8sオペレーションを検知することが可能です。
K8s環境のセキュリティ保護に関する基礎とベストプラクティスについては、こちらのブログ記事もご参照ください。

Condition(条件)

kevt and non_system_user and
システムユーザーによるものではないK8s Auditイベントで、

not ka.user.name in (allowed_k8s_users) and
K8sユーザー名が許可されたユーザー名に含まれておらず、

not ka.user.name in (eks_allowed_k8s_users)
許可されたEKSのユーザー名にも含まれていない場合


non_system_userマクロの内容は以下となります。

- macro: non_system_user
  condition: (not ka.user.name startswith "system:")

(not ka.user.name startswith "system:")
K8sユーザー名が"system:"から始まらない場合

Output(出力)

許可されたユーザーリストに含まれていないユーザーによって実施されたK8sオペレーション

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

%ka.target.name
K8sターゲットオブジェクト名

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

%ka.verb
実行されたアクション

%ka.uri
クライアントからサーバーにリクエストされたURI

%ka.response.code
レスポンスコード

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?