
AWS에서 페타바이트 규모의 위협 헌팅, 탐지 및 대응, 사이버 보안 분석을 위한 오픈 소스 보안 데이터 레이크
Matano 오픈소스 보안 데이터 레이크는 AWS상의 보안 팀을 위해 구축된 오픈소스 클라우드 네이티브 보안 데이터 레이크입니다.
[!NOTE] Matano는 완전한 엔터프라이즈 보안 운영 플랫폼을 위한 상용 관리형 Cloud SIEM을 제공합니다. 자세히 알아보기.
Matano CLI를 설치하여 AWS 계정에 Matano를 배포하고 배포를 관리합니다.
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
When onboarding a new log source or authoring a detection, run `matano deploy` from anywhere in your project to deploy the changes to your account.
## 🔧 로그 변환 및 데이터 정규화
[**커스텀 로그 소스 구성에 대한 전체 문서 읽기**](https://www.matano.dev/docs/log-sources/configuration)
[Vector Remap Language (VRL)](https://vector.dev/docs/reference/vrl/)을 사용하면 커스텀 로그 소스를 쉽게 온보딩할 수 있으며, [Elastic Common Schema (ECS)](https://www.elastic.co/guide/en/ecs/current/ecs-reference.html)에 따라 필드를 정규화하여 보안 데이터 레이크에서 IOC에 대한 향상된 피벗 및 대량 검색을 활성화할 수 있습니다.
사용자는 커스텀 VRL 프로그램을 정의하여 로그 소스에 대해 지원되는 수집 메커니즘(예: S3, SQS) 중 하나를 통해 수집되는 비정형 로그를 파싱하고 변환할 수 있습니다.
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 주제를 사용하여 이메일, 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) \(가족이 되어 팀과 커뮤니티와 함께하세요\)
- [Forum](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="유지보수">🚧</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="유지보수">🚧</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="코드">💻</a> <a href="#ideas-kai-ten" title="아이디어, 계획 및 피드백">🤔</a> <a href="#infra-kai-ten" title="인프라 (호스팅, 빌드 도구 등)">🚇</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="버그 신고">🐛</a> <a href="#ideas-rams3sh" title="아이디어, 계획 및 피드백">🤔</a> <a href="#userTesting-rams3sh" title="사용자 테스트">📓</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="아이디어, 계획 및 피드백">🤔</a> <a href="https://github.com/matanolabs/matano/issues?q=author%3Azbmowrey" title="버그 신고">🐛</a> <a href="#userTesting-zbmowrey" title="사용자 테스트">📓</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="사용자 테스트">📓</a> <a href="https://github.com/matanolabs/matano/issues?q=author%3Amarcin-kwasnicki" title="버그 신고">🐛</a> <a href="#ideas-marcin-kwasnicki" title="아이디어, 계획 및 피드백">🤔</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="버그 신고">🐛</a> <a href="#ideas-gdrapp" title="아이디어, 계획 및 피드백">🤔</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="버그 신고">🐛</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="버그 신고">🐛</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="버그 신고">🐛</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="아이디어, 계획 및 피드백">🤔</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="아이디어, 계획 및 피드백">🤔</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="아이디어, 계획 및 피드백">🤔</a> <a href="https://github.com/matanolabs/matano/issues?q=author%3Atimoguin" title="버그 신고">🐛</a> <a href="https://github.com/matanolabs/matano/commits?author=timoguin" title="코드">💻</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="버그 신고">🐛</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="코드">💻</a> <a href="https://github.com/matanolabs/matano/commits?author=grue" title="문서">📖</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="코드">💻</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/HEAD/LICENSE)
<img referrerpolicy="no-referrer-when-downgrade" src="https://assets.kitploit.com/production/public/readmes/5606/93ae7d494fad0fb30cbf3ae746a39c4bc7a0f8bbf87fbb587a3f3c01f3c5ce20.png"/>