Skip to content
Merged
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
2 changes: 2 additions & 0 deletions internal/agentdeployer/_static/docker-agent-base.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ services:
- {{ . }}
{{- end }}
{{ end }}
cap_drop:
- ALL
Copy link
Member

Choose a reason for hiding this comment

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

What do you think about trying to drop all capabilities also in the main docker compose, and test with integrations?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I'll update those scenarios and run a test with integrations.

Wondering what to do in the template used for custom agents (servicedeployer). For that case, packages could also define some cap_drop. It's also true that until now some capabilities are just added with cap_add. But looking at the code of moby, if ALL is present in cap_drop , all capabilities are drop...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like there are no issues when cap_drop ALL is set:
elastic/integrations#9694

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should we update also custom agent template ? As there are no packages using cap_drop in the integrations repository, probably it's a good idea, WDYT ?

https://github.com/elastic/elastic-package/blob/5e322d7be61a739b855689aa0c4342abd5fa9d68/internal/servicedeployer/_static/docker-custom-agent-base.yml

Copy link
Member

Choose a reason for hiding this comment

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

Yes, good idea.

{{ if .ports }}
ports:
{{- range .ports }}
Expand Down
2 changes: 2 additions & 0 deletions internal/servicedeployer/_static/docker-custom-agent-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ services:
retries: 180
interval: 1s
hostname: docker-custom-agent
cap_drop:
- ALL
environment:
- FLEET_ENROLL=1
- FLEET_URL=https://fleet-server:8220
Expand Down
2 changes: 2 additions & 0 deletions internal/stack/_static/docker-compose-stack.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ services:
interval: 5s
hostname: docker-fleet-agent
env_file: "./elastic-agent.env"
cap_drop:
- ALL
volumes:
- "../certs/ca-cert.pem:/etc/ssl/certs/elastic-package.pem"
- type: bind
Expand Down
2 changes: 2 additions & 0 deletions internal/stack/_static/serverless-docker-compose.yml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ services:
interval: 5s
hostname: docker-fleet-agent
env_file: "./elastic-agent.env"
cap_drop:
- ALL
volumes:
- type: bind
source: ../../../tmp/service_logs/
Expand Down