Skip to content

Commit 699346b

Browse files
committed
Adds Cloud Workfload Security agent configuration
1 parent 046bd4f commit 699346b

File tree

5 files changed

+49
-9
lines changed

5 files changed

+49
-9
lines changed

README.md

+14-9
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ To deploy the Datadog Agent on hosts, add the Datadog role and your API key to y
3838
|--------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
3939
| `datadog_api_key` | Your Datadog API key. |
4040
| `datadog_site` | The site of the Datadog intake to send Agent data to. Defaults to `datadoghq.com`, set to `datadoghq.eu` to send data to the EU site. This option is only available with Agent version >= 6.6.0. |
41-
| `datadog_agent_flavor` | Override the default Debian / Redhat Package for IOT Installations on RPI. Defaults to "datadog-agent" - use "datadog-iot-agent" for RPI. |
41+
| `datadog_agent_flavor` | Override the default Debian / Redhat Package for IOT Installations on RPI. Defaults to "datadog-agent" - use "datadog-iot-agent" for RPI.
4242
| `datadog_agent_version` | The pinned version of the Agent to install (optional, but recommended), for example: `7.16.0`. Setting `datadog_agent_major_version` is not needed if `datadog_agent_version` is used. **Note**: Downgrades are not supported on Windows platforms. |
4343
| `datadog_agent_major_version` | The major version of the Agent to install. The possible values are 5, 6, or 7 (default). If `datadog_agent_version` is set, it takes precedence otherwise the latest version of the specified major is installed. Setting `datadog_agent_major_version` is not needed if `datadog_agent_version` is used. |
4444
| `datadog_checks` | YAML configuration for Agent checks to drop into: <br> - `/etc/datadog-agent/conf.d/<check_name>.d/conf.yaml` for Agent v6 and v7, <br> - `/etc/dd-agent/conf.d` for Agent v5. |
@@ -173,7 +173,9 @@ The system probe is configured under the `system_probe_config` variable. Any var
173173

174174
[Network Performance Monitoring][7] (NPM) is configured under the `network_config` variable. Any variables nested underneath are written to the `system-probe.yaml`, in the `network_config` section.
175175

176-
**Note**: The system probe works on Linux with Agent v6+. NPM is supported on Windows with Agent v6.27+ and v7.27+.
176+
[Cloud Workload Security][8] is configured under the `runtime_security_config` variable. Any variables nested underneath are written to the `system-probe.yaml` and `security-agent.yaml`, in the `runtime_security_config` section.
177+
178+
**Note**: The system probe is supported on Linux with Agent v6+. NPM is supported on Windows with Agent v6.27+ and v7.27+. Cloud Workload Security is supported on Linux with Agent 6.27+/7.27+.
177179

178180
#### Example configuration
179181

@@ -187,17 +189,19 @@ system_probe_config:
187189
sysprobe_socket: /opt/datadog-agent/run/sysprobe.sock
188190
network_config:
189191
enabled: true
192+
runtime_security_config:
193+
enabled: true
190194
```
191195

192-
**Note**: This configuration works with Agent 6.24.1+ and 7.24.1+. For older Agent versions, refer to [the public documentation][8] on how to enable system-probe.
196+
**Note**: This configuration works with Agent 6.24.1+ and 7.24.1+. For older Agent versions, refer to [the public documentation][9] on how to enable system-probe.
193197

194198
On Linux, once this modification is complete, follow the steps below if you installed an Agent version older than 6.18.0 or 7.18.0:
195199

196200
1. Start the system-probe: `sudo service datadog-agent-sysprobe start` **Note**: If the service wrapper is not available on your system, run this command instead: `sudo initctl start datadog-agent-sysprobe`.
197-
2. [Restart the Agent][9]: `sudo service datadog-agent restart`.
201+
2. [Restart the Agent][10]: `sudo service datadog-agent restart`.
198202
3. Enable the system-probe to start on boot: `sudo service enable datadog-agent-sysprobe`.
199203

200-
For manual setup, refer to the [NPM][8] documentation.
204+
For manual setup, refer to the [NPM][9] documentation.
201205

202206
#### Agent v5
203207

@@ -530,7 +534,7 @@ If you are updating from **6.14.0 or 6.14.1 on Windows**, use the following step
530534
1. Upgrade the present `datadog.datadog` Ansible role to the latest version (`>=3.3.0`).
531535
2. Set the `datadog_agent_version` to `6.14.2` or above (defaults to latest).
532536

533-
For more details, see [Critical Bug in Uninstaller for Datadog Agent 6.14.0 and 6.14.1 on Windows][10].
537+
For more details, see [Critical Bug in Uninstaller for Datadog Agent 6.14.0 and 6.14.1 on Windows][11].
534538

535539
[1]: https://galaxy.ansible.com/Datadog/datadog
536540
[2]: https://github.com/DataDog/ansible-datadog
@@ -539,6 +543,7 @@ For more details, see [Critical Bug in Uninstaller for Datadog Agent 6.14.0 and
539543
[5]: https://github.com/DataDog/integrations-core
540544
[6]: https://docs.datadoghq.com/infrastructure/process/
541545
[7]: https://docs.datadoghq.com/network_performance_monitoring/
542-
[8]: https://docs.datadoghq.com/network_performance_monitoring/installation/?tab=agent#setup
543-
[9]: https://docs.datadoghq.com/agent/guide/agent-commands/#restart-the-agent
544-
[10]: https://app.datadoghq.com/help/agent_fix
546+
[8]: https://docs.datadoghq.com/security_platform/cloud_workload_security/getting_started/
547+
[9]: https://docs.datadoghq.com/network_performance_monitoring/installation/?tab=agent#setup
548+
[10]: https://docs.datadoghq.com/agent/guide/agent-commands/#restart-the-agent
549+
[11]: https://app.datadoghq.com/help/agent_fix

ci_test/install_agent_7.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
sysprobe_socket: /opt/datadog-agent/run/sysprobe.sock
2323
network_config:
2424
enabled: true
25+
runtime_security_config:
26+
enabled: true
2527
datadog_checks:
2628
process:
2729
init_config:

tasks/agent-linux.yml

+10
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,16 @@
172172
when: not datadog_skip_running_check and not datadog_enabled
173173
ignore_errors: yes # Since older versions of the Agent don't include the security agent
174174

175+
- name: Create security-agent configuration file
176+
template:
177+
src: security-agent.yaml.j2
178+
dest: /etc/datadog-agent/security-agent.yaml
179+
mode: 0640
180+
owner: "root"
181+
group: "{{ datadog_group }}"
182+
notify:
183+
"{% if datadog_before_7180 %}restart datadog-agent-sysprobe{% else %}restart datadog-agent{% endif %}"
184+
175185
- name: Create installation information file
176186
template:
177187
src: install_info.j2

templates/security-agent.yaml.j2

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Managed by Ansible
2+
3+
{% if runtime_security_config is defined and runtime_security_config | default({}, true) | length > 0 -%}
4+
runtime_security_config:
5+
{# The "first" option in indent() is only supported by jinja 2.10+
6+
while the old equivalent option "indentfirst" is removed in jinja 3.
7+
Using non-keyword argument in indent() to be backward compatible.
8+
#}
9+
{% filter indent(2, True) %}
10+
{{ runtime_security_config | to_nice_yaml }}
11+
{% endfilter %}
12+
{% endif %}

templates/system-probe.yaml.j2

+11
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,14 @@ network_config:
2121
{{ network_config | to_nice_yaml }}
2222
{% endfilter %}
2323
{% endif %}
24+
25+
{% if runtime_security_config is defined and runtime_security_config | default({}, true) | length > 0 -%}
26+
runtime_security_config:
27+
{# The "first" option in indent() is only supported by jinja 2.10+
28+
while the old equivalent option "indentfirst" is removed in jinja 3.
29+
Using non-keyword argument in indent() to be backward compatible.
30+
#}
31+
{% filter indent(2, True) %}
32+
{{ runtime_security_config | to_nice_yaml }}
33+
{% endfilter %}
34+
{% endif %}

0 commit comments

Comments
 (0)