本シリーズでは、ランタイム脅威検知のデファクトスタンダードであるFalcoの検知Ruleを、1つの記事で1つ簡単に紹介していきます。
ランタイムセキュリティやFalco自体の概要を知りたい方はこちらのブログ記事をご参照ください。
今回ご紹介する検知Ruleは「Read sensitive file trusted after startup」です。
Rule記述
- rule: Read sensitive file trusted after startup
desc: >
an attempt to read any sensitive file (e.g. files containing user/password/authentication
information) by a trusted program after startup. Trusted programs might read these files
at startup to load initial state, but not afterwards.
condition: sensitive_files and open_read and server_procs and not proc_is_new and proc.name!="sshd" and not user_known_read_sensitive_files_activities
output: >
Sensitive file opened for reading by trusted program after startup (user=%user.name user_loginuid=%user.loginuid
command=%proc.cmdline parent=%proc.pname file=%fd.name parent=%proc.pname gparent=%proc.aname[2] container_id=%container.id image=%container.image.repository)
priority: WARNING
tags: [filesystem, mitre_credential_access]
Rule概要
信頼されたプログラムによって、起動後に認証情報などの機密ファイルがReadされたことを検知します。
信頼されたプログラムが、初期状態のロードのために起動時に機密ファイルを読み込むことは一般的ですが、その後に読み込むことは通常ないため、不審な活動が疑われます。
こういった活動も、このRuleを使うことで検知可能です。
Condition(条件)
sensitive_files and open_read and server_procs
機密ファイルがサーバープロセスによってReadされ、
かつ
not proc_is_new and
新規プロセスではなく、
proc.name!="sshd" and
sshdプロセスでもなく、
not user_known_read_sensitive_files_activities
ユーザーが定義した既知の機密ファイルの読み込みアクティテビティーでもない場合
sensitive_filesマクロの内容は以下となります。
- macro: sensitive_files
condition: >
fd.name startswith /etc and
(fd.name in (sensitive_file_names)
or fd.directory in (/etc/sudoers.d, /etc/pam.d))
fd.name startswith /etc and
ファイル名が /etc で始まり、
(fd.name in (sensitive_file_names)
ファイル名がsensitive_file_namesリストに含まれ、
or fd.directory in (/etc/sudoers.d, /etc/pam.d))
もしくは、ディレクトリが /etc/sudoers.d か /etc/pam.d の場合
sensitive_file_namesリストの内容は以下となります。
- list: sensitive_file_names
items: [/etc/shadow, /etc/sudoers, /etc/pam.conf, /etc/security/pwquality.conf]
Output(出力)
信頼されたプログムによって、起動後に機密ファイルがReadのためにOpenされました。
%user.name
ユーザー名
%user.loginuid
ユーザーのログインUID
%proc.cmdline
コマンドライン
%proc.pname
親プロセス名
%fd.name
ファイル名
%proc.pname
親プロセス名
%proc.aname[2]
2世代前の親プロセス名
%container.id
コンテナID
%container.image.repository
コンテナイメージリポジトリ