
AWS上でペタバイト規模の脅威ハンティング、検出 & 対応、およびサイバーセキュリティ分析のためのオープンソースセキュリティデータレイク
Matano オープンソースセキュリティデータレイクは、AWS上でセキュリティチーム向けに構築されたオープンソースのクラウドネイティブなセキュリティデータレイクです。
[!NOTE] Matano は、完全なエンタープライズセキュリティオペレーションプラットフォームのための商用マネージド Cloud SIEM を提供しています。詳細はこちら。
matano CLIをインストールして、MatanoをAWSアカウントにデプロイし、デプロイメントを管理します。
Linux```bash curl -OL https://github.com/matanolabs/matano/releases/download/nightly/matano-linux-x64.sh chmod +x matano-linux-x64.sh sudo ./matano-linux-x64.sh
**macOS**```bash
curl -OL https://github.com/matanolabs/matano/releases/download/nightly/matano-macos-x64.sh
chmod +x matano-macos-x64.sh
sudo ./matano-macos-x64.sh
はじめるには、matano init コマンドを実行してください。
初期化後、Matano ディレクトリ はプロジェクト内のすべてのリソース(ログソース、検出、その他の設定など)を制御・管理するために使用されます。構造は以下の通りです:```bash ➜ example-matano-dir git:(main) tree ├── detections │ └── aws_root_credentials │ ├── detect.py │ └── detection.yml ├── log_sources │ ├── cloudtrail │ │ ├── log_source.yml │ │ └── tables │ │ └── default.yml │ └── zeek │ ├── log_source.yml │ └── tables │ └── dns.yml ├── matano.config.yml └── matano.context.json
新しいログソースをオンボーディングする場合や検知ルールを作成する場合は、プロジェクト内の任意の場所から `matano deploy` を実行して、変更内容をアカウントにデプロイします。
## 🔧 ログ変換とデータ標準化
[**カスタムログソースの設定に関する完全なドキュメントを読む**](https://www.matano.dev/docs/log-sources/configuration)
Vector Remap Language (VRL) を使用すると、カスタムログソースを簡単にオンボーディングでき、[Elastic Common Schema (ECS)](https://www.elastic.co/guide/en/ecs/current/ecs-reference.html) に従ってフィールドを正規化することが推奨されます。これにより、セキュリティデータレイク全体でのIOCの拡張ピボットや一括検索が可能になります。
ユーザーは、ログソースのサポートされているメカニズム(例:S3、SQS)を介して取り込まれる非構造化ログを解析および変換するために、カスタムVRLプログラムを定義できます。
VRL は、観測可能性データ(例:ログ)を安全かつ高性能に変換するために設計された式指向言語です。シンプルな構文と、観測可能性のユースケースに特化した豊富な組み込み関数を備えています。
### 例:JSONの解析
簡単な例を見てみましょう。次のようなHTTPログイベントを扱っていると想像してください。
``````json
{
"line": "{\"status\":200,\"srcIpAddress\":\"1.1.1.1\",\"message\":\"SUCCESS\",\"username\":\"ub40fan4life\"}"
}
各イベントに以下の変更を適用する場合:
line 文字列を JSON としてパースし、フィールドをトップレベルに展開するsrcIpAddress を ECS フィールド source.ip にリネームするusername フィールドを削除するmessage を小文字に変換するこの VRL プログラムをログソースに transform ステップとして追加することで、上記すべてを実現できます。
transform: | . = object!(parse_json!(string!(.json.line))) .source.ip = del(.srcIpAddress) del(.username) .message = downcase(string!(.message))
schema: ecs_field_names: - source.ip - http.status
結果のイベント 🎉:```json
{
"message": "success",
"status": 200,
"source": {
"ip": "1.1.1.1"
}
}
検知を使用して、セキュリティログ内の脅威を警告するルールを定義します。_検知_は、ログソースからのデータをリアルタイムで処理し、_アラート_を生成できるPythonプログラムです。
def detect(record): return ( record.deepget("event.action") == "CreateInstanceExportTask" and record.deepget("event.provider") == "ec2.amazonaws.com" and record.deepget("event.outcome") == "failure" )
#### 設定済みのすべてのログソース(例:Okta、AWS、GWorkspace)にわたるIPによるブルートフォースログインの検出
###### detect.py```python
def detect(r):
return (
"authentication" in r.deepget("event.category", [])
and r.deepget("event.outcome") == "failure"
)
def title(r):
return f"Multiple failed logins from {r.deepget('user.full_name')} - {r.deepget('source.ip')}"
def dedupe(r):
return r.deepget("source.ip")
tables:
#### 未知のIPアドレスからのログイン成功を検出```python
from detection import remotecache
# a cache of user -> ip[]
user_to_ips = remotecache("user_ip")
def detect(record):
if (
record.deepget("event.action") == "ConsoleLogin" and
record.deepget("event.outcome") == "success"
):
# A unique key on the user name
user = record.deepget("user.name")
existing_ips = user_to_ips[user] or []
updated_ips = user_to_ips.add_to_string_set(
user,
record.deepget("source.ip")
)
# Alert on new IPs
new_ips = set(updated_ips) - set(existing_ips)
if existing_ips and new_ips:
return True
すべてのアラートは、matano_alerts という名前の Matano テーブルに自動的に保存されます。アラートとルールマッチは ECS に正規化され、ルールマッチをトリガーした元のイベントに関するコンテキストと、アラートおよびルールデータを含みます。
クエリ例
先週アクティブ化された(しきい値を超えた)アラートを要約する```sql select matano.alert.id as alert_id, matano.alert.rule.name as rule_name, max(matano.alert.title) as title, count(*) as match_count, min(matano.alert.first_matched_at) as first_matched_at, max(ts) as last_matched_at, array_distinct(flatten(array_agg(related.ip))) as related_ip, array_distinct(flatten(array_agg(related.user))) as related_user, array_distinct(flatten(array_agg(related.hosts))) as related_hosts, array_distinct(flatten(array_agg(related.hash))) as related_hash from matano_alerts where matano.alert.first_matched_at > (current_timestamp - interval '7' day) and matano.alert.activated = true group by matano.alert.rule.name, matano.alert.id order by last_matched_at desc
#### アラートの配信
アラートを外部システムに配信できます。アラートSNSトピックを使用して、Email、Slack、その他のサービスにアラートを配信できます。
<div align="center">
<br>
<img src="https://assets.kitploit.com/production/public/readmes/5606/979ffa3a7d4505421e1206b39e30e6e2cd96d47949ae953cdb755f00b64ac86e.png" width="600">
<br>
<i>Slackに配信された中程度の重大度のアラート</i>
</div>
## ❤️ コミュニティサポート
一般的な使い方については、公式[ドキュメント](https://matano.dev/docs)を参照してください。さらにサポートが必要な場合は、以下のチャンネルで質問してください:
- [Discord](https://discord.gg/YSYfHMbfZQ) \(家族に加わり、チームやコミュニティと交流しましょう\)
- [フォーラム](https://github.com/matanolabs/matano/discussions) \(機能、プロジェクト、問題についての深い議論のため\)
- [GitHub](https://github.com/matanolabs/matano) \(バグ報告、貢献\)
- [Twitter](https://twitter.com/matanolabs) \(最新ニュースを入手\)
## 👷 コントリビューター
これらの素晴らしい方々に感謝します([絵文字キー](https://allcontributors.org/docs/en/emoji-key)):
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<table>
<tbody>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/shaeqahmed"><img src="https://assets.kitploit.com/production/public/readmes/5606/da6af7bd665b48461fc19bf8cb33b49258aa7060fc2cb4d3dc143889596acfd0.jpg" width="100px;" alt="Shaeq Ahmed"/><br /><sub><b>Shaeq Ahmed</b></sub></a><br /><a href="#maintenance-shaeqahmed" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.matano.dev/"><img src="https://assets.kitploit.com/production/public/readmes/5606/837b51975f416f31c504d2fe6f14d3a1b1ba787578f6363d666892d745d5d7fc.jpg" width="100px;" alt="Samrose"/><br /><sub><b>Samrose</b></sub></a><br /><a href="#maintenance-Samrose-Ahmed" title="Maintenance">🚧</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/kai-ten"><img src="https://assets.kitploit.com/production/public/readmes/5606/a0825103807e9a55e29f2208f6a4b1820214b1ca7000b602bf4895bbeaa50908.jpg" width="100px;" alt="Kai Herrera"/><br /><sub><b>Kai Herrera</b></sub></a><br /><a href="https://github.com/matanolabs/matano/commits?author=kai-ten" title="Code">💻</a> <a href="#ideas-kai-ten" title="Ideas, Planning, & Feedback">🤔</a> <a href="#infra-kai-ten" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/rams3sh"><img src="https://assets.kitploit.com/production/public/readmes/5606/75ea8a3a8b768a26e69217f4700efeea7e56ee99d4273ece2fb757d7d3fd3842.jpg" width="100px;" alt="Ram"/><br /><sub><b>Ram</b></sub></a><br /><a href="https://github.com/matanolabs/matano/issues?q=author%3Arams3sh" title="Bug reports">🐛</a> <a href="#ideas-rams3sh" title="Ideas, Planning, & Feedback">🤔</a> <a href="#userTesting-rams3sh" title="User Testing">📓</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://zbmowrey.com/"><img src="https://assets.kitploit.com/production/public/readmes/5606/3cf4d1cd4dac53a82628dacff2ea9b99505aef82723f4ee6fd4506fd1b63ed48.png" width="100px;" alt="Zach Mowrey"/><br /><sub><b>Zach Mowrey</b></sub></a><br /><a href="#ideas-zbmowrey" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/matanolabs/matano/issues?q=author%3Azbmowrey" title="Bug reports">🐛</a> <a href="#userTesting-zbmowrey" title="User Testing">📓</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/marcin-kwasnicki"><img src="https://assets.kitploit.com/production/public/readmes/5606/8c89eb3f4824adbc668f7e8e8d4714ba6ed7f3e08a9dcdb392335d42d0c5ff3b.png" width="100px;" alt="marcin-kwasnicki"/><br /><sub><b>marcin-kwasnicki</b></sub></a><br /><a href="#userTesting-marcin-kwasnicki" title="User Testing">📓</a> <a href="https://github.com/matanolabs/matano/issues?q=author%3Amarcin-kwasnicki" title="Bug reports">🐛</a> <a href="#ideas-marcin-kwasnicki" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/gdrapp"><img src="https://assets.kitploit.com/production/public/readmes/5606/efef1d590d1f113b3e2f0a59de8d7a5cb67534b61b25f20089688a7ee7533488.png" width="100px;" alt="Greg Rapp"/><br /><sub><b>Greg Rapp</b></sub></a><br /><a href="https://github.com/matanolabs/matano/issues?q=author%3Agdrapp" title="Bug reports">🐛</a> <a href="#ideas-gdrapp" title="Ideas, Planning, & Feedback">🤔</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/niheconomoum"><img src="https://assets.kitploit.com/production/public/readmes/5606/2fbec725261340b771febb64341a3cf224757dec4b630ad3dc264dd2f06b004d.png" width="100px;" alt="Matthew X. Economou"/><br /><sub><b>Matthew X. Economou</b></sub></a><br /><a href="https://github.com/matanolabs/matano/issues?q=author%3Aniheconomoum" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/jarretraim"><img src="https://assets.kitploit.com/production/public/readmes/5606/caa7cc87b6164d0f803772fab5bac40a3d997437b6c383919a5e077a466ac334.jpg" width="100px;" alt="Jarret Raim"/><br /><sub><b>Jarret Raim</b></sub></a><br /><a href="https://github.com/matanolabs/matano/issues?q=author%3Ajarretraim" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://mdfranz.dev/"><img src="https://assets.kitploit.com/production/public/readmes/5606/65c31a803bb41772596c3e2daadd6d9a74a678fc1043321ed77883b03a4d7930.jpg" width="100px;" alt="Matt Franz"/><br /><sub><b>Matt Franz</b></sub></a><br /><a href="https://github.com/matanolabs/matano/issues?q=author%3Amdfranz" title="Bug reports">🐛</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://www.linkedin.com/in/francescofaenzi/"><img src="https://assets.kitploit.com/production/public/readmes/5606/c46cb3d9f09d191e8a3da1732159dd75187435993d87d7c9655e02df9feeb239.jpg" width="100px;" alt="Francesco Faenzi"/><br /><sub><b>Francesco Faenzi</b></sub></a><br /><a href="#ideas-FrancescoFaenzi" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://nishant.daspatnaik.com/"><img src="https://assets.kitploit.com/production/public/readmes/5606/b35b7582c587503707d73914779acb8592fe5eb95535e0c7d823e4cc50e6b097.jpg" width="100px;" alt="Nishant Das Patnaik"/><br /><sub><b>Nishant Das Patnaik</b></sub></a><br /><a href="#ideas-dpnishant" title="Ideas, Planning, & Feedback">🤔</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/timoguin"><img src="https://assets.kitploit.com/production/public/readmes/5606/c4c413260019be4943b6c577c46a587862f553ceda7ef70a8adf3f92c003f523.png" width="100px;" alt="Tim O'Guin"/><br /><sub><b>Tim O'Guin</b></sub></a><br /><a href="#ideas-timoguin" title="Ideas, Planning, & Feedback">🤔</a> <a href="https://github.com/matanolabs/matano/issues?q=author%3Atimoguin" title="Bug reports">🐛</a> <a href="https://github.com/matanolabs/matano/commits?author=timoguin" title="Code">💻</a></td>
<td align="center" valign="top" width="14.28%"><a href="https://github.com/francescor"><img src="https://assets.kitploit.com/production/public/readmes/5606/7174ae423e954ecd8be9849969348acd29fc7b8f8ce3d539398669d564d0ee92.jpg" width="100px;" alt="Francesco R."/><br /><sub><b>Francesco R.</b></sub></a><br /><a href="https://github.com/matanolabs/matano/issues?q=author%3Afrancescor" title="Bug reports">🐛</a></td>
</tr>
<tr>
<td align="center" valign="top" width="14.28%"><a href="http://grue.io"><img src="https://assets.kitploit.com/production/public/readmes/5606/1d375cb6024264e2e8116b4114d4537734bcca383526d32754e0d8e335641bd3.jpg" width="100px;" alt="Joshua Sorenson"/><br /><sub><b>Joshua Sorenson</b></sub></a><br /><a href="https://github.com/matanolabs/matano/commits?author=grue" title="Code">💻</a> <a href="https://github.com/matanolabs/matano/commits?author=grue" title="Documentation">📖</a></td>
<td align="center" valign="top" width="14.28%"><a href="http://www.nevermind.co.nz"><img src="https://assets.kitploit.com/production/public/readmes/5606/6afd9108528633598c724be40eae37abdde5ea9c89fd498d35c398f98bc4f765.jpg" width="100px;" alt="Chris Smith"/><br /><sub><b>Chris Smith</b></sub></a><br /><a href="https://github.com/matanolabs/matano/commits?author=chrismsnz" title="Code">💻</a></td>
</tr>
</tbody>
</table>
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
<!-- prettier-ignore-start -->
<!-- markdownlint-disable -->
<!-- markdownlint-restore -->
<!-- prettier-ignore-end -->
<!-- ALL-CONTRIBUTORS-LIST:END -->
このプロジェクトは[all-contributors](https://allcontributors.org)仕様に従っています。あらゆる種類の貢献を歓迎します!
## ライセンス
- [Apache-2.0 License](https://github.com/matanolabs/matano/blob/main/LICENSE)
<img referrerpolicy="no-referrer-when-downgrade" src="https://assets.kitploit.com/production/public/readmes/5606/93ae7d494fad0fb30cbf3ae746a39c4bc7a0f8bbf87fbb587a3f3c01f3c5ce20.png"/>