Skip to content
KitploitKITPLOIT
ツールエクスプロイトブログ
Log in
提出
ツールエクスプロイトブログ
提出

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

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

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

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
AA Discord Audit — Alliance AuthのDiscord統合用のリコンシリエーション監査ツール:Authが付与したことのないAA管理ロールを保持するギルドメンバーを検出し、オペレーター制御のポリシーに基づいてそれらのロールを剥奪またはメンバーをキックします。スタンドアロンのコミュニティDjangoアプリ。 | Kitploit
ツール/GitLabGitLab/eveo7/aa-discord-audit
防御ツール構成監査アイデンティティ&アクセス管理 (IAM)インシデントレスポンス
GitLabeveo7/aa-discord-audit

AA Discord Audit

Alliance AuthのDiscord統合用のリコンシリエーション監査ツール:Authが付与したことのないAA管理ロールを保持するギルドメンバーを検出し、オペレーター制御のポリシーに基づいてそれらのロールを剥奪またはメンバーをキックします。スタンドアロンのコミュニティDjangoアプリ。

リポジトリを見る
772日前未レビュー

人気

すべて見る →

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

すべてのツールを探索

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

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

aa-discord-audit

PyPI version Supported Python versions License: MIT

Alliance AuthのDiscord連携向けの整合性監査ツールです。設定されたDiscordギルドにおける実際のロール割り当てを、Alliance Auth側で表現されている状態(ユーザーごとのグループ+ステート)と比較し、モデレーターがAAが把握していないユーザーに対してAA名のロールを手動で割り当てられるというギャップを解消します。

ステータス: アルファ版(0.1.x)。パブリックAPIおよび設定は1.0より前に変更される可能性があります。

目次

  • 安全性の方針
  • 仕組み
  • 要件
  • インストール
  • クイックスタート
  • 権限
  • 設定
  • 管理コマンド
  • 定期監査(Celery beat)
  • Celeryタスク
  • オペレーターダッシュボード
  • 可観測性
  • 制限事項
  • ドキュメント
  • 開発
  • マージリクエストCI

安全性の方針

監査はデフォルトで安全です:

  • インストール後の初回実行は、オペレーターの設定に関係なくドライランに固定されます。ロックの解除には明示的なInitialAuditAcknowledgement(管理者またはシェルのみ)が必要です。
  • デフォルトのポリシーはすべてのカテゴリでreportです — 破壊的なアクションはオプトインです。
  • 監査証跡の行(AuditRun、AuditFinding、AuditInvocation、ConfigChangeLog)はマネージャー層とインスタンス層で追記専用です。一括のupdate() / bulk_update()はブロックされます。
  • Webhook URLは認証情報として扱われ、ログ、例外メッセージ、および永続化されたargvから秘匿化されます。

仕組み

各ギルドメンバーは1つのカテゴリに分類されます:

カテゴリ意味
unknown_guestAAが何も把握していないDiscordメンバー
linked_no_permAAに認識されているがdiscord.access_discordを持たない
bot_filtered設定されたボットアカウント — 一切のアクション対象外

オペレーターは各カテゴリを1つのアクションにマッピングします:

アクション動作
report検出結果を記録;Discord側の変更なし
stripAA管理のロールを削除
strip_kickAA管理のロールを削除し、その後ギルドからキック

マッピングはAA_DISCORD_AUDIT_POLICY設定です。グループごとおよびステートごとのオーバーライドは各カテゴリ内にネストされます。

要件

  • Python 3.10–3.13
  • Django 5.2
  • Alliance Auth 5.x
  • Alliance AuthのDiscordサービスモジュール(allianceauth.services.modules.discord)がインストールおよび設定済みであること(ボットトークン+ギルド)

インストール

pip install aa-discord-audit

Auth の local.py にて:

# `aa_discord_audit` must appear AFTER
# `allianceauth.services.modules.discord` so the discord module's
# models load first; `apps.ready()` raises `ImproperlyConfigured`
# otherwise.
INSTALLED_APPS += ["aa_discord_audit"]

MIDDLEWARE += [
    "aa_discord_audit.current_user.CurrentUserMiddleware",
]

次にマイグレーションを実行します:

python manage.py migrate aa_discord_audit

CurrentUserMiddleware は必須です — これが欠けていると apps.ready() が ImproperlyConfigured を発生させます。これにより、ConfigChangeLog のシグナルハンドラが 管理者による編集を <system> ではなく実際のユーザーに帰属させることができます。

クイックスタート

  1. 監査を実行するオペレーターロールに aa_discord_audit.run_audit を付与します。

  2. ドライラン監査を実行します:

    python manage.py audit_discord_roles --action report
    
  3. Auth ダッシュボードの Discord Audit → Audit runs で検出結果を確認します。

  4. 初回実行ロックを解除します — 管理者経由で InitialAuditAcknowledgement 行を作成するか、 python manage.py audit_acknowledge_initial を実行します。どちらも aa_discord_audit.run_audit および aa_discord_audit.acknowledge_initial_audit が必要です。

  5. 準備ができたら、任意の破壊的アクションを指定して再実行します。

権限

コードネーム制御対象
aa_discord_audit.run_audit管理コマンド、beat タスク、実行の削除
aa_discord_audit.run_audit_destructivestrip / strip_kick の Web 起動ゲート(run_audit とは別)
aa_discord_audit.acknowledge_initial_audit初回実行ドライランロックの解除
aa_discord_audit.manage_discord_identityDiscordIdentity 管理
aa_discord_audit.manage_role_exceptionManagedRoleException 管理
aa_discord_audit.manage_protected_memberProtectedDiscordMember 管理
aa_discord_audit.manage_bot_account_uidBotAccountUid 管理
aa_discord_audit.manage_finding_overrideFindingActionOverride 管理
aa_discord_audit.view_auditrun (および関連)Auth ダッシュボードの読み取り専用監査証跡

manage_* コードネームは影響範囲ごとに分割されているため、 manage_bot_account_uid を持つジュニアユーザーが ManagedRoleException を編集して監査を無効化することはできません。

設定

すべての設定は任意です。デフォルトは安全です。

# Action policy. Bare-string form below is shorthand for
# {"default": "<action>"}; use the nested form for per-group / per-state
# overrides keyed by AA group name and state name.
AA_DISCORD_AUDIT_POLICY = {
    "unknown_guest":  "report",
    "linked_no_perm": "report",
    # "strip" is rejected at startup for linked_no_perm (it conflicts with
    # AA's update_groups task); use "strip_kick" instead.
    # "linked_no_perm": {
    #     "default":  "strip_kick",
    #     "by_state": {"Guest": "report"},
    #     "by_group": {"Directors": "report"},
    # },
}

# AA-notify fan-out to permission holders.
AA_DISCORD_AUDIT_NOTIFY_ADMINS = True

# Discord webhook for run summaries. Treat as a credential.
AA_DISCORD_AUDIT_WEBHOOK_URL = None

# uids skipped as bot accounts (in addition to the BotAccountUid admin
# table).
AA_DISCORD_AUDIT_BOT_UIDS = []

# Auto-discover bot accounts by Discord nickname heuristics. Reserved
# for v2; not implemented in the MVP. The startup validator raises
# ImproperlyConfigured if set to True — keep this False and use the
# explicit BotAccountUid admin table instead.
AA_DISCORD_AUDIT_AUTO_DISCOVER_BY_NICKNAME = False

# Retention. 0 disables pruning; the validator refuses 0 unless the
# acknowledged flag below is also set.
AA_DISCORD_AUDIT_RUN_RETENTION_DAYS = 180
AA_DISCORD_AUDIT_RETENTION_OPT_OUT_ACKNOWLEDGED = False

# Idempotency-key TTL. When positive, prune_audit_runs releases
# AuditRun.idempotency_key on rows older than the cutoff while the
# row itself stays for RUN_RETENTION_DAYS. 0 (default) disables the
# expiry; the key dies with the row.
AA_DISCORD_AUDIT_IDEMPOTENCY_KEY_TTL_DAYS = 0

# Per-run deadline. The Celery task's soft_time_limit follows.
AA_DISCORD_AUDIT_RUN_DEADLINE_MINUTES = 60

# Rolling 24h rate limit on accepted audit triggers per user.
# DISABLED is an opt-out gate; refuses to take effect unless
# explicitly toggled.
AA_DISCORD_AUDIT_RUN_RATE_LIMIT_PER_DAY = 5
AA_DISCORD_AUDIT_RUN_RATE_LIMIT_DISABLED = False

# Discord webhook delivery tuning.
AA_DISCORD_AUDIT_WEBHOOK_TIMEOUT = 10
AA_DISCORD_AUDIT_WEBHOOK_MAX_RETRIES = 3

# Opt-in: bulk PATCH role strip. Faster on large guilds; off by default
# while we collect operator feedback on Discord-side rate-limit shape.
AA_DISCORD_AUDIT_USE_BULK_ROLE_STRIP = False

# Periodic (Celery beat) audit. Destructive actions on the unattended
# beat require this explicit opt-in, independent of the one-shot
# first-run lock: a beat run carrying strip/kick is coerced to report
# otherwise, with a startup warning on mismatch.
AA_DISCORD_AUDIT_BEAT_ALLOW_DESTRUCTIVE = False

# Coarse global floor between beat runs, in minutes. 0 (default)
# disables it — the Celery beat schedule is the primary cadence
# control. A backstop against a misconfigured fast schedule
# (QueueOnce only dedupes concurrent ticks, not back-to-back ones).
AA_DISCORD_AUDIT_BEAT_MIN_INTERVAL_MINUTES = 0

# Pin the CLI acting user to a Django username (the "service principal"
# pattern). The management command has no HTTP request, so the actor is
# normally derived from the OS login; set this for clean, stable
# ConfigChangeLog attribution from cron and manual CLI alike. Resolved
# and permission-checked per invocation.
AA_DISCORD_AUDIT_CLI_ACTOR = None
ツールをダウンロード