- 重要な情報
- はじめに
- 用語集
- エージェント
- インテグレーション
- OpenTelemetry
- 開発者
- API
- CoScreen
- アプリ内
- インフラストラクチャー
- アプリケーションパフォーマンス
- 継続的インテグレーション
- ログ管理
- セキュリティ
- UX モニタリング
- 管理
Docker、Kubernetes、AWS ECS、AWS Fargate で動作する .NET アプリのアプリケーションセキュリティを監視することができます。
In general, setting up Application Security Management (ASM) involves:
DD_APPSEC_ENABLED=true
or --enable-appsec
flags.Datadog .NET ライブラリを、ターゲット OS アーキテクチャのバージョン 2.2.0 以上 (Application Vulnerability Management の脆弱性検出機能についてはバージョン 2.16.0 以上) に更新してください。
サービスの言語やフレームワークのバージョンが ASM 機能に対応しているかどうかは、互換性をご参照ください。
環境変数 DD_APPSEC_ENABLED
を true
に設定し、ASM を有効化します。例えば、Windows のセルフホストでは、アプリケーションの起動スクリプトの一部として、次の PowerShell スニペットを実行します。
$target=[System.EnvironmentVariableTarget]::Process
[System.Environment]::SetEnvironmentVariable("DD_APPSEC_ENABLED","true",$target)
またはアプリケーションの実行場所に応じて、以下の方法のいずれかを選択します。
Windows コンソールで:
rem Set environment variables
SET CORECLR_ENABLE_PROFILING=1
SET CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
SET DD_APPSEC_ENABLED=true
rem Start application
dotnet.exe example.dll
管理者として以下の PowerShell コマンドを実行し、レジストリ HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment
に必要な環境変数を構成して、IIS を再起動します。
$target=[System.EnvironmentVariableTarget]::Machine
[System.Environment]::SetEnvironmentVariable("DD_APPSEC_ENABLED","true",$target)
net stop was /y
net start w3svc
または、IIS サービスのみの場合、Powershell がある WAS と W3SVC で管理者権限で以下を実行します。
$appsecPart = "DD_APPSEC_ENABLED=true"
[string[]] $defaultvariable = @("CORECLR_ENABLE_PROFILING=1", "CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}", $appsecPart)
function Add-AppSec {
param (
$path
)
$v = (Get-ItemProperty -Path $path).Environment
If ($v -eq $null) {
Set-ItemProperty -Path $path -Name "Environment" -Value $defaultvariable
}
ElseIf (-not ($v -match $appsecPart)) {
$v += " " + $appsecPart;
Set-ItemProperty -Path $path -Name "Environment" -Value $v
}
}
Add-AppSec -path "HKLM:SYSTEM\CurrentControlSet\Services\WAS\"
Add-AppSec -path "HKLM:SYSTEM\CurrentControlSet\Services\W3SVC\"
net stop was /y
net start w3svc
または、レジストリキーの編集を避けるため、アプリケーションの設定を web.config
ファイルで編集します。
<configuration>
<appSettings>
<add key="DD_APPSEC_ENABLED" value="true"/>
</appSettings>
</configuration>
これは、IIS アプリケーションプールレベルで、applicationHost.config
ファイル (通常、C:\Windows\System32\inetsrv\config\
にあります) で行うこともできます。
<system.applicationHost>
<applicationPools>
<add name="DefaultAppPool">
<environmentVariables>
<add name="DD_APPSEC_ENABLED" value="true" />
</environmentVariables>
(...)
アプリケーションの構成に以下を追加します。
DD_APPSEC_ENABLED=true
APM 用の構成コンテナを更新するには、docker run
コマンドに以下の引数を追加します。
docker run [...] -e DD_APPSEC_ENABLED=true [...]
コンテナの Dockerfile に以下の環境変数の値を追加します。
ENV DD_APPSEC_ENABLED=true
APM 用のデプロイメント構成ファイルを更新し、ASM 環境変数を追加します。
spec:
template:
spec:
containers:
- name: <CONTAINER_NAME>
image: <CONTAINER_IMAGE>/<TAG>
env:
- name: DD_APPSEC_ENABLED
value: "true"
以下を環境セクションに追加して、ECS タスク定義 JSON ファイルを更新します。
"environment": [
...,
{
"name": "DD_APPSEC_ENABLED",
"value": "true"
}
]
コンテナの Dockerfile に以下の行を追加します。
ENV DD_APPSEC_ENABLED=true
完全停止と起動を使用して、アプリケーションを再起動します。
After this configuration is complete, the library collects security data from your application and sends it to the Agent, which sends it to Datadog, where out-of-the-box detection rules flag attacker techniques and potential misconfigurations so you can take steps to remediate.
To see Application Security Management 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<=200;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 exercise it, threat information appears in the Application Signals Explorer and vulnerability information appears in the Vulnerability Explorer.