Skip to content
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

Add CAP_CHOWN capability if package requires root privileges #2330

Closed
mrodm opened this issue Jan 10, 2025 · 0 comments · Fixed by #2331
Closed

Add CAP_CHOWN capability if package requires root privileges #2330

mrodm opened this issue Jan 10, 2025 · 0 comments · Fixed by #2331
Assignees
Labels
Team:Ecosystem Label for the Packages Ecosystem team

Comments

@mrodm
Copy link
Contributor

mrodm commented Jan 10, 2025

By default, elastic-package drops all capabilities for the Elastic Agent container when running system tests. Just adds the capabilities added explicitly in the system test configuration file.

Starting with 8.17.1-SNAPSHOT, packages that require root privileges cannot start the Elastic Agent container and they are failing with this error:

Error: the command is executed as root but the program files are not owned by the root user. execute the command as the user that owns the program files

To avoid this error with packages that require root privileges when starting the Elastic Agent container, it is required to add the CAP_CHOWN capability if it was not added by the package previously.

Example of packages failing using 8.18.0-SNAPSHOT:

This root privileges could be defined as part of the manifest:

agent:
  privileges:
    root: true

or in each system test configuration file (e.g. example):

agent:
  user: root
@mrodm mrodm added the Team:Ecosystem Label for the Packages Ecosystem team label Jan 10, 2025
@mrodm mrodm self-assigned this Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Ecosystem Label for the Packages Ecosystem team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant