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

Feature request: add support for adding linux capabilities #1703

Open
maxgio92 opened this issue Dec 13, 2024 · 0 comments · May be fixed by #1702
Open

Feature request: add support for adding linux capabilities #1703

maxgio92 opened this issue Dec 13, 2024 · 0 comments · May be fixed by #1702

Comments

@maxgio92
Copy link
Contributor

Title

Make melange provide way to declare the Linux capabilities to be added to the build process.

Short Description of Issue/Improvement Need

We have different packages in Wolfi that need to be run with additional capabilities on top of the ones set by the runners. For instance, there are cases where a CAP_DAC_OVERRIDE is needed in the build process, but without being explicated. So when trying running that unprivileged it would fail.

Having a possibility to specify the capabilities added in the Melange pipeline manifest, would make that explicit and help on both:

  • security: allowing to apply least privilege
  • efficiency and reproducibility: we wouldn't need to run pipelines with different user and capabilty sets to reproduce the same result, and in the end, also saving time during debugging.

Even with QEMU runner, this would help on reproducibility side.

Impact of issue

There's no big impact now. We know the situation in advance and we circumvent it by using sudo.

Steps to Reproduce

I remember a package needed to override dac, unfortunately I don't remember which. postfix should be a valid example:

  1. Set environment.accounts.run-as=0 in the postfix pipeline.
  2. It will fail even when running as root without capabilities. Running the same with sudo melange it will build with success instead.

Suggested Fix

Introduce an API in the Melange pipeline manifest to set capabilities to be added to the build and test processes. Map them with the related runner.

@maxgio92 maxgio92 linked a pull request Dec 13, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant