Skip to contentSkip to conversation

libsepol releases

DISCUSSION Russell Coker 5 participants 8 messages Apr 5, 2020 – May 15, 2020 4 messages not in the archive SELinux security module

lore
Share & tools
lore
#0 lore raw

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=955154

We have the above Debian bug report requesting a GIT patch for libsepol for GCC-10 support.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=955286

We also have the above for a policy constraint error.

Could we have a new upstream release soon to cover all GCC-10 issues as well as any other important things? Maybe version 3.0.1?

Signature · 2 lines
My Main Blog         http://etbe.coker.com.au/
My Documents Blog    http://doc.coker.com.au/
#1 lore raw
Quoted 5 lines · Russell Coker

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=955154

We have the above Debian bug report requesting a GIT patch for libsepol for GCC-10 support.

Quoted 7 lines

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=955286

We also have the above for a policy constraint error.

Could we have a new upstream release soon to cover all GCC-10 issues as well as any other important things? Maybe version 3.0.1?

It's more than 4 months since the latest release so I think it's worth it to release 3.1.

If there's no objection, I'll send a heads up that we'll release 3.1-rc1 next week.

Petr

#6 lore raw

Fedora VM On Travis for Testing

In reply to a message not in the archive

I just wanted to lay out a demo of a Fedora 32 cloud VM image booting on Travis with execution happening in the Fedora VM.
The Fedora VM contains the selinux source code for that particular travis build, so it has the PR patches, etc.
The VM has networking.

The build logs for the Travis run are here:
- https://travis-ci.org/github/williamcroberts/selinux/builds/687185489

Which comes from my git tree here:
- https://github.com/williamcroberts/selinux/tree/kvm-fedora-testing

Note that it's super messy, I need to go through and cleanup both the patch and the git
history. I also should verify the downloaded image is signed for the VM. Also note that I may rebase/squash my git branch at any time.

Petr started a release document here:
- https://github.com/bachradsusi/SELinuxProject-selinux/blob/RELEASE/RELEASE_PROCESS.md

I'd like to gather feedback, and perhaps more comments on:
1. Is this CI approach worth continuing?
2. Comments on the CI scripts (I have no idea what I am doing, common issue)
3. Comments, patches, suggestions on what tests to run in this CI environment.
4. More information in in the RELEASE_PROCESS.md file. I made some comments there
as well on ideas.

My goal here is that a release can occur if CI is passing without worry, and that
we automate manual steps as much as possible. This way, if we get hit by a bus releases can occur without much effort.

Thanks,
Bill

#7 lore raw

Re: Fedora VM On Travis for Testing

Quoted 29 lines · William Roberts

I just wanted to lay out a demo of a Fedora 32 cloud VM image booting on Travis with execution happening in the Fedora VM.
The Fedora VM contains the selinux source code for that particular travis build, so it has the PR patches, etc.
The VM has networking.

The build logs for the Travis run are here:
- https://travis-ci.org/github/williamcroberts/selinux/builds/687185489

Which comes from my git tree here:
- https://github.com/williamcroberts/selinux/tree/kvm-fedora-testing

Note that it's super messy, I need to go through and cleanup both the patch and the git
history. I also should verify the downloaded image is signed for the VM. Also note that I may rebase/squash my git branch at any time.

Petr started a release document here:
- https://github.com/bachradsusi/SELinuxProject-selinux/blob/RELEASE/RELEASE_PROCESS.md

I'd like to gather feedback, and perhaps more comments on:
1. Is this CI approach worth continuing?
2. Comments on the CI scripts (I have no idea what I am doing, common issue)
3. Comments, patches, suggestions on what tests to run in this CI environment.
4. More information in in the RELEASE_PROCESS.md file. I made some comments there
as well on ideas.

Quoted 4 lines

My goal here is that a release can occur if CI is passing without worry, and that
we automate manual steps as much as possible. This way, if we get hit by a bus releases can occur without much effort.

Hi,
This sounds like a nice idea :) Also it appears it only takes 5 minutes to run the whole Travis CI job of setting the Fedora VM up and booting it, which is more than acceptable in term of delays (and is very quicker than building and testing the project itself). This could allow to run more tests that require to be able to manage the SELinux policy, automatically at every pull requests.

By the way I wasn't expecting Travis-CI to easily allow nested virtualization ("nested" because jobs are already run inside VMs, IIRC). If it works, it is great!

Some quick thoughts/suggestions/comments that I have in my head after reading very quickly your changes:
- The networking setup of the VM seems to be more complex than needed because you are relying on getting the IP address from DHCP. Would it be possible to configure libvirt with port forwarding, so that "ssh -p 2222 127.0.0.1" always work? (with raw QEMU, the command-line parameters would be something like -net nic,model=virtio,macaddr=52:54:00:12:34:56 -net user,hostfwd=tcp:127.0.0.1:2222-:22)
- Usually the helper scripts are located in directory scripts/, which make them more easily discovered by people reading the code (hidden files and directories seems more appropriate to store the configuration for different CI platforms that require them ; some projects choose to hide everything that is not useful for the build process but here it does seem to be so). Are there advantages of using .ci/ directory?
- Moreover having a "fedora-test.run" (or "fedora-test.sh", I am more used to .sh extension for shell scripts) enables to easily reproduce tests on a local development machine using "vagrant init fedora/32-cloud-base && vagrant ssh" + "sudo /vagrant/.../fedora-test.run". Such a command could be documented in the header of the shell script.
- Right now, there are many things in .travis.yml. This file could be split in shell script(s) if that reduces duplication.
- To verify the download of Fedora cloud image, instead of hard-coding its SHA256 digest, you could download the checksum file which is signed using GnuPG and check its signature, as described on
https://alt.fedoraproject.org/cloud/

Cheers,
Nicolas

maintainer
#9 lore raw

Re: Fedora VM On Travis for Testing

In reply to William Roberts
Quoted 29 lines · William Roberts

I just wanted to lay out a demo of a Fedora 32 cloud VM image booting on Travis with execution happening in the Fedora VM.
The Fedora VM contains the selinux source code for that particular travis build, so it has the PR patches, etc.
The VM has networking.

The build logs for the Travis run are here:
- https://travis-ci.org/github/williamcroberts/selinux/builds/687185489

Which comes from my git tree here:
- https://github.com/williamcroberts/selinux/tree/kvm-fedora-testing

Note that it's super messy, I need to go through and cleanup both the patch and the git
history. I also should verify the downloaded image is signed for the VM. Also note that I may rebase/squash my git branch at any time.

Petr started a release document here:
- https://github.com/bachradsusi/SELinuxProject-selinux/blob/RELEASE/RELEASE_PROCESS.md

I'd like to gather feedback, and perhaps more comments on:
1. Is this CI approach worth continuing?
2. Comments on the CI scripts (I have no idea what I am doing, common issue)
3. Comments, patches, suggestions on what tests to run in this CI environment.
4. More information in in the RELEASE_PROCESS.md file. I made some comments there
as well on ideas.

Quoted 4 lines

My goal here is that a release can occur if CI is passing without worry, and that
we automate manual steps as much as possible. This way, if we get hit by a bus releases can occur without much effort.

I'm amazed travis-ci supports all of that (especially for free). Hopefully you aren't violating their terms of use.
The biggest thing I'd add is to build and install the selinux userspace in place of the stock Fedora versions (sudo make LIBDIR=/usr/lib64 SHLIBDIR=/lib64 install install-pywrap relabel) and then build and run the selinux-testsuite to exercise the SELinux userspace and kernel runtime functionality. Other things to possibly add would be rebuilding upstream refpolicy (similar to its .travis.yml) with the latest userspace, rebuilding and running setools (but until we decouple it from libsepol internals this will periodically break).

#8 lore raw

Re: Fedora VM On Travis for Testing

In reply to Nicolas Iooss
Quoted 37 lines · Nicolas Iooss
Quoted 29 lines · William Roberts

I just wanted to lay out a demo of a Fedora 32 cloud VM image booting on Travis with execution happening in the Fedora VM.
The Fedora VM contains the selinux source code for that particular travis build, so it has the PR patches, etc.
The VM has networking.

The build logs for the Travis run are here:
- https://travis-ci.org/github/williamcroberts/selinux/builds/687185489

Which comes from my git tree here:
- https://github.com/williamcroberts/selinux/tree/kvm-fedora-testing

Note that it's super messy, I need to go through and cleanup both the patch and the git
history. I also should verify the downloaded image is signed for the VM. Also note that I may rebase/squash my git branch at any time.

Petr started a release document here:
- https://github.com/bachradsusi/SELinuxProject-selinux/blob/RELEASE/RELEASE_PROCESS.md

I'd like to gather feedback, and perhaps more comments on:
1. Is this CI approach worth continuing?
2. Comments on the CI scripts (I have no idea what I am doing, common issue)
3. Comments, patches, suggestions on what tests to run in this CI environment.
4. More information in in the RELEASE_PROCESS.md file. I made some comments there
as well on ideas.

Quoted 4 lines

My goal here is that a release can occur if CI is passing without worry, and that
we automate manual steps as much as possible. This way, if we get hit by a bus releases can occur without much effort.

Quoted 5 lines

Hi,
This sounds like a nice idea :) Also it appears it only takes 5 minutes to run the whole Travis CI job of setting the Fedora VM up and booting it, which is more than acceptable in term of delays (and is very quicker than building and testing the project itself). This could

Yeah I was pretty happy with the timing it took to add this. But CI doesn't necessarily need to be fast. We run a huge test matrix, Travis only spins up a few at a time anyways.

Quoted 6 lines

allow to run more tests that require to be able to manage the SELinux policy, automatically at every pull requests.

By the way I wasn't expecting Travis-CI to easily allow nested virtualization ("nested" because jobs are already run inside VMs, IIRC). If it works, it is great!

I was surprised too, I was expecting that to be disabled, when I cat cpuinfo, I was very happy.

Quoted 10 lines

Some quick thoughts/suggestions/comments that I have in my head after reading very quickly your changes:
- The networking setup of the VM seems to be more complex than needed because you are relying on getting the IP address from DHCP. Would it be possible to configure libvirt with port forwarding, so that "ssh -p 2222 127.0.0.1" always work? (with raw QEMU, the command-line parameters would be something like -net nic,model=virtio,macaddr=52:54:00:12:34:56 -net user,hostfwd=tcp:127.0.0.1:2222-:22)

I would love something like that (no idea what I am doing), but it doesn't get rid of polling for network. We have to wait for the sshd to be ready.

Quoted 7 lines

- Usually the helper scripts are located in directory scripts/, which make them more easily discovered by people reading the code (hidden files and directories seems more appropriate to store the configuration for different CI platforms that require them ; some projects choose to hide everything that is not useful for the build process but here it does seem to be so). Are there advantages of using .ci/ directory?

No benefit, just did something. They can live wherever....

Quoted 2 lines

- Moreover having a "fedora-test.run" (or "fedora-test.sh", I am more used to .sh extension for shell scripts) enables to easily reproduce

and be named whatever....

Quoted 4 lines

tests on a local development machine using "vagrant init fedora/32-cloud-base && vagrant ssh" + "sudo /vagrant/.../fedora-test.run". Such a command could be documented in the header of the shell script.

That sounds good, I like being able to do that. I have no idea what vagrant is. You could say im ignorant to vargrant!

Quoted 2 lines

- Right now, there are many things in .travis.yml. This file could be split in shell script(s) if that reduces duplication.

Yep I agree. Thats how I run all my other projects, I dislike large travis.yml files,
but I don't want to take on that workload right now, ideally get this working and then port the other stuff.

Quoted 4 lines

- To verify the download of Fedora cloud image, instead of hard-coding its SHA256 digest, you could download the checksum file which is signed using GnuPG and check its signature, as described on
https://alt.fedoraproject.org/cloud/

Yeah I saw that. Thats why I had that verify link in the TODO comment:
https://alt.fedoraproject.org/en/verify.html

Quoted 3 lines

Cheers,
Nicolas

Thank you, appreciate your feedback

#10 lore raw

Re: Fedora VM On Travis for Testing

In reply to Stephen Smalley
Quoted 32 lines · Stephen Smalley
Quoted 29 lines · William Roberts

I just wanted to lay out a demo of a Fedora 32 cloud VM image booting on Travis with execution happening in the Fedora VM.
The Fedora VM contains the selinux source code for that particular travis build, so it has the PR patches, etc.
The VM has networking.

The build logs for the Travis run are here:
- https://travis-ci.org/github/williamcroberts/selinux/builds/687185489

Which comes from my git tree here:
- https://github.com/williamcroberts/selinux/tree/kvm-fedora-testing

Note that it's super messy, I need to go through and cleanup both the patch and the git
history. I also should verify the downloaded image is signed for the VM. Also note that I may rebase/squash my git branch at any time.

Petr started a release document here:
- https://github.com/bachradsusi/SELinuxProject-selinux/blob/RELEASE/RELEASE_PROCESS.md

I'd like to gather feedback, and perhaps more comments on:
1. Is this CI approach worth continuing?
2. Comments on the CI scripts (I have no idea what I am doing, common issue)
3. Comments, patches, suggestions on what tests to run in this CI environment.
4. More information in in the RELEASE_PROCESS.md file. I made some comments there
as well on ideas.

Quoted 7 lines
Quoted 4 lines

My goal here is that a release can occur if CI is passing without worry, and that
we automate manual steps as much as possible. This way, if we get hit by a bus releases can occur without much effort.

I'm amazed travis-ci supports all of that (especially for free). Hopefully you aren't violating their terms of use.

Not that I am aware of and I read their terms of use.
https://docs.travis-ci.com/legal/terms-of-service/

They don't seem to limit what you can do, it seems to be centered around availability, liability and support.

I stumbled into other projects on github that were running virsh commands

Quoted 5 lines

The biggest thing I'd add is to build and install the selinux userspace in place of the stock Fedora versions (sudo make LIBDIR=/usr/lib64 SHLIBDIR=/lib64 install install-pywrap relabel) and then build and run the selinux-testsuite to exercise the SELinux userspace and kernel runtime functionality. Other things to possibly

Perfect, that's the info I was looking for.

Quoted 4 lines

add would be rebuilding upstream refpolicy (similar to its .travis.yml) with the latest userspace, rebuilding and running setools (but until we decouple it from libsepol internals this will periodically break).

If it breaks, it breaks, just means we need to merge something or actually fix it properly IIUC.

#11 lore raw

Re: Fedora VM On Travis for Testing

Quoted 59 lines · William Roberts
Quoted 32 lines · Stephen Smalley
Quoted 29 lines · William Roberts

I just wanted to lay out a demo of a Fedora 32 cloud VM image booting on Travis with execution happening in the Fedora VM.
The Fedora VM contains the selinux source code for that particular travis build, so it has the PR patches, etc.
The VM has networking.

The build logs for the Travis run are here:
- https://travis-ci.org/github/williamcroberts/selinux/builds/687185489

Which comes from my git tree here:
- https://github.com/williamcroberts/selinux/tree/kvm-fedora-testing

Note that it's super messy, I need to go through and cleanup both the patch and the git
history. I also should verify the downloaded image is signed for the VM. Also note that I may rebase/squash my git branch at any time.

Petr started a release document here:
- https://github.com/bachradsusi/SELinuxProject-selinux/blob/RELEASE/RELEASE_PROCESS.md

I'd like to gather feedback, and perhaps more comments on:
1. Is this CI approach worth continuing?
2. Comments on the CI scripts (I have no idea what I am doing, common issue)
3. Comments, patches, suggestions on what tests to run in this CI environment.
4. More information in in the RELEASE_PROCESS.md file. I made some comments there
as well on ideas.

Quoted 7 lines
Quoted 4 lines

My goal here is that a release can occur if CI is passing without worry, and that
we automate manual steps as much as possible. This way, if we get hit by a bus releases can occur without much effort.

I'm amazed travis-ci supports all of that (especially for free). Hopefully you aren't violating their terms of use.

Not that I am aware of and I read their terms of use.
https://docs.travis-ci.com/legal/terms-of-service/

They don't seem to limit what you can do, it seems to be centered around availability, liability and support.

I stumbled into other projects on github that were running virsh commands

Quoted 5 lines

The biggest thing I'd add is to build and install the selinux userspace in place of the stock Fedora versions (sudo make LIBDIR=/usr/lib64 SHLIBDIR=/lib64 install install-pywrap relabel) and then build and run the selinux-testsuite to exercise the SELinux userspace and kernel runtime functionality. Other things to possibly

Perfect, that's the info I was looking for.

Quoted 7 lines
Quoted 4 lines

add would be rebuilding upstream refpolicy (similar to its .travis.yml) with the latest userspace, rebuilding and running setools (but until we decouple it from libsepol internals this will periodically break).

If it breaks, it breaks, just means we need to merge something or actually fix it properly IIUC.

So I just wanted to share, that the test suite is running with a PASS on a travis CI instance with a nested KVM of Fedora32.

https://travis-ci.org/github/williamcroberts/selinux/builds/687592735

Next week I'll clean this up and make sure that its working consistently. I've had 2 hangs when building the libselinux src, not sure why.. I don't want a CI check that'd flaky, so I want to do some more testing.

An example is on this build:
https://travis-ci.org/github/williamcroberts/selinux/builds/687496735

I'm gonna assume I need to allocate more memory and im gonna bump the vcpu count as well to match the host. As Travis gives us two cores.

Bill