Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kind: bug-fix
summary: Assign sys_ptrace and dac_override capabilities in permitted set to agentbeat binary.
component: elastic-agent, metricbeat
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ RUN true && \

# Keep this after any chown command, chown resets any applied capabilities
RUN setcap =p {{ $beatHome }}/data/elastic-agent-{{ commit_short }}/elastic-agent
RUN setcap cap_net_raw,cap_setuid+p {{ $beatHome }}/data/elastic-agent-{{ commit_short }}/components/agentbeat && \
RUN setcap cap_net_raw,cap_setuid,cap_sys_ptrace,cap_dac_override+p {{ $beatHome }}/data/elastic-agent-{{ commit_short }}/components/agentbeat && \

@pkoutsovasilis pkoutsovasilis Aug 13, 2024

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

dac_override is way too open why dac_read_search is not adequate?

{{- if .linux_capabilities }}
# Since the beat is stored at the other end of a symlink we must follow the symlink first
# For security reasons setcap does not support symlinks. This is smart in the general case
Expand Down
2 changes: 1 addition & 1 deletion testing/integration/agent_long_running_leak_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (runner *ExtendedRunner) TestHandleLeak() {
timer := time.NewTimer(testDuration)
defer timer.Stop()

ticker := time.NewTicker(time.Second * 10)
ticker := time.NewTicker(time.Second * 60)
defer ticker.Stop()

done := false
Expand Down
4 changes: 2 additions & 2 deletions testing/integration/agent_long_test_base_system_integ.json
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@
}
},
{
"enabled": true,
"enabled": false,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Why are these being disabled?

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.

@michel-laterman i actually forgot to update the description. my bad

Please take a look now.

"data_stream": {
"type": "metrics",
"dataset": "system.process"
Expand Down Expand Up @@ -596,7 +596,7 @@
}
},
{
"enabled": true,
"enabled": false,
"data_stream": {
"type": "metrics",
"dataset": "system.process.summary"
Expand Down
4 changes: 2 additions & 2 deletions testing/integration/kubernetes_agent_standalone_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@ func TestKubernetesAgentStandalone(t *testing.T) {
int64Ptr(1000), // elastic-agent uid
nil,
[]corev1.Capability{"ALL"},
[]corev1.Capability{"CHOWN", "SETPCAP"},
[]corev1.Capability{"CHOWN", "SETPCAP", "DAC_OVERRIDE", "SYS_PTRACE"},
true,
},
{
"drop ALL add CHOWN, SETPCAP capabilities - rootless agent random uid:gid",
int64Ptr(500),
int64Ptr(500),
[]corev1.Capability{"ALL"},
[]corev1.Capability{"CHOWN", "SETPCAP", "DAC_READ_SEARCH"},
[]corev1.Capability{"CHOWN", "SETPCAP", "DAC_OVERRIDE", "SYS_PTRACE"},
true,
},
}
Expand Down