You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -65,6 +69,79 @@ These lines generate this field for all events containing a File sub-event, for
65
69
66
70
The rest of the file is copied verbatim from the template file (modulo the `raw` tags, see [Jinja 2 templates](#jinja2-templates)).
67
71
72
+
### Workload Protection Agent configuration
73
+
74
+
The Workload Protection Agent configuration documentation is based on the following files:
75
+
76
+
-`pkg/security/config/config.go` - the source code of the `RuntimeSecurityConfig` struct containing the settings documentation
77
+
-`pkg/security/generators/config_doc/main.go` - the Go generator that extracts public and warning settings into JSON
78
+
-`docs/cloud-workload-security/workload_protection_agent_config.schema.json` - the JSON representing the documented settings extracted from the source code
79
+
-`tasks/libs/cws/templates/workload_protection_agent_config.md` - the Jinja2 template used for the final generation
80
+
-`tasks/libs/cws/config_doc_gen.py` - the Python script that renders the template
81
+
82
+
The generated markdown file is published on the documentation site at `/security/workload_protection/workload_protection_agent_config`. It is pulled from this repository during the documentation build (see `pull_config.yaml` in the `documentation` repository), the same way as `linux_expressions.md`.
83
+
84
+
#### Editing files
85
+
86
+
Documented settings are defined as comments on fields of the `RuntimeSecurityConfig` struct in `pkg/security/config/config.go`.
87
+
88
+
Supported comment keys:
89
+
90
+
| Key | Required | Description |
91
+
| --- | --- | --- |
92
+
|`description`| yes | Human-readable description of the setting |
93
+
|`visibility`| yes |`public`, `warning`, or `private`|
94
+
|`default_value`| recommended | Default value displayed in the documentation |
95
+
|`config_key`| no | Override for the YAML key when it cannot be inferred from `NewRuntimeSecurityConfig`|
96
+
97
+
The Go type is inferred from the struct field declaration. Settings with `visibility: public` are included in the main `system-probe` table. Settings with `visibility: warning` are included in a separate **Advanced settings** table preceded by a disruption warning. Settings with `visibility: private` are omitted from the generated documentation.
98
+
99
+
The `config_key` is automatically inferred from `NewRuntimeSecurityConfig` (and helper functions returning a config key) when possible.
100
+
101
+
The environment variable name is automatically inferred from the `config_key` using the same convention as the Agent config (`DD_` prefix, uppercase, `.` replaced by `_`). For example, `runtime_security_config.hash_resolver.max_file_size` becomes `DD_RUNTIME_SECURITY_CONFIG_HASH_RESOLVER_MAX_FILE_SIZE`.
102
+
103
+
For example, the following comments on the `RuntimeEnabled` field in `config.go`:
104
+
105
+
```go
106
+
// description: Defines if the runtime security module should be enabled
`cws_docs` regenerates all CWS markdown files, including `workload_protection_agent_config.md`, from their committed JSON schemas.
144
+
68
145
### Backend event
69
146
70
147
The Cloud Workload Security (CWS) part of the Agent sends events to the backend. Those events conform to a JSON schema (this is tested in functional tests of the Agent). This documentation is based on the following files:
text: "Get started with Datadog Workload Protection"
9
+
---
10
+
11
+
<!-- THIS FILE IS AUTOGENERATED. PLEASE EDIT THE FILE IN THE SCRIPTS/TEMPLATES FOLDER -->
12
+
13
+
The Workload Protection Agent has several configuration knobs that can be used to tweak the agent and its behavior. You'll find below the list of available parameters for both `system-probe` and the `security-agent`, two components that are required for Workload Protection to function properly.
14
+
<divclass="alert alert-info">Parameters can be provided in 2 different manners: through environment variables (given to the Datadog Agent container for example) or by editing the <code>/etc/datadog-agent/security-agent.yaml</code> configuration file.</div>
15
+
16
+
17
+
## `security-agent` configuration parameters
18
+
<divclass="alert alert-warning">From <code>7.77</code>, the security-agent runtime for CWS is effectively deprecated: it is not used anymore and this section can be ignored.</div>
|`DD_RUNTIME_SECURITY_CONFIG_ENABLED`|`runtime_security_config.enabled`| bool | false | Defines if the runtime security module should be enabled |
31
+
|`DD_RUNTIME_SECURITY_CONFIG_HASH_RESOLVER_CACHE_SIZE`|`runtime_security_config.hash_resolver.cache_size`| int | 500 | HashResolverCacheSize defines the number of hashes to keep in cache |
32
+
|`DD_RUNTIME_SECURITY_CONFIG_HASH_RESOLVER_EVENT_TYPES`|`runtime_security_config.hash_resolver.event_types`|[]model.EventType |["exec", "open"]| HashResolverEventTypes defines the list of event which files may be hashed |
33
+
|`DD_RUNTIME_SECURITY_CONFIG_HASH_RESOLVER_HASH_ALGORITHMS`|`runtime_security_config.hash_resolver.hash_algorithms`|[]model.HashAlgorithm |["sha1", "sha256", "ssdeep"]| HashResolverHashAlgorithms defines the hashes that hash resolver needs to compute |
34
+
|`DD_RUNTIME_SECURITY_CONFIG_HASH_RESOLVER_MAX_FILE_SIZE`|`runtime_security_config.hash_resolver.max_file_size`| int64 | 5242880 | HashResolverMaxFileSize defines the maximum size of the files that the hash resolver is allowed to hash |
35
+
|`DD_RUNTIME_SECURITY_CONFIG_HASH_RESOLVER_MAX_HASH_RATE`|`runtime_security_config.hash_resolver.max_hash_rate`| int | 500 | HashResolverMaxHashRate defines the rate at which the hash resolver may compute hashes |
36
+
|`DD_RUNTIME_SECURITY_CONFIG_HASH_RESOLVER_REPLACE`|`runtime_security_config.hash_resolver.replace`| map[string]string | {} | HashResolverReplace is used to apply specific hash to specific file path |
|`DD_RUNTIME_SECURITY_CONFIG_USER_SESSIONS_SSH_ENABLED`|`runtime_security_config.user_sessions.ssh.enabled`| bool | true | SSHUserSessionsEnabled defines if SSH user session features should be enabled |
39
+
40
+
## Advanced settings
41
+
42
+
<divclass="alert alert-warning">The following settings are exposed for advanced use cases. Changing them without understanding their impact can disrupt Workload Protection monitoring or alter agent behavior.</div>
0 commit comments