本シリーズでは、ランタイム脅威検知のデファクトスタンダードであるFalcoの検知Ruleを、1つの記事で1つ簡単に紹介していきます。
ランタイムセキュリティやFalco自体の概要を知りたい方はこちらのブログ記事をご参照ください。
今回ご紹介する検知Ruleは「Secret pushed into a public repository」です。
Rule記述
- rule: Secret pushed into a public repository
desc: A secret (AWS keys, github token...) was committed into a public repository
condition: github.type=push and github.diff.has_secrets = true and github.repo.public=true
output: One or more secrets were pushed into a public repository (repository=%github.repo repo_owner=%github.owner org=%github.org user=%github.user secret_types=%github.diff.committed_secrets.desc file=%github.diff.committed_secrets.files line=%github.diff.committed_secrets.lines url=%github.diff.committed_secrets.links)
priority: CRITICAL
source: github
Rule概要
GitHub Plugin for Falcoをインストールすることで使用可能になるルールです。
本ルールは、パブリックリポジトリにSecretがプッシュされたことを検知します。
Secretは、パスワードやアクセスキーなど、環境内で使用される機密情報です
Secretを不適切に管理すると、セキュリティ侵害が発生する可能性があります。
KubernetesのSecretを安全に管理する方法については、こちらのサイトをご参照ください。
Condition(条件)
github.type=push and
githubのメッセージタイプが push で、
github.diff.has_secrets = true and
コミットのうちの1つのdiffがSecretを含む場合で、
github.repo.public=true
githubがpublic(公開されている)の場合
Output(出力)
1つ以上のSecretがパブリックリポジトリにプッシュされました
%github.repo
リポジトリ名
%github.owner
リポジトリのオーナー名
%github.org
リポジトリが所属する組織名
%github.user
イベントをトリガーしたユーザー名
%github.diff.committed_secrets.desc
コミットされたそれぞれのSecretの説明
%github.diff.committed_secrets.files
コミットされたそれぞれのSecretのファイル名
%github.diff.committed_secrets.lines
コミットされたそれぞれのSecretの行ポジション
%github.diff.committed_secrets.links
コミットされたそれぞれのSecretのソースコードリンク