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 support for container creation's selinux_opts attribute #139

Merged
merged 3 commits into from
Nov 14, 2022

Conversation

gjpin
Copy link
Contributor

@gjpin gjpin commented Oct 25, 2021

Solves #135

Hi!

This PR adds support for the selinux_opts attribute, as per https://docs.podman.io/en/latest/_static/api.html#operation/ContainerCreateLibpod .

I've also updated the README file and the tests to support the new attribute.

Thank you!

Copy link
Contributor

@lgfa29 lgfa29 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR @gjpin!

I had to rebase and force-push your branch to fix some conflicts, and I also added a CHANGELOG entry.

@lgfa29
Copy link
Contributor

lgfa29 commented Feb 15, 2022

Hum...actually I just noticed that the tests are failing? Do they require SELinux to be enabled in the environment?

@hashicorp-cla
Copy link

hashicorp-cla commented Mar 12, 2022

CLA assistant check
All committers have signed the CLA.

@jdoss
Copy link
Contributor

jdoss commented Jul 22, 2022

@lgfa29 It looks like the log with the test failures has aged out. Can you rerun them. Looking at the test, is trying to add a SELinux label and then check for it. If SELinux is not enabled, that is going to fail.

@jdoss
Copy link
Contributor

jdoss commented Jul 22, 2022

Lookin a bit more. It looks like you can't run the GitHub hosted actions with SELinux enabled. The SELinux team runs a MacOS GH Action with a Fedora Linux VM to run their test suite 🤢

https://github.com/SELinuxProject/selinux/blob/master/.github/workflows/vm_testsuite.yml

@quentin9696
Copy link

Hi

Any plan to merge this feature on the master branch ?
I saw that all tests are greens. Do you need something else to merge ?

Copy link
Contributor

@lgfa29 lgfa29 left a comment

Choose a reason for hiding this comment

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

Sorry for the delay here everyone, I'm getting this merged and it will be released soon.

Thank you so much for the contribution @gjpin (and for patience through the slow review process 😅)

@lgfa29 lgfa29 merged commit 5a8c3e1 into hashicorp:main Nov 14, 2022
@quentin9696
Copy link

@lgfa29 thank you for the merge.
I'll test is as soon as it's released !

@lgfa29
Copy link
Contributor

lgfa29 commented Nov 14, 2022

Lookin a bit more. It looks like you can't run the GitHub hosted actions with SELinux enabled. The SELinux team runs a MacOS GH Action with a Fedora Linux VM to run their test suite 🤢

https://github.com/SELinuxProject/selinux/blob/master/.github/workflows/vm_testsuite.yml

Ops, the ✅ was a red herring 😅

Since the commit was just CHANGELOG update, the test suite didn't actually run. I tried this Vagrant approach since we also have a dev Vagrantfile, but I couldn't get it to work and it would take quite a bit of time to investigate, so I will just skip these tests in CI for now.

@quentin9696
Copy link

quentin9696 commented Nov 15, 2022

@lgfa29 oh, I thought that was solved :/.

I made a test on my cluster and it works well on my side.

I create a task with selinux_opts = ["disable"]and podman run it with my flag correctly, I'm allow to talk with my socket. When I run the same job without the selinux_opts and got my expected access denied.

I hope you'll find the solution with the macos and vagran hack to enable selinux on a machine. That's sad to see github action disable selinux on their linux machines 👎

@lgfa29
Copy link
Contributor

lgfa29 commented Nov 15, 2022

No worries, I thought it was good too 😅

I'm skipping these two tests for now until we figure out a better way. Hopefuly GitHub will provide something better soon 🤞

@gjpin gjpin deleted the selinux_opts branch November 17, 2022 15:06
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 this pull request may close these issues.

5 participants