
SentryPeer v4.0.5
分散型SIPハニーポットで、VoIP攻撃に関する不正データを検出・共有します。ピアツーピアネットワークを介して悪意のあるアクターのIPアドレスと電話番号を収集し、REST APIおよびWebHook統合によりリアルタイムの脅威インテリジェンスを提供します。
悪意ある行為からSIPサーバーを保護
Deutsche Telekom Security GmbH 様のご支援に感謝いたします!誠にありがとうございます!
ぜひスターを付け、Twitter でフォローしてください!
目次
- はじめに
- 概要
- 機能
- 講演
- 導入事例
- 設計
- Docker
- インストール
- SentryPeer の実行
- WebHook
- RESTful API
- Syslog と Fail2ban
- JSON ログ形式
- コマンドラインオプション
- IPv6 マルチキャストアドレス
- ライセンス
- コントリビューション
- プロジェクトウェブサイト
- 商標
- 質問、バグ報告、機能リクエスト
- 謝辞
- スポンサーシップ
はじめに
SentryPeer® は不正検出ツールです。悪意ある行為者が電話をかけようとするのを許可し、その発信元 IP アドレスと発信先の番号を保存します。これらの詳細は、サービスプロバイダのネットワークで通知を発生させるために使用でき、次回ユーザー/顧客が収集された番号に電話しようとした際に、適切と思われる方法で対応できます。
例えば:
オンプレミスで VoIP PBX を運用しているとします。このコンテキストで SentryPeer が可能にすることは、ユーザーが発信する際に、電話番号のリスト(RESTful API を使用)に問い合わせることです。ヒットした場合、ネットワーク内のデバイスが既知の探索用電話番号に発信しようとしている可能性があるという警告が届きます。これらの番号は以下のいずれかです:
- 自分で実行している SentryPeer ノードが収集した番号
- ピアツーピアネットワークを介して自分のノードに複製された、他の SentryPeer ノードが確認した番号
これにより、高額な通話が発生する前や、さらに悪い事態が起こる前に、監視システムから通知を生成できます。
このシナリオは何に起因するのでしょうか?
- ボイスメール詐欺の可能性があります。これは、着信番号(DID/DDI)への発信を許可してボイスメールシステムに接続し、PIN の入力を促す場合に発生します。この PIN が弱く、ボイスメールシステムで「*」を押すと、ボイスメールを残した発信者 ID にコールバックできるようになっています。攻撃者はボイスメールを残し、PIN を推測してコールバックします。発信者番号は SentryPeer が確認済みの既知の番号です。これに対して警告を発することができます。
- デバイスが乗っ取られた、またはソフトフォンなどが電話の GUI から盗んだ資格情報を使用して、システムに登録し、SentryPeer が確認した番号に発信しようとしている。
- 無実のユーザーが、SentryPeer が過去に確認したフィッシング番号や高額番号などに発信している。
従来、このデータは中央の場所に送信されるため、収集したデータを自分で所有することはできません。このプロジェクトは、データのピアツーピア共有に関するものです。私にとって重要なのは、ユーザーがデータを所有し、各種サービスプロバイダー/ネットワークプロバイダー関連のデータフィードを利用できることです。データを保持して販売するサービスにはうんざりしています。自分で収集したのであれば、それを保持するか、p2p 方式で他の SentryPeer コミュニティメンバーと共有するかを選択できるべきです。
概要
SentryPeer ノード
ここでは Mermaid シーケンス図 を使用して、SentryPeer ノードから SentryPeerHQ へのデータフローを示しています。```mermaid
sequenceDiagram
actor A as Attacker
participant S as SentryPeer Node
participant DS as Data Store
participant W as WebHook
Endpoint
Note over DS: sqlite/json log/syslog
(if enabled)
Note over W: if enabled
A->>S: SIP probe OPTIONS/REGISTER/etc
S->>DS: Save event
S->>W: Send event
W->>S: 200 OK
S->>A: 200 OK
A->>S: INVITE sip:00046500729221@
#### SentryPeer Node to SentryPeerHQ```mermaid
sequenceDiagram
actor A as Attacker
participant S as SentryPeer Node
participant DS as Data Store
participant HQ as SentryPeerHQ
Note over DS: sqlite/json log/syslog (if enabled)
Note over HQ: OAuth2 creds required.<br/> if using https://sentrypeer.com
A->>S: SIP probe OPTIONS/REGISTER/etc
S->>DS: Save event
S->>HQ: Send event
HQ->>S: 201 Created
S->>A: 200 OK
A->>S: INVITE sip:00046500729221@
SentryPeer Node と SentryPeerHQ API の使用```mermaid
sequenceDiagram Actor U as User participant S as SentryPeer Node/HQ API Note over S: if enabled U->>S: GET /numbers S->>U: 200 OK Return all Phone numbers seen in database
#### 独自システムとの統合```mermaid
sequenceDiagram
participant D as Device
participant P as PBX/ITSP/Carrier
participant HQ as SentryPeer Node/HQ API
participant N as NOC
Note over P: Integration with <br/>SentryPeer needed
Note over N: Consumes alerts
Note over HQ: OAuth2 creds required<br/> if using SentryPeerHQ
Note over P,HQ: API rate limiting if using SentryPeerHQ
D->>P: SIP INVITE
P->>HQ: Have you seen attackers call this number?
HQ->>P: Yes, this has been seen on SentryPeer Nodes
HQ->>N: WebHook/Email/Slack
Note over HQ,N: Only if using SentryPeerHQ
P->>D: I'm blocking this call. Sorry
🚧 機能
- すべてのコード Free/Libre and Open Source Software
- 高速
- ユーザーは自分のデータを所有する
- ユーザーは希望すれば自分のデータを送信できる(p2pモードを有効にする必要があります -
-p) - ユーザーは、プールへのデータ送信をオプトインした場合のみ、他のユーザーのデータを取得できます
- 組み込み分散ハッシュテーブル(DHT)ノード(OpenDHT使用、
-pCLIオプション) - 収集した悪意あるアクターのピアツーピア共有(OpenDHT使用、デフォルトオフ)
- 収集した悪意あるアクターを受信するためのピアツーピアデータレプリケーション(OpenDHT使用、デフォルトオフ)
- 独自のDHTブートストラップノードを設定(
-bCLIオプション) - マルチスレッド
- UDPトランスポート
- TCPトランスポート
- TLSトランスポート
- ファイルへのJSONロギング
- SIPモードを無効にできます。これにより、SentryPeerをAPIモードやDHTモードなどでのみ実行できます。つまり、ハニーポットとしてではなく、SentryPeerコミュニティのノードとして、または複製データを提供するためだけに実行できます。
- SIP応答モードを有効にしてデータを収集できます - CLI/ENVフラグ
- 高速アクセスのためのローカルデータコピー - CLI/ENV DBロケーションフラグ
- 高速アクセスのためのローカルAPI - CLI/ENVフラグ
- 悪意あるアクターのJSONを中央ロケーションにPOSTするWebHook - CLI/ENVフラグ
- SentryPeerHQとのOAuth2ベアラートークンによる統合
- 悪意あるアクターのIPアドレスを照会するAPI
- 悪意あるアクターのIPSETを照会するAPI
- 特定の悪意あるアクターのIPアドレスを照会するAPI
- 悪意あるアクターによって発信試行された電話番号を照会するAPI
- 特定の悪意あるアクターによって発信試行された電話番号を照会するAPI
- Fail2Banのサポート(
syslog経由、機能リクエストによる) - ローカルsqliteデータベース - 機能/CLIフラグ
- 分析 - オプトイン
- 外部アクセス用のSDK/ライブラリ - まずはCGRateS、またはnftablesを使った独自ファイアウォール
- IoT使用向けの小さなバイナリサイズ
- クロスプラットフォーム
- 分散データをリアルタイムで利用するファイアウォールオプション
- Docker Hubの最新ビルド上のコンテナ
- 収集したIPアドレスをブラックホール化するためのBGPピアエージェント(Team Cymru Bogon Router Server Projectと同様)
- SIPリダイレクトに対して404またはデフォルト送信先を返すSIPエージェント
講演
- ClueCon Weekly 2023 - https://www.youtube.com/watch?v=iuN_MtVfT6g
- UKNOF49 2022(プレゼンテーションスライド)- https://indico.uknof.org.uk/event/59/contributions/801/
- ClueCon Weekly 2022 - https://youtu.be/DFxGHJI_0Wg
- CommCon 2021 - https://2021.commcon.xyz/talks/sentrypeer-a-distributed-peer-to-peer-list-of-bad-ip-addresses-and-phone-numbers-collected-via-a-sip-honeypot
- TADSummit 2021 - https://blog.tadsummit.com/2021/11/17/sentrypeer/
採用
- Kali Linux
- ドイツテレコム T-Pot - オールインワンハニーポットプラットフォーム v22以降
デザイン
このプロジェクトを始めたのは、日頃使っているプロジェクトがすべてC言語(PostgreSQL、OpenLDAP、FreeSWITCH、OpenSIPS、Asteriskなど)で書かれているため、Cネットワークプログラミングをやりたかったからです。なぜC言語が良い選択なのかは、エピソード414: Jens Gustedt on Modern Cを参照してください。興味のある方は、Software Engineering Radioの私の全ポッドキャスト番組リスト(https://www.se-radio.net/team/gavin-henry/)をご覧ください。
Docker
SentryPeerの最新バージョンはDockerで実行できます。最新バージョンはDocker Hubから入手できます。または自分でビルド:
sudo docker build --no-cache -t sentrypeer .
sudo docker run -d -p 5060:5060/tcp -p 5061:5061/tcp -p 5060:5060/udp -p 8082:8082 -p 4222:4222/udp sentrypeer:latest
その後、http://localhost:8082/ip-addressesとhttp://localhost:8082/health-checkにアクセスして、実行中かどうかを確認できます。
環境変数
ENV SENTRYPEER_CONFIG_FILE=/my/location/sentrypeer.toml
ENV SENTRYPEER_DB_FILE=/my/location/sentrypeer.db
ENV SENTRYPEER_API=1
ENV SENTRYPEER_WEBHOOK=1
ENV SENTRYPEER_WEBHOOK_URL=https://my.webhook.url/events
ENV SENTRYPEER_OAUTH2_CLIENT_ID=1234567890
ENV SENTRYPEER_OAUTH2_CLIENT_SECRET=1234567890
ENV SENTRYPEER_SIP_RESPONSIVE=1
ENV SENTRYPEER_SIP_DISABLE=1
ENV SENTRYPEER_SYSLOG=1
ENV SENTRYPEER_PEER_TO_PEER=1
ENV SENTRYPEER_BOOTSTRAP_NODE=mybootstrapnode.com
ENV SENTRYPEER_JSON_LOG=1
ENV SENTRYPEER_JSON_LOG_FILE=/my/location/sentrypeer_json.log
ENV SENTRYPEER_VERBOSE=1
ENV SENTRYPEER_DEBUG=1
ENV SENTRYPEER_CERT=/my/location/sentrypeer-crt.pem
ENV SENTRYPEER_KEY=/my/location/sentrypeer-key.pem
ENV SENTRYPEER_TLS_LISTEN_ADDRESS=0.0.0.0:5061
これらはDockerfile、またはDockerfile.envファイル、あるいはdocker runコマンドで設定してください。
これらのいずれかを0に設定しても、機能は_有効_になります。設定値が何であれ、設定されていれば_問題ありません_。
設定ファイル
設定ファイルを使用して特定の設定を行うこともできます。主に以下のTLS設定です。デフォルトの場所は~/.config/sentrypeer/default-config.tomlですが、SENTRYPEER_CONFIG_FILE環境変数または-g CLIオプションで変更できます。
TLS設定
独自の証明書を使用するには、適切な環境変数、CLI引数を設定するか、設定ファイルを使用します。例:
cat ~/.config/sentrypeer/default-config.toml
cert = "tests/unit_tests/127.0.0.1.pem"
key = "tests/unit_tests/127.0.0.1-key.pem"
tls_listen_address = "0.0.0.0:5061"
```
これらを設定しない場合、sentrypeerを実行したディレクトリに自動的に `cert.pem` と `key.pem` ファイルが生成されます。
### インストール
Debian または Fedora のパッケージは、SentryPeer の現在のバージョンのリリースページから常に入手できます:
https://github.com/SentryPeer/SentryPeer/releases
#### Homebrew (macOS または Linux):
このプロジェクト用の [Homebrew Tap](https://github.com/SentryPeer/homebrew-sentrypeer) があります (もっと普及するまでは):
brew tap sentrypeer/sentrypeer
brew install sentrypeer
#### Alpine Linux:
SentryPeer は [Alpine Linux の testing リポジトリ](https://gitlab.alpinelinux.org/alpine/aports/-/tree/master/testing/sentrypeer) にあります。以下のコマンドでインストールできます:
apk -U add --no-cache -X https://dl-cdn.alpinelinux.org/alpine/edge/testing sentrypeer
#### Ubuntu パッケージ
SentryPeer は [Ubuntu PPD](https://launchpad.net/~gavinhenry/+archive/ubuntu/sentrypeer) からインストールできます。現在は Ubuntu 20 LTS (Focal Fossa) に対応しています:
sudo apt install software-properties-common
sudo add-apt-repository ppa:gavinhenry/sentrypeer
sudo apt-get update
この PPA は、以下の行をコピーしてシステムのソフトウェアソースに追加することで手動で追加できます:
deb https://ppa.launchpadcontent.net/gavinhenry/sentrypeer/ubuntu focal main
deb-src https://ppa.launchpadcontent.net/gavinhenry/sentrypeer/ubuntu focal main
その後、SentryPeer をインストールします:
sudo apt-get install sentrypeer
#### ソースからのビルド
ソースからのインストールには2つの選択肢があります。CMake または autotools です。現時点では autotools が推奨されます。リリースは autotools ビルドです。
Fedora ユーザーの場合、[Fedora copr](https://copr.fedorainfracloud.org/coprs/) からインストールできます:
[https://copr.fedorainfracloud.org/coprs/ghenry/SentryPeer/](https://copr.fedorainfracloud.org/coprs/ghenry/SentryPeer/)
このリポジトリからビルドする場合、以下がインストールされている必要があります:
- `git`, `autoconf`, `automake` および `autoconf-archive` (Debian/Ubuntu)
- `libtool`, `rustc` および `cargo` (Fedora)
- `libosip2-dev` (Debian/Ubuntu) または `libosip2-devel` (Fedora)
- `libsqlite3-dev` (Debian/Ubuntu) または `sqlite-devel` (Fedora)
- `uuid-dev` (Debian/Ubuntu) または `libuuid-devel` (Fedora)
- `libmicrohttpd-dev` (Debian/Ubuntu) または `libmicrohttpd-devel` (Fedora)
- `libjansson-dev` (Debian/Ubuntu) または `jansson-devel` (Fedora)
- `libpcre2-dev` (Debian/Ubuntu) または `pcre2-devel` (Fedora)
- `libcurl-dev` (Debian/Ubuntu) または `libcurl-devel` (Fedora)
- `libcmocka-dev` (Debian/Ubuntu) または `libcmocka-devel` (Fedora) - ユニットテスト用
Debian/Ubuntu:
sudo apt-get install git build-essential clang autoconf-archive autoconf \
automake libtool cmake libosip2-dev libsqlite3-dev libcmocka-dev uuid-dev \
libcurl4-openssl-dev libpcre2-dev libjansson-dev libmicrohttpd-dev libclang-dev
Fedora:
sudo dnf install git clang pkg-config autoconf automake autoconf-archive \
libtool libosip2-devel libsqlite3-devel libcmocka-devel libuuid-devel \
libmicrohttpd-devel jansson-devel libcurl-devel pcre2-devel cmake \
clang-libs clang
macOS:
brew install git libtool autoconf automake autoconf-archive libosip cmocka \
libmicrohttpd jansson curl pcre2 pkg-config opendht ossp-uuid cmake
Rust:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
その後 (make check を強く推奨します):
./bootstrap.sh
./configure
make
make check
make install
CMake:
cmake -S . -B build -DUNIT_TESTING=ON
cmake --build build
ctest --test-dir build
cmake --install build
### SentryPeer の実行
ビルド後、次のように実行して **デバッグモード** で起動し、SIP プローブに **応答** し、**RESTful API**、WebHooks を有効にし、syslog ログを有効にできます ([systemd](https://www.freedesktop.org/wiki/Software/systemd/) を使用したい場合は[パッケージ](https://github.com/SentryPeer/SentryPeer/releases) を使用してください):
./sentrypeer -draps
SentryPeer node id: e5ac3a88-3d52-4e84-b70c-b2ce83992d02
Starting sentrypeer...
API mode enabled, starting http daemon...
SIP mode enabled...
Peer to Peer DHT mode enabled...
Starting peer to peer DHT mode using OpenDHT-C lib version '2.4.0'...
Configuring local address...
Creating sockets...
Binding sockets to local address...
Listening for incoming UDP connections...
SIP responsive mode enabled. Will reply to SIP probes...
Listening for incoming TCP connections...
Peer to peer DHT mode started.
DHT InfoHash for key 'bad_actors' is: 14d30143330e2e0e922ed4028a60ff96a59800ad
Bootstrapping the DHT
Waiting 5 seconds for bootstrapping to bootstrap.sentrypeer.org...
Listening for changes to the bad_actors DHT key
プローブリクエストを受信すると、ターミナルに次のような出力が表示されます:```bash
Received (411 bytes): OPTIONS sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 91.223.3.152:5173;branch=z9hG4bK-515761064;rport
Content-Length: 0
From: "sipvicious"<sip:[email protected]>;tag=6434396633623535313363340131363131333837383137
Accept: application/sdp
User-Agent: friendly-scanner
To: "sipvicious"<sip:[email protected]>
Contact: sip:[email protected]:5173
CSeq: 1 OPTIONS
Call-ID: 679894155883566215079442
Max-Forwards: 70
read_packet_buf size is: 1024:
read_packet_buf length is: 468:
bytes_received size is: 411:
Bad Actor is:
Event Timestamp: 2021-11-23 20:13:36.427515810
Event UUID: fac3fa20-8c2c-445b-8661-50a70fa9e873
SIP Message: OPTIONS sip:[email protected] SIP/2.0
Via: SIP/2.0/UDP 91.223.3.152:5173;branch=z9hG4bK-515761064;rport
From: "sipvicious" <sip:[email protected]>;tag=6434396633623535313363340131363131333837383137
To: "sipvicious" <sip:[email protected]>
Call-ID: 679894155883566215079442
CSeq: 1 OPTIONS
Contact: <sip:[email protected]:5173>
Accept: application/sdp
User-agent: friendly-scanner
Max-forwards: 70
Content-Length: 0
Source IP: 193.107.216.27
Called Number: 100
SIP Method: OPTIONS
Transport Type: UDP
User Agent: friendly-scanner
Collected Method: responsive
Created by Node Id: fac3fa20-8c2c-445b-8661-50a70fa9e873
SentryPeer db file location is: sentrypeer.db
Destination IP address of UDP packet is: xx.xx.xx.xx
```
You can see the data in the sqlite3 database called `sentrypeer.db` using [sqlitebrowser](https://sqlitebrowser.org/) or sqlite3 command line tool.
Here's a screenshot of the database opened using [sqlitebrowser](https://sqlitebrowser.org/) (it's big, so I'll just link to the image):
[sqlitebrowser exploring the sentrypeer.db](https://github.com/sentrypeer/sentrypeer/blob/HEAD/screenshots/SentryPeer-sqlitebrowser.png)
### WebHook
There is a WebHook to POST a [JSON Log Format](#json-log-format) payload to [SentryPeerHQ](https://github.com/SentryPeer/SentryPeerHQ) or
your own WebHook endpoint. The WebHook is **not** enabled by default. You can configure the WebHook URL via `-w` or set
the `SENTRYPEER_WEBHOOK_URL` env variable.
If using [SentryPeer SaaS](https://sentrypeer.com) you need to get your client id and client secret from the
Dashboard and set the `SENTRYPEER_OAUTH2_CLIENT_ID` and `SENTRYPEER_OAUTH2_CLIENT_SECRET` env variables or use the `-i` and `-c` flags.
### RESTful API
The RESTful API is complete for the current use cases. Please click the Watch button to be notified when more things come out :-)
#### Endpoint /health-check
Query the API to see if it's alive:```bash
curl -v -H "Content-Type: application/json" http://localhost:8082/health-check
* Connected to localhost (127.0.0.1) port 8082 (#0)
> GET /health-check HTTP/1.1
> Host: localhost:8082
> User-Agent: curl/7.79.1
> Accept: */*
> Content-Type: application/json
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Date: Mon, 24 Apr 2022 11:16:25 GMT
< Content-Type: application/json
< Access-Control-Allow-Origin: *
< X-Powered-By: SentryPeer
< X-SentryPeer-Version: 1.4.0
< Content-Length: 81
<
{
"status": "OK",
"message": "Hello from SentryPeer!",
"version": "1.0.0"
}
```
#### Endpoint /ip-addresses
SentryPeer によって確認されたすべての IP アドレスを一覧表示します:```bash
curl -v -H "Content-Type: application/json" http://localhost:8082/ip-addresses
* Connected to localhost (127.0.0.1) port 8082 (#0)
> GET /ip-addresses HTTP/1.1
> Host: localhost:8082
> User-Agent: curl/7.79.1
> Accept: */*
> Content-Type: application/json
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Date: Mon, 24 Jan 2022 11:17:05 GMT
< Content-Type: application/json
< Access-Control-Allow-Origin: *
< X-Powered-By: SentryPeer
< X-SentryPeer-Version: 1.0.0
< Content-Length: 50175
<
{
"ip_addresses_total": 396,
"ip_addresses": [
{
"ip_address": "193.107.216.27",
"seen_last": "2022-01-11 13:30:48.703603359",
"seen_count": "1263"
},
{
"ip_address": "193.46.255.152"
"seen_last": "2022-01-11 13:28:27.348926406",
"seen_count": "3220"
}
...
]
}
```
#### エンドポイント /ip-addresses/{ip-address}
単一のIPアドレスをクエリする:```bash
curl -v -H "Content-Type: application/json" http://localhost:8082/ip-addresses/8.8.8.8
* Connected to localhost (127.0.0.1) port 8082 (#0)
> GET /ip-addresses/8.8.8.8 HTTP/1.1
> Host: localhost:8082
> User-Agent: curl/7.79.1
> Accept: */*
> Content-Type: application/json
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Not Found
< Date: Mon, 24 Jan 2022 11:17:57 GMT
< Content-Type: application/json
< Access-Control-Allow-Origin: *
< X-Powered-By: SentryPeer
< X-SentryPeer-Version: 1.0.0
< Content-Length: 33
<
* Connection #0 to host localhost left intact
{
"message": "No bad actor found"
}
```
#### エンドポイント /numbers
SentryPeerによって確認されたすべての着信番号を一覧表示します:```bash
curl -v -H "Content-Type: application/json" http://localhost:8082/numbers
* Connected to localhost (127.0.0.1) port 8082 (#0)
> GET /numbers HTTP/1.1
> Host: localhost:8082
> User-Agent: curl/8.0.1
> Accept: */*
> Content-Type: application/json
< Date: Thu, 27 Jul 2023 11:10:35 GMT
< Content-Type: application/json
< Access-Control-Allow-Origin: *
< X-Powered-By: SentryPeer
< X-SentryPeer-Version: 4.0.0
< Content-Length: 31746258
{
"called_numbers_total": 244850,
"called_numbers": [
{
"called_number": "981046500729221",
"seen_last": "2023-07-27 12:06:59.388055505",
"seen_count": "451"
},
{
"called_number": "81046500729221",
"seen_last": "2023-07-27 12:05:19.206442003",
"seen_count": "453"
},
{
"called_number": "100",
"seen_last": "2023-07-27 11:59:57.679798597",
"seen_count": "17335"
},
....
```
#### Endpoint /numbers/{phone-number}
オプションの `+` プレフィックスを付けて、悪意のあるアクターが発信しようとした電話番号を照会します:```bash
curl -v -H "Content-Type: application/json" http://localhost:8082/numbers/8784946812410967
* Connected to localhost (127.0.0.1) port 8082 (#0)
> GET /numbers/8784946812410967 HTTP/1.1
> Host: localhost:8082
> User-Agent: curl/7.79.1
> Accept: */*
> Content-Type: application/json
>
< HTTP/1.1 200 OK
< Date: Mon, 24 Jan 2022 11:19:53 GMT
< Content-Type: application/json
< Access-Control-Allow-Origin: *
< X-Powered-By: SentryPeer
< X-SentryPeer-Version: 1.0.0
< Content-Length: 46
<
{
"phone_number_found": "8784946812410967"
}
```
### SyslogとFail2ban
`sentrypeer -s` を使用して、syslogを解析し、Fail2Banで悪意のあるアクターのIPアドレスをブロックします:```syslog
Nov 30 21:32:16 localhost.localdomain sentrypeer[303741]: Source IP: 144.21.55.36, Method: OPTIONS, Agent: sipsak 0.9.7
```
### JSONログ形式
`sentrypeer -j`を使用すると、悪意のあるアクターのIPアドレスと、そのアクターが発信しようとした電話番号に加え、その他のメタデータを含むJSONログファイルを生成できます。(`-l`でカスタムログファイルの場所を設定できます):```json
{
"app_name":"sentrypeer",
"app_version":"v1.4.0",
"event_timestamp":"2022-02-22 11:19:15.848934346",
"event_uuid":"4503cc92-26cb-4b3e-bb33-69a83fa09321",
"created_by_node_id":"4503cc92-26cb-4b3e-bb33-69a83fa09321",
"collected_method":"responsive",
"transport_type":"UDP",
"source_ip":"45.134.144.128",
"destination_ip":"XX.XX.XX.XX",
"called_number":"0046812118532",
"sip_method":"OPTIONS",
"sip_user_agent":"friendly-scanner",
"sip_message":"full SIP message"
}
```
### コマンドラインオプション```bash
./sentrypeer -h
Protect your SIP Servers from bad actors at https://sentrypeer.com
Usage: sentrypeer [OPTIONS]
Options:
-f <DB_FILE> Set 'sentrypeer.db' location or use SENTRYPEER_DB_FILE env
-j Enable json logging or use SENTRYPEER_JSON_LOG env
-p Enable Peer to Peer mode or use SENTRYPEER_PEER_TO_PEER env
-b <BOOTSTRAP_NODE> Set Peer to Peer bootstrap node or use SENTRYPEER_BOOTSTRAP_NODE env
-i <CLIENT_ID> Set OAuth 2 client ID or use SENTRYPEER_OAUTH2_CLIENT_ID env to get a Bearer token for WebHook
-c <CLIENT_SECRET> Set OAuth 2 client secret or use SENTRYPEER_OAUTH2_CLIENT_SECRET env to get a Bearer token for WebHook
-a Enable RESTful API mode or use SENTRYPEER_API env
-w <WEBHOOK_URL> Set WebHook URL for bad actor json POSTs or use SENTRYPEER_WEBHOOK_URL env
-r Enable SIP responsive mode or use SENTRYPEER_SIP_RESPONSIVE env
-R Disable SIP mode completely or use SENTRYPEER_SIP_DISABLE env
-l <JSON_LOG_FILE> Set JSON logfile (default './sentrypeer_json.log') location or use SENTRYPEER_JSON_LOG_FILE env
-N Disable Rust powered TCP, UDP and TLS or use SENTRYPEER_TLS_DISABLE env
-t <TLS_CERT_FILE> Set TLS cert location (default './cert.pem') or use SENTRYPEER_CERT env
-k <TLS_KEY_FILE> Set TLS key location (default './key.pem') or use SENTRYPEER_KEY env
-z <TLS_LISTEN_ADDRESS> Set TLS listen address (default '0.0.0.0:5061') or use SENTRYPEER_TLS_LISTEN_ADDRESS env
-g <CONFIG_FILE> Set config file location or use SENTRYPEER_CONFIG_FILE env
-s Enable syslog logging or use SENTRYPEER_SYSLOG env
-v Enable verbose logging or use SENTRYPEER_VERBOSE env
-d Enable debug mode or use SENTRYPEER_DEBUG env
-h, --help Print help
-V, --version Print version
```
### IPv6 マルチキャストアドレス
このプロジェクトは、SentryPeer ピア間でメッセージを送信するための IANA IPv6 マルチキャストアドレスを持っています。
Addresses: FF0X:0:0:0:0:0:0:172
Description: SentryPeer
Contact: Gavin Henry <ghenry at sentrypeer.org>
Registration Date: 2022-01-26
詳細は http://www.iana.org/assignments/ipv6-multicast-addresses を参照してください。
割り当てられた可変スコープアドレス(短縮形として "FF0X::172" とも表記されます)の "X" は任意のスコープを示します。
### ライセンス
参考資料 - [自作のライセンス選び方](https://www.gnu.org/licenses/license-recommendations.en.html)
この作品は GPL 2.0 および GPL 3.0 のデュアルライセンスです。
`SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only`
### 貢献
[CONTRIBUTING](https://github.com/sentrypeer/sentrypeer/blob/HEAD/CONTRIBUTING.md) を参照してください。
### プロジェクトウェブサイト
https://sentrypeer.org
### 商標
[**SENTRYPEER** は Gavin Henry の登録商標です](https://trademarks.ipo.gov.uk/ipo-tmcase/page/Results/1/UK00003700947)
### 質問、バグ報告、機能リクエスト
新しい課題は以下で報告できます:
https://github.com/SentryPeer/SentryPeer/issues
質問のために課題を報告しても構いません。
### 特別な感謝
特に感謝します:
- [Deutsche Telekom Security GmbH](https://github.com/telekom-security) スポンサーになってくれてありがとう!
- [psanders](https://github.com/psanders)([Routr](https://github.com/fonoster/routr) プロジェクト) [この README.md ファイルの再編集に関するヒント](https://mobile.twitter.com/pedrosanders_/status/1554572884714070019) を提供してくれてありがとう。
- [Fly.io](https://fly.io) SentryPeer アカウントにクレジットを与え、[SentryPeer HQ ウェブアプリ](https://sentrypeer.com) をインフラ上でホスティングしてくれています。
- [AppSignal](https://www.appsignal.com/) [SentryPeer HQ ウェブアプリ](https://sentrypeer.com) におけるアプリケーションパフォーマンスモニタリングスポンサーシップ。
- [David Miller](http://davidmiller.io/) SentryPeer [Web GUI テーマ](https://github.com/sentrypeer/sentrypeer/blob/HEAD/web-gui-theme) と [ロゴ](https://github.com/sentrypeer/sentrypeer/blob/HEAD/web-gui-theme/src/assets/logo.svg) のデザイン。本当にありがとう!
- [@garymiller](https://github.com/garyemiller) syslog と Fail2ban の機能リクエスト([Fail2ban Integration via syslog #6](https://github.com/SentryPeer/SentryPeer/issues/6))をしてくれてありがとう。
- [@joejag](https://github.com/joejag) [プルリクエスト](https://github.com/SentryPeer/SentryPeer/pull/19)([Terraform recipes to launch SentryPeer on different cloud providers #12](https://github.com/SentryPeer/SentryPeer/issues/12) の開始)をしてくれてありがとう。
### スポンサーシップ
特に [Deutsche Telekom Security GmbH](https://github.com/telekom-security) に感謝します!スポンサーになってくれてありがとう!本当に親切です!