-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Heartbeat] ARM seccomp profile #31422
Conversation
Pinging @elastic/uptime (Team:Uptime) |
This pull request is now in conflicts. Could you fix it? 🙏
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I've tested this on the Graviton instance to which you've given me access by:
- Cloning the beats repo
- Copying the HB file in this PR and pointing to an ES instance
- Runing the provided
strace
command - Making sure all monitors run correctly
- Checking the
len
of the seccomp filters applied (6
frommain
,141
from this branch) - Ensuring the last instruction not
BPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ALLOW)
but actuallyBPF_STMT(BPF_RET|BPF_K, SECCOMP_RET_ERRNO|0x1)
* Refactor seccomp policy logic to mimic seccomp module's * Remove custom profile for arm32, add syscalls for arm64 * Add manually-mapped system calls inherited from amd64 profile
What does this PR do?
Closes #31285.
Added a custom arm64 seccomp deny-by-default profile to override
libbeat
's allow-by-default. Also refactored how hb loads platform-specific seccomp profiles, following the example set onseccomp
module.This profile has been compiled by stracing heartbeat execution to list system calls and manually comparing the discrepancies with amd64 profile. These are the system calls that are most likely re-mapped to arm64 supported ones:
Supported system calls can be checked with this tool.
Strace profile has been obtained with the following
heartbeat.yml
config:Why is it important?
Actual profile provided by libbeat is configured as
allow-by-default
, with one system call disabled. With a custom profile, we can change the default logic and pass only the required calls.Checklist
I have made corresponding changes to the documentationI have made corresponding change to the default configuration filesI have added tests that prove my fix is effective or that my feature worksCHANGELOG.next.asciidoc
orCHANGELOG-developer.next.asciidoc
.Author's Checklist
Screenshots
*ICMP check down due to hb not running as root.
How to test this PR locally
There's no easy way to dump the seccomp profile of a running process in a readable format, so we will make do with comparing the raw system call:
seccomp()
: