Skip to content

[Host Profiler] Tighten seccomp profile#3042

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
mainfrom
theomagellan/tighter-seccomp
May 29, 2026
Merged

[Host Profiler] Tighten seccomp profile#3042
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
mainfrom
theomagellan/tighter-seccomp

Conversation

@theomagellan

@theomagellan theomagellan commented May 26, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

This PR remove 23 syscalls from the original list of allowed syscalls.
Adds syscalls to allow the profiler to rename its log file (as observed in test cluster)

Motivation

These were needed before AllowPrivilegeEscalation was manually set to false.

Additional Notes

Anything else we should know when reviewing?

Minimum Agent Versions

Are there minimum versions of the Datadog Agent and/or Cluster Agent required?

  • Agent: vX.Y.Z
  • Cluster Agent: vX.Y.Z

Describe your test plan

Profiles running under new seccomp

OS/arch Hostname
Ubuntu 22.04.5 (amd64) i-0ba7396899b33a9ce
Ubuntu 24.04.4 (arm64) i-09516ab7ee1385240
Ubuntu 24.04.4 (amd64) i-07c1951615c0817e3
Ubuntu 26.04 (amd64) i-0d6fbf775e1a2e82e

Checklist

  • PR has at least one valid label: bug, enhancement, refactoring, documentation, tooling, and/or dependencies
  • PR has a milestone or the qa/skip-qa label
  • All commits are signed (see: signing commits)

@theomagellan

Copy link
Copy Markdown
Contributor Author

@codex review

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented May 26, 2026

Copy link
Copy Markdown

Code Coverage

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 42.70% (-0.02%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 358d49e | Docs | Datadog PR Page | Give us feedback!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4648de6fae

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"read",
"readlinkat",
"recvfrom",
"recvmsg",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep recvfrom available for DNS lookups

When the host-profiler exports to the Datadog intake over an endpoint configured as a hostname, the Go resolver reads UDP DNS replies via recvfrom (net.UDPConn.ReadFrom goes through internal/poll.FD.ReadFrom/syscall.Recvfrom). With SCMP_ACT_ERRNO as the default action, removing this syscall causes those lookups to fail under the generated profile, so profile uploads break in the common hostname-endpoint path. Please leave recvfrom in the allowlist unless all configured exporter endpoints are guaranteed to be numeric or agent-local.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understand correctly, this would mean profiles wouldn't be able to be sent, which is not happening here.
Profiles look healthy on all versions and arch.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this depends on how you specified the URL to upload to. What type of URLs did you test ?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed this and Théo made the relevant tests 👍

@codecov-commenter

codecov-commenter commented May 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 42.36%. Comparing base (7a0a7a8) to head (358d49e).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3042      +/-   ##
==========================================
+ Coverage   42.24%   42.36%   +0.11%     
==========================================
  Files         337      337              
  Lines       28951    28984      +33     
==========================================
+ Hits        12230    12278      +48     
+ Misses      15916    15899      -17     
- Partials      805      807       +2     
Flag Coverage Δ
unittests 42.36% <100.00%> (+0.11%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...oller/datadogagent/feature/hostprofiler/seccomp.go 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7a0a7a8...358d49e. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@theomagellan
theomagellan force-pushed the theomagellan/tighter-seccomp branch from 667b58a to 358d49e Compare May 27, 2026 14:04
@theomagellan
theomagellan marked this pull request as ready for review May 27, 2026 17:46
@theomagellan
theomagellan requested a review from a team May 27, 2026 17:46
@theomagellan
theomagellan requested a review from a team as a code owner May 27, 2026 17:46

@r1viollet r1viollet left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thanks!

@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot merged commit 82a75d4 into main May 29, 2026
53 checks passed
@gh-worker-dd-mergequeue-cf854d
gh-worker-dd-mergequeue-cf854d Bot deleted the theomagellan/tighter-seccomp branch May 29, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants