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

container: T6210: add capability sys-nice #3259

Merged
merged 3 commits into from
Apr 9, 2024
Merged

Conversation

theflakes
Copy link
Contributor

@theflakes theflakes commented Apr 5, 2024

Change Summary

Adding sys-nice as an option for container cap-add configuration. This is needed for Suricata v7.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe): Just adding a Vyos config option for functionality that already exists in podman.

Related Task(s)

https://vyos.dev/T6210

Related PR(s)

Component(s) name

container

Proposed changes

How to test

Configured container to run latest version of containerized Suricata. Running Vyos on my home router with Suricata v7 running as a container. Running on N305 Intel CPU with 32GB RAM.

container {
    name suricata {
        allow-host-networks
        arguments "-q 1 -q 2 -q 3 -q 4"
        cap-add net-admin
        cap-add sys-admin
        cap-add sys-nice
        image jasonish/suricata:latest
        memory 8192
        volume ETC {
            destination /etc/suricata
            source /config/suricata/etc
        }
        volume LOGS {
            destination /var/log/suricata
            source /config/suricata/logs
        }
        volume RULES {
            destination /var/lib/suricata
            source /config/suricata/rules
        }
    }
}

Smoketest result

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Adding sys-nice as a cap add for podman docker config in Vyos.
@vyosbot vyosbot requested review from a team, dmbaturin, sarthurdev, zdc, jestabro, sever-sever and c-po and removed request for a team April 5, 2024 22:57
@l0crian1
Copy link
Contributor

l0crian1 commented Apr 5, 2024

Can you add it to the completionHelp list and add a valueHelp element?

Add command completion and help entry for sys-nice.
@sever-sever
Copy link
Member

Read please contributing document that you marked as “read”.
There are no tasks on phabricator, no task number in the commit message, no task number in the PR header.

We’ll close the PR as it is not formatted correctly.

And addition you should use “commit —amend” and and “push —force” to override the previous commit

@c-po
Copy link
Member

c-po commented Apr 6, 2024

I wonder if we should take the last change in 1.4.0-epa3 to rename the node from cap-add to capability which is what it actually does, providing a system capability to the container.

@dmbaturin
Copy link
Member

@c-po I tend to agree, let's rename it while we can. But I wonder if we should add a migration script to help people who used earlier versions of 1.4 pre-release builds.

@theflakes And, yes, please check out the contributing guide and follow the procedure. Not having corresponding tasks and not having commits and PRs linked to tasks makes release notes writing a real headache, it's important for tracking changes across multiple repositories.

@c-po
Copy link
Member

c-po commented Apr 6, 2024

@c-po I tend to agree, let's rename it while we can. But I wonder if we should add a migration script to help people who used earlier versions of 1.4 pre-release builds.

Tracked via https://vyos.dev/T6208 - migrator will be implemented

@theflakes
Copy link
Contributor Author

Sorry about that, I'm getting an account registered to then create the task.

@@ -51,12 +51,16 @@
<format>sys-module</format>
<description>Load, unload and delete kernel modules</description>
</valueHelp>
<valueHelp>
<format>sys-nice</format>
<description>Permissions to set process nice value</description>
Copy link
Member

@c-po c-po Apr 9, 2024

Choose a reason for hiding this comment

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

Please drop the plural here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done and thanks

dropping Permission plural
@c-po c-po changed the title Add container cap sys-nice container: T6210: add capability sys-nice Apr 9, 2024
@c-po c-po merged commit b8f3c61 into vyos:current Apr 9, 2024
5 of 7 checks passed
@c-po
Copy link
Member

c-po commented Apr 9, 2024

@Mergifyio backport sagitta

Copy link
Contributor

mergify bot commented Apr 9, 2024

backport sagitta

✅ Backports have been created

c-po added a commit that referenced this pull request Apr 9, 2024
container: T6210: add capability sys-nice (backport #3259)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

5 participants