Skip to content
KitploitKITPLOIT
ツールブログ
提出
ツールブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

··フィード·お問い合わせ·プライバシー·© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
santamon — SantaのEndpoint Securityテレメトリを活用した軽量macOS検出エージェント。 | Kitploit
ツール/GitHubGitHub/0x4d31/santamon
防御ツール脅威インテリジェンス侵入検知インシデントレスポンスログ分析
GitHub0x4d31/santamon

santamon

SantaのEndpoint Securityテレメトリを活用した軽量macOS検出エージェント。

リポジトリを見る
11588ヶ月前Kitploit レビュー済み

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →
共有

Finch ロゴ

Santamon

Santa 用の軽量 macOS 検出サイドカー。Endpoint Security テレメトリを CEL ルールでローカルに評価し、一致した検出シグナルだけをバックエンドサーバーに転送します。

実験的。 ホームラボや小規模フリート向けに構築されています。初期リリースのため、バグや API 変更が発生する可能性があります。

機能

Santamon は Santa の protobuf テレメトリストリームを読み取り、CEL 式を使用して検出ルールを評価し、セキュリティシグナルをバックエンドに送信します。生のテレメトリはエンドポイントに残り、検出結果のみが転送されます。

コア機能:

  • ローカル検出: CEL ベースのルールがデバイス上でイベントを評価します
  • 3 種類のルール: 単純マッチング、時間窓相関、ベースライン(初回検出)
  • プロセス系統: オプションで実行シグナルに完全なプロセスツリーを添付
  • 組み込み状態: BoltDB が相関、初回検出データ、シグナルキューを追跡
  • 堅牢な転送: 並行バッチ処理、リトライロジック、サーキットブレーカー

なぜ Santamon なのか?

Santamon は Santa の検出サイドカーであり、別の ESF クライアントではありません。

カスタム ESF ツールの構築には、Apple の制限付き entitlement、プロビジョニングプロファイル、そして大量の Endpoint Security イベントの慎重な処理が必要です。Santa はすでにこれを実現しており、本番環境で実証済みです。

Santamon の価値:

  • Santa を ESF センサーレイヤーとして再利用(追加の entitlement は不要)
  • すべてをストリーミングする代わりに、データの近くでルールをローカル実行
  • BoltDB による軽量な状態管理で相関と重複排除を実現
  • 低いインフラコスト - 高シグナルの検出のみを送信

Santa は Endpoint Security イベントを確実かつ安全に取り込む重い処理を担い、Santamon は検出ロジックとシグナル品質に注力します。

アーキテクチャ

root@kitploit:~
Santa Spool → Watcher → Decoder → Rules Engine → Signal Generator → Shipper → Backend
                 ↓                      ↓
                ┌────────────────────────┐
                │ State DB (BoltDB)      │
                │ • Correlation windows  │
                │ • Baseline tracking    │
                │ • Signal queue         │
                └────────────────────────┘
                Process lineage: in-memory cache (1h TTL, 50K max)

データフロー:

  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+ が必要)
  • northpolesec/santa の protobuf テレメトリ対応 Santa
    • Santa テレメトリドキュメント を参照
    • 設定例: configs/examples/santa-config.mobileconfig
  • Go 1.23+(ソースからビルドする場合)

インストール

1. Santa を protobuf テレメトリ用に設定

Santa が protobuf イベントを書き込むように設定する必要があります。提供されている構成プロファイルを使用します:

root@kitploit:~
# Review and customize, then install via System Settings
open configs/examples/santa-config.mobileconfig

# Verify
santactl status | grep "Log Type"
# Should show: 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:~
# Generate strong API key
openssl rand -hex 32

# Edit LaunchDaemon
sudo nano /Library/LaunchDaemons/com.santamon.plist

# Add under EnvironmentVariables:
<key>SANTAMON_API_KEY</key>
<string>your-generated-key-here</string>

5. 起動

root@kitploit:~
# Start service
sudo make start

# Monitor logs
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 spool location
  archive_dir: "/var/lib/santamon/spool_hits"  # Archive spool files that produced alerts
  stability_wait: "2s"                  # Wait before reading new files

rules:
  path: "/etc/santamon/rules.yaml"      # File or directory

state:
  db_path: "/var/lib/santamon/state.db"
  sync_writes: true                     # Fsync after writes (safer but slower)

  first_seen:
    max_entries: 10000                  # LRU cache for baseline rules

  windows:
    max_events: 1000                    # Max events per correlation window

shipper:
  batch_size: 100                       # Signals per batch
  flush_interval: "30s"                 # Time between flushes
  timeout: "10s"                        # HTTP request timeout
  tls_skip_verify: false                # NEVER true in production

すべてのオプションと詳細なコメントについては、configs/santamon.yaml を参照してください。

検出ルール

ルールは Santa イベントを評価する CEL 式です。単純(simple)、相関(correlation)、ベースライン(baseline) の 3 種類がサポートされています。

単純ルールの例
root@kitploit:~
rules:
  - id: SM-014
    title: "Non-interactive process invoking curl/wget"
    description: |
      Non-terminal, non-package-manager process launching curl or wget.
    expr: |
      kind == "execution" &&
      event.execution.target.executable.path in ["/usr/bin/curl", "/usr/bin/wget"] &&

      // Exclude interactive shells
      !(
        event.execution.instigator.executable.path.startsWith("/bin/bash") ||
        event.execution.instigator.executable.path.startsWith("/bin/zsh") ||
        event.execution.instigator.executable.path.startsWith("/bin/sh")
      ) &&

      // Exclude Homebrew / package-manager helpers that legitimately use curl frequently
      !(
        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: "Process touching multiple credential stores"
    description: "Single process accessing 3+ credential stores within 5 minutes."
    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: "First-time unsigned binary executed from user paths"
    description: "First time an unsigned binary executes from /Users paths."
    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)
  • シグナル管理用の Web UI

クイックスタート:

root@kitploit:~
cd backend
pip install fastapi uvicorn

# Set API key
export SANTAMON_API_KEY="your-key-here"

# Run (uses HTTPS if cert.pem exists, otherwise HTTP)
python backend.py

コンソール

backend/README.md を参照してください。

CLI コマンド

root@kitploit:~
# Run agent (foreground, verbose mode)
santamon run --verbose

# Validate rules
santamon rules validate

# Show status
santamon status

# Database operations
santamon db stats      # Show statistics
santamon db compact    # Compact database

# Version
santamon version

ドキュメント

  • RULES.md - 検出ルール作成ガイド
  • SECURITY.md - セキュリティ上の考慮事項とエージェントの耐障害性
  • backend/README.md - バックエンドデプロイガイド
  • configs/santamon.yaml - 全設定リファレンス
  • configs/rules.yaml - 検出ルールの例
ツールをダウンロード