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

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

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

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

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
sigmalite — Sigma検出ルールを解析してログエントリに対して実行するGoライブラリ。フィールド修飾子、CIDRマッチング、セキュリティ監視用のカスタムフィールドリゾルバーをサポートしています。 | Kitploit
ツール/GitHubGitHub/runreveal/sigmalite
静的分析脆弱性分析コード分析侵入検知ログ分析
GitHubrunreveal/sigmalite

sigmalite

Sigma検出ルールを解析してログエントリに対して実行するGoライブラリ。フィールド修飾子、CIDRマッチング、セキュリティ監視用のカスタムフィールドリゾルバーをサポートしています。

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

人気

すべて見る →

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

すべてのツールを探索

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

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

github.com/runreveal/sigmalite

sigmalite パッケージは、[Sigma 検出フォーマット][] のパーサーと実行エンジンを提供します。

root@kitploit:~
rule, err := sigmalite.ParseRule([]byte(`
title: My example rule
detection:
  keywords:
    - foo
    - bar
  selection:
    EventId: 1234
  condition: keywords and selection
`))
if err != nil {
  return err
}
entry := &sigmalite.LogEntry{
  Message: "Hello foo",
  Fields: map[string]string{
    "EventId": "1234",
  },
}
isMatch := rule.Detection.Matches(entry, nil)

インストール

root@kitploit:~
go get github.com/runreveal/sigmalite

ルール

ルールは YAML 形式で記述され、最低限 title と detection を含める必要があります。

root@kitploit:~
title: My example rule
detection:
  keywords:
    - foo
    - bar
  selection:
    EventId: 1234
  condition: keywords and selection

detection ブロック内の condition フィールドは、同じ detection ブロック内の他のフィールドセレクターを結合する論理式です。この例では、このルールは EventId フィールドが 1234 と完全に一致し、かつ メッセージに "foo" または "bar" を含むログエントリにマッチします。

フィールドは [正規表現][] を使ってマッチさせることもできます。

root@kitploit:~
title: My example rule with a timestamp
detection:
  selection:
    Timestamp|re: ^2024-06-01T(01|02|03):[0-5][0-9]:[0-5][0-9]$
  condition: selection

さらに CIDR も使用できます。

root@kitploit:~
title: My example rule with IP addresses
detection:
  local:
    DestinationIp|cidr:
      - "127.0.0.0/8"
      - "10.0.0.0/8"
      - "172.16.0.0/12"
      - "192.168.0.0/16"
      - "169.254.0.0/16"
      - "::1/128" # IPv6 loopback
      - "fe80::/10" # IPv6 link-local addresses
      - "fc00::/7" # IPv6 private addresses
  condition: not local

詳細は [公式 Sigma ルールドキュメント][] を参照してください。

フィールド修飾子

このライブラリは以下の [フィールド修飾子][] をサポートしています。

  • all
  • cidr
  • contains
  • endswith
  • expand
  • re
  • startswith
  • windash
  • base64/base64offset

フィールドリゾルバ

FieldResolver インターフェースは、標準の Sigma 仕様を拡張し、単純なキー/値ペアを超えた複雑なフィールド検索シナリオをサポートします。これにより、以下のようなカスタムフィールド解決ロジックを実装できます。

  • ネストされた JSON 構造: ドット記法を使用して深くネストされたフィールドにアクセス (例: event.process.user)
  • 配列の処理: ログエントリ内の配列やリストから値を抽出
  • ワイルドカードマッチング: process.*.user や network[*].ip のようなフィールドパターンをサポート
  • 複数フィールドの集約: 複数の関連フィールドから値を結合
  • 大文字小文字の正規化: フィールド名のバリエーションと大文字小文字の区別を処理
  • 複雑なデータ変換: フィールドマッチングの前にカスタムロジックを適用
  • 外部データソースの検索: 外部データソースからフィールド値を検索。

インターフェース定義

root@kitploit:~
type FieldResolver interface {
    Resolve(fieldName string, entry *LogEntry) []string
}

Resolve メソッドは Sigma ルールからフィールド名を受け取り、マッチするすべての値を文字列スライスとして返します。マッチするものがない場合は nil または空のスライスを返します。

基本的な使用例

root@kitploit:~
// CustomResolver demonstrates field resolution for structured logs
type CustomResolver struct{}

func (r *CustomResolver) Resolve(fieldName string, entry *sigma.LogEntry) []string {
    switch fieldName {
    case "process.users":
        // Aggregate user fields from multiple sources
        var users []string
        if user, ok := entry.Fields["Event.Process.User"]; ok {
            users = append(users, user)
        }
        if user, ok := entry.Fields["Event.Login.User"]; ok {
            users = append(users, user)
        }
        if user, ok := entry.Fields["Event.Session.User"]; ok {
            users = append(users, user)
        }
        return users

    case "network.internal_ips":
        // Extract all IP addresses from network-related fields
        var ips []string
        for fieldName, value := range entry.Fields {
            if strings.Contains(strings.ToLower(fieldName), "ip") {
                // Simple IP validation (in real usage, use proper validation)
                if strings.Contains(value, ".") {
                    ips = append(ips, value)
                }
            }
        }
        return ips

    default:
        return nil
    }
}

func matches(detection *sigmalite.Detection) bool {
  opts := &sigmalite.MatchOptions{
		FieldResolver: CustomResolver{},
  },

  entry := &sigmalite.LogEntry{
		Message: string("Message Text"),
		Fields:  nil, // Using resolver so this can be empty
	}

	return detection.Matches(entry, opts)
}

フィールドリゾルバはすべての フィールド修飾子 とシームレスに連携し、解決された値に正規表現パターン、大文字小文字を区別しないマッチング、その他の変換を適用できます。

ライセンス

Apache 2.0

ツールをダウンロード