Skip to content
KitploitKITPLOIT
도구블로그
제출
도구블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

··피드·문의·개인정보·© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
santamon — 경량 macOS 탐지 에이전트로, Santa의 엔드포인트 보안 텔레메트리를 기반으로 구축되었습니다. | Kitploit
도구/GitHubGitHub/0x4d31/santamon
Defensive ToolsThreat IntelligenceIntrusion DetectionIncident ResponseLog Analysis
GitHub0x4d31/santamon

santamon

경량 macOS 탐지 에이전트로, Santa의 엔드포인트 보안 텔레메트리를 기반으로 구축되었습니다.

저장소 보기
11588개월 전Kitploit 검토 완료

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

Finch logo

Santamon

경량 macOS 탐지 사이드카로, Santa와 함께 동작하며 Endpoint Security 텔레메트리를 CEL 규칙으로 로컬에서 평가하고, 매칭된 탐지 신호만 백엔드 서버로 전달합니다.

실험적 단계. 홈 랩 및 소규모 플릿용으로 제작되었습니다. 초기 릴리스 – 버그 및 API 변경이 있을 수 있습니다.

기능 설명

Santamon은 Santa의 protobuf 텔레메트리 스트림을 읽고, CEL 표현식을 사용하여 탐지 규칙을 평가한 후, 보안 신호를 백엔드로 전송합니다. 원시 텔레메트리는 엔드포인트에 남으며, 탐지된 신호만 전달됩니다.

핵심 기능:

  • 로컬 탐지: CEL 기반 규칙으로 이벤트를 온디바이스 평가
  • 세 가지 규칙 유형: 단순 매칭, 시간 윈도우 상관관계, 기준선(최초 발견)
  • 프로세스 계보: 선택적으로 실행 신호에 전체 프로세스 트리 첨부
  • 임베디드 상태: BoltDB가 상관관계, 최초 발견 데이터 및 신호 큐 관리
  • 복원력 있는 전송: 동시 배치, 재시도 로직, 서킷 브레이커

왜 Santamon인가?

Santamon은 Santa의 탐지 사이드카이며, 또 다른 ESF 클라이언트가 아닙니다.

커스텀 ESF 도구를 구축하려면 Apple의 제한된 entitlements, 프로비저닝 프로파일, 그리고 대용량 Endpoint Security 이벤트의 신중한 처리가 필요합니다. Santa는 이미 이러한 작업을 수행하며 프로덕션에서 검증되었습니다.

Santamon의 가치:

  • Santa를 ESF 센서 계층으로 재사용 (추가 entitlements 불필요)
  • 데이터에 가까운 로컬에서 규칙 실행 – 모든 것을 스트리밍하지 않음
  • BoltDB를 통한 경량 상태 – 상관관계 및 중복 제거
  • 낮은 인프라 비용 – 높은 신호 탐지만 전송

Santa는 Endpoint Security 이벤트를 안정적이고 안전하게 수집하는 무거운 작업을 처리하며, Santamon은 탐지 로직과 신호 품질에 집중합니다.

아키텍처

root@kitploit:~
Santa Spool → Watcher → Decoder → Rules Engine → Signal Generator → Shipper → Backend
                 ↓                      ↓
                ┌────────────────────────┐
                │ 상태 DB (BoltDB)       │
                │ • 상관관계 윈도우      │
                │ • 기준선 추적          │
                │ • 신호 큐              │
                └────────────────────────┘
                프로세스 계보: 인메모리 캐시 (1시간 TTL, 최대 50K)

데이터 흐름:

  1. Watcher가 Santa의 스풀 디렉토리(/var/db/santa/spool/new/)에서 새 protobuf 파일을 모니터링
  2. Decoder가 스풀 파일에서 protobuf 메시지를 읽고 압축 해제
  3. Rules Engine이 이벤트를 CEL 표현식(단순, 상관관계, 기준선 규칙)에 대해 평가
  4. Signal Generator가 규칙 매칭에 대해 컨텍스트가 풍부한 신호 생성 (선택적 프로세스 트리 포함)
  5. Shipper가 신호를 배치로 모아 HTTPS를 통해 백엔드로 전송 (재시도 로직 및 서킷 브레이커 포함)
  6. State DB가 상관관계 상태, 기준선 추적, 신호 큐, 스풀 저널을 유지

스풀 라이프사이클:

  • 탐지되지 않은 스풀 파일은 처리 후 삭제되어 Santa 스풀이 가득 차지 않도록 방지
  • 탐지를 생성한 파일은 santa.archive_dir (기본값: /var/lib/santamon/spool_hits)로 보관
  • 신호에는 사용 가능한 경우 보관된 스풀 경로가 포함되어 필요시 protobuf를 검색할 수 있음

프로세스 계보:

  • 최근 프로세스 실행 기록의 인메모리 캐시
  • 실행 탐지에 전체 프로세스 트리 컨텍스트 제공
  • TTL: 1시간 | 최대: 50K 항목 (LRU 축출)
  • 부트 세션 격리 (부트 간 계보 없음)
  • 사용법은 RULES.md 참조

요구 사항

  • macOS 15.4+ (일부 텔레메트리 유형(예: tcc_modification)은 macOS 15+ 필요)
  • Protobuf 텔레메트리 지원 Santa from northpolesec/santa
    • Santa 텔레메트리 문서 참조
    • 설정 예시: configs/examples/santa-config.mobileconfig
  • Go 1.23+ (소스에서 빌드 시)

설치

1. Protobuf 텔레메트리용 Santa 설정

Santa가 protobuf 이벤트를 기록하도록 구성해야 합니다. 제공된 구성 프로필을 사용하세요:

root@kitploit:~
# 검토 및 사용자 정의 후 시스템 설정을 통해 설치
open configs/examples/santa-config.mobileconfig

# 확인
santactl status | grep "Log Type"
# 출력: Log Type | protobuf

2. Santamon 빌드

root@kitploit:~
git clone https://github.com/0x4d31/santamon.git
cd santamon
make build

3. 시스템 전체 설치

root@kitploit:~
sudo make install

이 명령은 다음을 설치합니다:

  • 바이너리: /usr/local/bin/santamon
  • 설정: /etc/santamon/config.yaml 및 rules.yaml
  • LaunchDaemon: /Library/LaunchDaemons/com.santamon.plist
  • 상태 디렉토리: /var/lib/santamon/

4. 백엔드 및 API 키 설정

/etc/santamon/config.yaml 편집:

root@kitploit:~
shipper:
  endpoint: "https://your-backend.example.com:8443/ingest"
  api_key: "${SANTAMON_API_KEY}"

LaunchDaemon plist에 API 키 설정:

root@kitploit:~
# 강력한 API 키 생성
openssl rand -hex 32

# LaunchDaemon 편집
sudo nano /Library/LaunchDaemons/com.santamon.plist

# EnvironmentVariables 아래에 추가:
<key>SANTAMON_API_KEY</key>
<string>your-generated-key-here</string>

5. 시작

root@kitploit:~
# 서비스 시작
sudo make start

# 로그 모니터링
make logs

설정

기본 설정: /etc/santamon/config.yaml

최소 설정 예시
root@kitploit:~
agent:
  id: "${HOSTNAME}"

shipper:
  endpoint: "https://backend.example.com:8443/ingest"
  api_key: "${SANTAMON_API_KEY}"
주요 설정
root@kitploit:~
santa:
  spool_dir: "/var/db/santa/spool"      # Santa 스풀 위치
  archive_dir: "/var/lib/santamon/spool_hits"  # 알림을 생성한 스풀 파일 보관
  stability_wait: "2s"                  # 새 파일 읽기 전 대기 시간

rules:
  path: "/etc/santamon/rules.yaml"      # 파일 또는 디렉토리

state:
  db_path: "/var/lib/santamon/state.db"
  sync_writes: true                     # 쓰기 후 Fsync (더 안전하지만 느림)

  first_seen:
    max_entries: 10000                  # 기준선 규칙용 LRU 캐시

  windows:
    max_events: 1000                    # 상관관계 윈도우당 최대 이벤트 수

shipper:
  batch_size: 100                       # 배치당 신호 수
  flush_interval: "30s"                 # 플러시 간격
  timeout: "10s"                        # HTTP 요청 타임아웃
  tls_skip_verify: false                # 프로덕션에서는 절대 true로 설정 금지

자세한 주석이 포함된 모든 옵션은 configs/santamon.yaml을 참조하세요.

탐지 규칙

규칙은 Santa 이벤트를 평가하는 CEL 표현식입니다. 단순, 상관관계, 기준선 세 가지 유형이 지원됩니다.

단순 규칙 예시
root@kitploit:~
rules:
  - id: SM-014
    title: "비대화형 프로세스에서 curl/wget 호출"
    description: |
      터미널이 아니고 패키지 관리자도 아닌 프로세스가 curl 또는 wget을 실행.
    expr: |
      kind == "execution" &&
      event.execution.target.executable.path in ["/usr/bin/curl", "/usr/bin/wget"] &&

      // 대화형 셸 제외
      !(
        event.execution.instigator.executable.path.startsWith("/bin/bash") ||
        event.execution.instigator.executable.path.startsWith("/bin/zsh") ||
        event.execution.instigator.executable.path.startsWith("/bin/sh")
      ) &&

      // curl을 자주 사용하는 Homebrew / 패키지 관리자 도우미 제외
      !(
        event.execution.instigator.executable.path.startsWith("/opt/homebrew/") ||
        event.execution.instigator.executable.path.contains("/Homebrew/")
      )
    severity: high
    tags: ["T1105", "command-and-control"]
    extra_context: ["event.execution.args"]
    include_process_tree: true
    enabled: true
상관관계 규칙 (시간 윈도우 내 여러 이벤트)
root@kitploit:~
correlations:
  - id: SM-COR-001
    title: "여러 자격 증명 저장소에 접근하는 프로세스"
    description: "단일 프로세스가 5분 내에 3개 이상의 자격 증명 저장소에 접근."
    expr: |
      kind == "file_access" &&
      event.file_access.policy_name in [
        "ChromeCookies", "CometCookies", "SSHPrivateKeys",
        "BrowserPasswords", "KeychainDB"
      ]
    window: "5m"
    group_by: ["event.file_access.instigator.executable.path"]
    count_distinct: "event.file_access.policy_name"
    threshold: 3
    severity: critical
    tags: ["T1539", "T1552", "credential-access"]
    enabled: true
기준선 규칙 (최초 발견 탐지)
root@kitploit:~
baselines:
  - id: SM-BASE-001
    title: "사용자 경로에서 처음 실행되는 서명되지 않은 바이너리"
    description: "서명되지 않은 바이너리가 /Users 경로에서 처음 실행됨."
    expr: |
      kind == "execution" &&
      event.execution.decision == DECISION_ALLOW &&
      event.execution.target.executable.path.startsWith("/Users/") &&
      (
        !has(event.execution.target.code_signature) ||
        !has(event.execution.target.code_signature.team_id) ||
        event.execution.target.code_signature.team_id == ""
      )
    track: ["event.execution.target.executable.cdhash"]
    learning_period: "720h"
    severity: high
    tags: ["T1204.002", "initial-access"]
    enabled: true

규칙 구성: 단일 파일 (/etc/santamon/rules.yaml) 또는 다중 파일 디렉토리 구조.

배포 전 검증:

root@kitploit:~
santamon rules validate

종합 가이드는 **RULES.md**를 참조하세요.

백엔드

Santamon은 신호를 수신할 백엔드가 필요합니다. 최소 FastAPI 백엔드가 backend/에 포함되어 있습니다.

기능:

  • POST /ingest를 통해 신호 수신 (API 키 필요)
  • SQLite 데이터베이스에 신호 저장
  • 쿼리 API 제공 (GET /signals, GET /stats)
  • 하트비트를 통한 에이전트 상태 추적 (POST /agents/heartbeat)
  • 신호 관리를 위한 웹 UI

빠른 시작:

root@kitploit:~
cd backend
pip install fastapi uvicorn

# API 키 설정
export SANTAMON_API_KEY="your-key-here"

# 실행 (cert.pem이 있으면 HTTPS, 없으면 HTTP 사용)
python backend.py

console

backend/README.md 참조

CLI 명령어

root@kitploit:~
# 에이전트 실행 (포그라운드, 상세 모드)
santamon run --verbose

# 규칙 검증
santamon rules validate

# 상태 표시
santamon status

# 데이터베이스 작업
santamon db stats      # 통계 표시
santamon db compact    # 데이터베이스 압축

# 버전
santamon version

문서

  • RULES.md - 탐지 규칙 작성 가이드
  • SECURITY.md - 보안 고려 사항 및 에이전트 복원력
  • backend/README.md - 백엔드 배포 가이드
  • configs/santamon.yaml - 전체 설정 참조
  • configs/rules.yaml - 예시 탐지 규칙
도구 다운로드