·
Last changedVersion:
No hardening report available.
Invoke this skill when:
DD_APM_INSTRUMENTATION_ENABLED=host was used) and you need to configure Unified Service Tags on the application serviceDD_SERVICE, DD_ENV, DD_VERSION on a running service/proc/<pid>/maps doesn't show the language tracer (launcher-only injection)Do NOT invoke this skill if:
agent-install first/opt/datadog-packages/ — re-run agent-installenable-ssi at dd-apm/k8s-ssi/enable-ssi insteadWhen the install script runs with DD_APM_INSTRUMENTATION_ENABLED=host, it:
datadog-apm-inject and language library packages under /opt/datadog-packages//etc/ld.so.preloadWhat SSI does NOT configure automatically:
DD_SERVICE, DD_ENV, DD_VERSION — these must be set on the application process for traces to be tagged correctlyDD_SERVICE, the tracer auto-detects a service name (often the process name or framework name), which may not match what the user expectsVerify SSI is armed:
If /etc/ld.so.preload contains a path to the launcher, and /opt/datadog-packages/datadog-apm-inject exists — SSI is armed.
ERROR: Either missing — run agent-install first.
Check for existing manual instrumentation:
ERROR: Manual instrumentation found — SSI silently disables itself when it detects an existing tracer. Remove the manual import/package before proceeding.
Check base libc:
ERROR: musl — SSI requires glibc. No workaround; must use a glibc-based OS.
| Variable | How to resolve |
|---|---|
| Ask the user — how the service should appear in Datadog APM (e.g. |
| Ask the user — environment name (e.g. |
| Ask the user or read from the app's version file / git tag; show the value to the user and get confirmation before use |
| From |
| Path to SSH private key; use only the path the user provides and keep the key contents out of output |
| SSH username |
| Hostname or IP of the target host |
<SOURCE_DIR> | Ask the user for the application source directory and confirm it before the scan; summarize matched lines rather than printing them in full |
<DD_HOSTNAME> | Ask the user for the host name as it appears in Datadog |
Process ID | Read the main process ID of the systemd unit from the service manager output on the host and confirm it with the user; identify the process through its service manager, not by matching the APM service name |
pm2 app or supervisord program name | Ask the user, only when pm2 or supervisord manages the application |
Before substituting any value into a command, check it. The unit name may contain only letters, digits, dots, dashes, underscores and the at sign. The process ID must be digits only. Service name, env and version may contain only letters, digits, dots, dashes, underscores, colons and slashes. The source directory must be an absolute path made only of letters, digits, dots, dashes, underscores and slashes. If any value fails these checks, stop and ask the user.
Before the first connection, ask the user to verify the host fingerprint out of band and add it to their known hosts. If ssh reports an unknown or changed host key, stop and report it to the user.
Report the detected manual instrumentation to the user and give them the removal steps below to carry out themselves. The agent leaves packages and application code as they are.
pip uninstall ddtrace, remove import ddtrace / ddtrace-run from CMDnpm uninstall dd-trace, remove require('dd-trace')-javaagent:/path/to/dd-java-agent.jar JVM flaggem uninstall ddtrace, remove require 'ddtrace'Datadog.Trace NuGet and profiler env varsAfter removing, restart the service. Confirm with the user before restarting. Tell the user: "I need to restart <SYSTEMD_SERVICE_NAME> to remove the old instrumentation. This will cause a brief outage. Ready to proceed?" Wait for confirmation.
Without UST, traces arrive with an auto-detected service name that may not match user expectations, and won't be tagged with env or version.
For systemd-managed services (most common):
Add a drop-in override (preserves the original unit file):
Add to the editor:
Wait for the user to confirm they saved the drop-in before continuing.
Apply:
If the UST vars appear in the output — configuration applied.
For supervisord:
Confirm with the user before reloading: tell the user that this reload restarts every program supervisord manages, offer to restart only the affected program instead, and wait for confirmation.
Reload: sudo supervisorctl reload
For pm2:
Confirm with the user before reloading: tell the user which app will restart and wait for confirmation.
Reload: pm2 reload <app>
Skip this step when running non-interactively, and continue to the next step.
Otherwise, check whether the service looks event-driven from what the user describes or what is evident in the application.
enable-dsm skill and invoke it only if the user agrees. It asks the user once, states the plan rule, and makes the config change without restarting.If the user agrees, enable-dsm adds its variable to the drop-in from Step 1, so the restart in Step 2 picks up both.
Confirm with the user before restarting. Tell the user: "I need to restart <SYSTEMD_SERVICE_NAME> for SSI to inject into it. This will cause a brief outage. Ready to proceed?" Wait for confirmation.
Wait about three seconds, then check the service state:
If active is returned — service is running.
ERROR: Returns failed — check logs:
Use the main process ID of <SYSTEMD_SERVICE_NAME> resolved in the context table and confirmed with the user. Keep output limited to the filtered lines shown below, and keep full command lines and the unfiltered process environment out of output.
If both the launcher and language library appear in maps, and UST vars are in environ (plus DD_DATA_STREAMS_ENABLED=true if DSM was enabled in Step 1b), SSI and tagging are fully configured.
ERROR: Launcher in maps but no language library — injection attempted but failed. Ask the user whether pup is already installed on their local machine from a trusted Datadog source. If the user confirms, run it on the local machine, not over ssh; it uses Datadog credentials the user has already configured, and those credentials stay out of files and chat. Otherwise go directly to troubleshoot-ssi. Run:
Go to troubleshoot-ssi if errors are present.
Exit when ALL of the following are true:
/proc/<PID>/mapsDD_SERVICE, DD_ENV, DD_VERSION present in /proc/<PID>/environTell the user configuration is complete and offer to run verify-ssi. Proceed only after the user confirms.
Bring Chainguard's hardening pipeline to your first-party skills — custom rulesets, automated remediation, full audit trail.
skills.cgr.dev/public/github.com/datadog-labs/dd-apm/linux-ssi/enable-ssi:latest
MIT
HARDENING.md
LICENSE
SKILL.md