論文: Kofi Ampomah and Tu Le. Measuring Users' Security and Privacy Concerns About Third-Party Community Bots on Discord. Network and Distributed System Security (NDSS) Symposium 2027. https://dx.doi.org/10.14722/ndss.2027.230535
成果物レビュアーの方へ: まず
ARTIFACT-EVALUATION.mdから始めてください。 このファイルは、論文内のすべての主張を、それを再現する正確なコマンドに対応付け、 期待される出力と実行時間を一覧化し、どのコンポーネントが対象外であるかを示しています。
このリポジトリには、BotLens パイプラインのソースコードが含まれています。このパイプラインは、 大規模なレビュー分析とメタデータ監査を通じて、Discord 上のサードパーティ製コミュニティベースボットにおける セキュリティおよびプライバシー (S&P) 上の懸念を分析します。このパイプラインは、 Top.gg からスクレイピングした 23,102 個のボットにわたる 183,142 件のユーザーレビューを処理し、 8,832 件のレビューを S&P 関連として識別し — 観測されたパイプラインの収率は 4.82% — それらを 31 テーマの S&P タクソノミーにマッピングします。
BotLens/
├── README.md # This file
├── ARTIFACT-EVALUATION.md # Claim → command → expected output
├── LICENSE # See License below
├── CITATION.cff # How to cite (also used by Zenodo)
├── botlens-ndss-data.zip # The data; unpack to data/ (see Data below)
├── requirements-lock.txt # Exact versions used for the paper
├── requirements.txt # Looser version bounds
│
├── config/ # Pipeline configuration
│ ├── __init__.py
│ ├── settings.py # Paths, model params, thresholds
│ └── taxonomy.py # 31-theme S&P taxonomy (single source of truth)
│
├── scrapers/ # Data collection scripts
│ ├── topgg_metadata_scraper.py # Bot metadata scraper (Top.gg pages)
│ ├── topgg_reviews_scraper.py # Bot review scraper (Top.gg reviews)
│ └── discord_server_scanner.py # Server bot scanner — OUT OF SCOPE, see below
│
├── scripts/ # Pipeline stages + analysis
│ ├── stage0_preprocess.py # Merge, clean, detect language, translate
│ ├── stage1_llm_labeling.py # Binary S&P classification via Ollama
│ ├── stage1b_active_learning.py # Active learning loop
│ ├── stage2_prepare_data.py # Train/val/test splits with balancing
│ ├── stage3_finetune_deberta.py # Fine-tune DeBERTa-v3-large classifier
│ ├── stage4_classify_all.py # Classify all 183K reviews
│ ├── stage5_theme_assignment.py # Assign 31-theme taxonomy themes
│ ├── stage6_emotion_classification.py # GoEmotions → Ekman-style groups
│ ├── stage7_analysis.py # Sec. IV-A: SPRR, TPR, per-tag/per-bot tables
│ ├── stage8_visualizations.py # Figs. 2–9
│ ├── rq3_permissions_metadata.py # RQ3 (Sec. IV-D): statistics + Figs. 10–14, 18
│ ├── language_affective_analysis.py # Appendix B: Fig. 17
│ ├── experiment_labeling_pct.py # Labeling-budget experiment (10–45%)
│ ├── create_irr_sheets.py # Inter-rater reliability labeling sheets
│ ├── compute_kappa.py # Cohen's kappa (Sec. III-C3)
│ ├── check_langs.py # Language distribution (Table IV; needs raw crawl)
│ └── prep_30pct_for_al.py # Prepare labels for active learning
│
├── tests/
│ └── test_smoke.py # Fast integrity checks, no data required
│
└── mcp_server/ # BotLens MCP server (Sec. V)
├── server.py # The six tools of Sec. V-B2 (+ internal helpers)
├── example_client.py # MCP SDK client reproducing Use Cases 1 and 2
└── benchmark_latency.py # Sec. V-D latency session
スクリプトが書き出す各図は、論文の図番号にちなんで命名されています
(figures/fig02_sprr_over_time.png は図2、以下同様)。スクリプトは
論文に掲載されている図を正確に生成します: 図2〜14、17、18です。図1はパイプラインの
概略図であり、図15〜16はBotLensレポートUIのスクリーンショットです。
アーティファクトは https://github.com/ua-spectral/BotLens でリリースされています。各GitHub リリースはDOI付きでZenodoに永久アーカイブされています。DOIは 論文のアーティファクト付録およびリポジトリのリリースページに記載されています。
データはリポジトリ内に botlens-ndss-data.zip として同梱されています (41 MB、1つのファイルが
展開すると515 MBになり、GitHubのファイルごとの上限を超えます)。リポジトリのルートで一度だけ展開してください:
python -m zipfile -e botlens-ndss-data.zip .
これにより config/ の隣に data/ が作成されます。他にダウンロードする必要はありません。レイアウトは次のとおりです:
BotLens/
└── data/
├── processed/
│ ├── all_reviews_classified.csv # 183,142 rows — required by the MCP server
│ ├── privacy_reviews_full.csv # 8,832 S&P reviews w/ themes + affect
│ ├── bot_metadata_cleaned.csv # 23,102 bots (Table I, MCP fallback)
│ ├── train.csv / val.csv / test.csv
│ └── label_map.json
├── results/ # Tables behind the paper's numbers
├── reference_figures/ # Our output of every generated figure
└── irr/ # Annotator workbooks (Sec. III-C3)
data/ 内から sha256sum -c SHA256SUMS.txt を実行して整合性を検証してください。
data/README.md に各ファイルの説明があります。
| ステージ | スクリプト | 説明 | 主要な出力 |
|---|---|---|---|
| 0 | stage0_preprocess.py | レビューとメタデータの統合、言語検出、Argos Translate | data/raw/reviews.csv |
| 1 | stage1_llm_labeling.py | Ollama/Llama 3 8B による S&P 二値分類 | phase1_binary_labels.csv |
| 1b | stage1b_active_learning.py | 不確実性サンプリング + 多数決ラベル | 改善された訓練セット |
| 2 | stage2_prepare_data.py | 信頼度フィルタリング、5:1 ダウンサンプリング、層化分割 | train/val/test.csv |
| 3 | stage3_finetune_deberta.py | DeBERTa-v3-large のファインチューニング(ラベリング率 30% で F1 = 0.938) | best_model/ |
| 4 | stage4_classify_all.py | 全 183,142 件のレビューに対するバッチ推論 | all_reviews_classified.csv |
| 5 | stage5_theme_assignment.py | Ollama が 31 テーマのタクソノミーからテーマを割り当て | privacy_reviews_themed.csv |
| 6 | stage6_emotion_classification.py | GoEmotions(RoBERTa)→ 8 つの感情グループ | privacy_reviews_full.csv |
| 7 | stage7_analysis.py | SPRR、TPR、タグ別およびボット別の SPRR、テーマ別の感情 | data/results/analysis_summary.json |
| 8 | stage8_visualizations.py | 図 2〜9(図 2 の OLS トレンド R² = 0.35 を含む) | figures/fig02_* … fig09_* |
unassigned とラベル付けされたレビューを除く)。31 テーマの S&P タクソノミー(論文 Table V)は、Akgul ら(USENIX Security 2024)から継承した
20 テーマと、本研究で帰納的に開発した 11 テーマで構成されています — 追加の
Security & Safety テーマ 2 つと Discord 固有のテーマ 9 つです。
config/taxonomy.py が唯一の信頼できる情報源であり、stage8_visualizations.py
はそこからグループ分けを導出します。
テーマグループ 1 — データ慣行(7 つ、すべて継承): Data Collection、Data Sharing、Data Deletion、Remove Personally Identifiable Information、Data Exposure、Data Hiding、Location and Tracking
テーマグループ 2 — ユーザーの権利と制御(7 つ、すべて継承): Consent、Privacy Controls、Anonymity / Identification、Advertising、Privacy Policies and Laws、Privacy Invasion、Positive Privacy
テーマグループ 3 — セキュリティと安全性(継承 6 つ + 新規 2 つ): Data Security、Password Issues、Data Accuracy、Safety、Selling Data、Surveillance、 Phishing and Scams(新規)、Data Retention(新規)
テーマグループ 4 — Discord 固有のリスク(9 つ、すべて新規): Over-Listening、Permission Scope Mismatch、Message Content Access、DM Privacy、 Gateway Intent Abuse、Webhook Misuse、Server Profiling、Voice Privacy、Bot Moderation Transparency
scrapers/topgg_metadata_scraper.py)並列の undetected-chromedriver インスタンスを使用して Top.gg から公開ボットメタデータを 収集します。90 以上のカテゴリタグを対象とし、自動再起動と進捗の永続化を備えています。
scrapers/topgg_reviews_scraper.py)非同期 Playwright と 4 つの同時ブラウザインスタンスを使用して、Top.gg のボットページから 公開ユーザーレビューをスクレイピングします。ページネーション、重複排除、ボットごとの JSON エクスポートを処理します。レビュー投稿者の表示名は公開ページに表示されますが、 意図的に読み取りも保持もされません。収集されるのはレビュー内容と公開メタデータのみです。
scrapers/discord_server_scanner.py)— 対象外このスクリプトは、実際の Discord ユーザーアカウントへのログインを自動化してサーバーの APP バッジ付きメンバーを列挙し、
scan_server_bots の実演(論文 Use Case 2)に使用されるボットマニフェストを生成します。