This product is not supported for your selected Datadog site. ().

Datadog の nginx トレーシング モジュールは、脅威の検知とブロックを実験的にサポートしています。

Application & API Protection の有効化

はじめに

  1. nginx のビルドが --with-threads フラグ付きでコンパイルされていることを確認してください。多くのディストリビューションでは、このフラグは既定で有効になっています。 nginx のインストールがスレッド対応でビルドされているか確認するには、コマンド nginx -V を実行し、出力の configure arguments 行を確認します。出力に --with-threads が見当たらない場合は、このフラグを有効にして nginx を再ビルドする必要があります。 ソースから nginx をビルドする方法の詳細は、 nginx ドキュメント を参照してください。

  2. 少なくともバージョン 1.2.0 以上に nginx トレーシング ライブラリ モジュールを更新 してください。 GitHub リリース ページ を開き、 “ngx_http_datadog_module-appsec-<amd64/arm64>-<nginx version>.so.tgz” という命名パターンのアーティファクトを選択します。このアーティファクト名には “appsec” が含まれます。

  3. nginx 設定で Application & API Protection を有効化 してください。 次の対応が必要です:

    • thread_pool ディレクティブで、1 つ以上のスレッド プールを定義する
    • datadog_appsec_enabled で、Application & API Protection を明示的に有効化する
    • datadog_waf_thread_pool_name ディレクティブで、 リクエストを定義したスレッド プールに割り当てる

    例:

    load_module /path/to/ngx_http_datadog_module.so;
    thread_pool waf_thread_pool threads=4 max_queue=128;
    http {
      datadog_appsec_enabled on;
      datadog_waf_thread_pool_name waf_thread_pool;
    }
    

    詳細は リファレンス ドキュメント を参照してください。

    After this configuration is complete, the library collects security data from your application and sends it to the Agent. The Agent sends the data to Datadog, where out-of-the-box detection rules flag attacker techniques and potential misconfigurations so you can take steps to remediate.

  4. To see App and API Protection threat detection in action, send known attack patterns to your application. For example, trigger the Security Scanner Detected rule by running a file that contains the following curl script:

    for ((i=1;i<=250;i++)); 
    do
    # Target existing service's routes
    curl https://your-application-url/existing-route -A dd-test-scanner-log;
    # Target non existing service's routes
    curl https://your-application-url/non-existing-route -A dd-test-scanner-log;
    done

    Note: The dd-test-scanner-log value is supported in the most recent releases.

    A few minutes after you enable your application and send known attack patterns to it, threat information appears in the Application Signals Explorer and vulnerability information appears in the Vulnerabilities explorer.

制限

バージョン 1.3.0 時点では、利用できる機能に次の重要な制約があります:

  • リクエスト本文は、コンテンツタイプに関係なく検査されません。

  • ステータス コード、ヘッダー、ボディなど、レスポンスの特性に基づいて リクエストをブロックすることはできません。

参考資料