- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
With Application Security Management (ASM) enabled, the Datadog tracing library actively monitors all web services and API requests for suspicious security activity.
An In-App WAF rule specifies conditions on the incoming request to define what the library considers suspicious. The Datadog tracing library includes hundreds of out-of-the-box ASM In-App WAF rules, which are used to display security traces in the trace explorer and in the default signal rules.
You can add to the In-App WAF rules without upgrading the tracing library.
An In-App WAF rule is a JSON object composed of a category, a name, tags, and conditions. When a security trace is detected, tags from the rules are propagated onto the security trace, and can be used to build detection rules.
Conditions define when the rule tags an incoming request. The conditions are composed of inputs and operators.
An input represents which part of the request the operator is applied to. The following inputs are used in the In-App WAF rules:
Name | Description | Example |
---|---|---|
server.request.uri.raw | The full request URI received by the application service | https://my.api.com/users/1234/roles?clientId=234 |
server.request.path_params | The parsed path parameters (key/value map) | userId => 1234 |
server.request.query | The parsed query parameters (key/value map) | clientId => 234 |
server.request.headers.no_cookies | The incoming http requests headers, excluding the cookie header (key/value map) | user-agent => Zgrab, referer => google.com |
grpc.server.request.message | The parsed gRPC message (key/value map) | data.items[0] => value0, data.items[1] => value1 |
server.request.body | The parsed HTTP body (key/value map) | data.items[0] => value0, data.items[1] => value1 |
server.response.status | The http status code | 200 |
name | Description |
---|---|
match_regex | Perform regular expression match on the inputs |
phrase_match | Perform a fast keyword list matching |
is_xss | Special operator to check for cross-site scripting (XSS) payloads |
is_sqli | Special operator to check for SQL injection (SQLI) payloads |
Custom in-app WAF rules enable users to log or block specific types of requests to their applications. For example, you can use custom rules to monitor login success or failure. To get started, navigate to Security -> Application Security -> Protection -> In-App WAF -> Custom Rules.
Note: Default rules in in-app WAF are read-only. To refine your in-app WAF behavior, modify the in-app WAF rules. Default rules cannot be modified, however, you can create a custom rule based on one of the default rules, and modify the match conditions to your needs. Be sure to disable the default rule so that you don’t have two similar rules evaluating the same requests.
Blocking on a service is defined through the policy rules. Three Datadog default policies are included in the in-app WAF: Datadog Recommended, Datadog Monitoring-only, which monitors attacks only, and Datadog Block Attack tools, which blocks attack tools and monitors all other attacks.
Services using a policy are visible directly in the policy management page.
In Datadog, navigate to Security > Application Security > Protection > In-App WAF.
Click on the three dots to the right of one of the policies, and select Download Configuration of this Policy to download the configuration file to your local machine.
Optionally, select Apply this Policy to Services to apply a default policy to one or more of your protection enabled ASM services.
Note: A policy can be applied to one or more services, but a service can only contain one policy.
Update the file to include the JSON definition of your new rule, following the specification above. For example:
{
"id": "id-123",
"name": "My In-App WAF rule",
"tags": {
"category": "attack_attempt",
"crs_id": "920260",
"type": "http_protocol_violation"
},
"conditions": [
{
"operator": "match_regex",
"parameters": {
"inputs": [
{
"address": "server.request.uri.raw"
}
],
"options": {
"case_sensitive": true,
"min_length": 6
},
"regex": "\\%u[fF]{2}[0-9a-fA-F]{2}"
}
}
],
"transformers": []
},
Using a utility such as SCP or FTP, copy the appsec-rules.json
file to your application server, for example, /home/asm/appsec-rules.json
.
Following the instructions in Enabling ASM for adding application variables in your environment, add the DD_APPSEC_RULES
environment variable to your service with the full path to the file:
DD_APPSEC_RULES=/home/asm/appsec-rules.json
Restart your service.
Next, configure detection rules to create security signals based on those security traces defined by the In-App WAF rules you created. You can modify the provided out-of-the-box ASM detection rules or create new ones.