Skip to content

Add docker seliux policy for rpm - #15832

Merged
icecrime merged 3 commits into
moby:masterfrom
jessfraz:add-docker-seliux-policy-for-rpm
Aug 29, 2015
Merged

icecrime merged 3 commits into
moby:masterfrom
jessfraz:add-docker-seliux-policy-for-rpm

Conversation

@jessfraz

Copy link
Copy Markdown
Contributor

fix #15498

This creates our own docker-selinux package for use with our repo

ping @ewindisch @diogomonica @NathanMcCauley @vbatts @rhatdan

@ewindisch

Copy link
Copy Markdown
Contributor

👎 I would like to have clarity on the license. If this is based on https://github.com/fedora-cloud/docker-selinux which is dual-licensed under the LGPL (LICENSE file) and GPLv2 (see docker-selinux.spec), then there could be a barrier to including this policy. Neither license is compatible with the Apache license: https://www.apache.org/legal/resolved.html#category-x

@jfrazelle could you verify if this is the source you used, or if there is some other package you've derived from? I would also appreciate if @rhatdan might have input. Perhaps there is a package (new or old) shipping with a policy we're able to bundle?

Worst-case we might need to ship as a separate package?

(Note we're not actually linking code here, so perhaps it's okay to simply have this work in the same repository and shipped in the same packages. IANAL and only wish to make sure we do the right thing!)

@jessfraz

Copy link
Copy Markdown
Contributor Author

I used a weird tarball from a fedora git url, hang on I believe it said GNU

@jessfraz
jessfraz force-pushed the add-docker-seliux-policy-for-rpm branch from 68c5e1f to 86fc059 Compare August 25, 2015 21:01
@jessfraz
jessfraz force-pushed the add-docker-seliux-policy-for-rpm branch from 86fc059 to b03cacf Compare August 25, 2015 21:03
@jessfraz

Copy link
Copy Markdown
Contributor Author

So the way I pacakged the rpm it is a seperate package that the
docker-engine would then rely on... IANAL but it looks like red hat also
ships the seperate package as GPL and then Docker as Apache... but ya I
hvae noo idea

On Tue, Aug 25, 2015 at 1:22 PM, Eric Windisch [email protected]
wrote:

[image: 👎] I would like to have clarity on the license. If this is
based on https://github.com/fedora-cloud/docker-selinux which is
dual-licensed under the LGPL (LICENSE file) and GPLv2 (see
docker-selinux.spec), then there could be a barrier to including this
policy. Neither license is compatible with the Apache license:
https://www.apache.org/legal/resolved.html#category-x

@jfrazelle https://github.com/jfrazelle could you verify if this is the
source you used, or if there is some other package you've derived from? I
would also appreciate if @rhatdan https://github.com/rhatdan might have
input. Perhaps there is a package (new or old) shipping with a policy we're
able to bundle?

Worst-case we might need to ship as a separate package?

—
Reply to this email directly or view it on GitHub
#15832 (comment).

@ewindisch

Copy link
Copy Markdown
Contributor

Checking more carefully at the commit, because it creates a new RPM it's probably fine.

@jessfraz
jessfraz force-pushed the add-docker-seliux-policy-for-rpm branch 4 times, most recently from a625459 to 0b03fcd Compare August 26, 2015 02:49
@rhatdan

rhatdan commented Aug 26, 2015

Copy link
Copy Markdown
Contributor

As long as it is a separate RPM I believe it is fine. IANAL. You are
not actually using code inside of docker, these are completely separate.

On 08/25/2015 05:16 PM, Eric Windisch wrote:

Checking more carefully at the commit, because it creates a new RPM
it's probably fine.

—
Reply to this email directly or view it on GitHub
#15832 (comment).

@Djelibeybi

Copy link
Copy Markdown
Contributor

I mentioned this to @jfrazelle on IRC, but selinux-policy-targeted on Fedora (20, 21, 22), CentOS 7 and Oracle Linux 7 already contains a docker.pp which allows Docker 1.8.1 to work.

Perhaps instead of including another SElinux policy, it's worth reviewing the upstream policy and just adding a Requires: to selinux-policy-targeted for the docker-engine RPM?

@jessfraz

Copy link
Copy Markdown
Contributor Author

We want to control our own policy to ensure things don't break.

Comment thread hack/make/.build-rpm/docker-engine.spec Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is too high for EL7-derived distros. The latest RPM in EL7 is selinux-policy-3.13.1-23.0.1.el7_1.13.noarch

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I will fix for oracle

On Wed, Aug 26, 2015 at 6:27 PM, Avi Miller [email protected]
wrote:

In hack/make/.build-rpm/docker-engine.spec
#15832 (comment):

@@ -50,6 +50,27 @@ Requires: kernel-uek >= 3.8
Requires: device-mapper >= 1.02.90-2
%endif

+# docker-selinux conditional
+%if 0%{?fedora} >= 22 || 0%{?centos} >= 7 || 0%{?rhel} >= 7 || 0%{?oracle} >= 7
+%global with_selinux 1
+%endif
+
+# start if with_selinux
+%if 0%{?with_selinux}
+# Version of SELinux we were using
+%if 0%{?fedora} >= 22
+%global selinux_policyver 3.13.1-119
+%else
+%global selinux_policyver 3.13.1-39

This is too high for EL7-derived distros. The latest RPM in EL7 is
selinux-policy-3.13.1-23.0.1.el7_1.13.noarch

—
Reply to this email directly or view it on GitHub
https://github.com/docker/docker/pull/15832/files#r38054339.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

or 7 sorry

On Wed, Aug 26, 2015 at 6:44 PM, Jessie Frazelle [email protected] wrote:

I will fix for oracle

On Wed, Aug 26, 2015 at 6:27 PM, Avi Miller [email protected]
wrote:

In hack/make/.build-rpm/docker-engine.spec
#15832 (comment):

@@ -50,6 +50,27 @@ Requires: kernel-uek >= 3.8
Requires: device-mapper >= 1.02.90-2
%endif

+# docker-selinux conditional
+%if 0%{?fedora} >= 22 || 0%{?centos} >= 7 || 0%{?rhel} >= 7 || 0%{?oracle} >= 7
+%global with_selinux 1
+%endif
+
+# start if with_selinux
+%if 0%{?with_selinux}
+# Version of SELinux we were using
+%if 0%{?fedora} >= 22
+%global selinux_policyver 3.13.1-119
+%else
+%global selinux_policyver 3.13.1-39

This is too high for EL7-derived distros. The latest RPM in EL7 is
selinux-policy-3.13.1-23.0.1.el7_1.13.noarch

—
Reply to this email directly or view it on GitHub
https://github.com/docker/docker/pull/15832/files#r38054339.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yeah, it's the same RPM version for CentOS7 (and RHEL7).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

updated

@jessfraz
jessfraz force-pushed the add-docker-seliux-policy-for-rpm branch from 0b03fcd to 3ba82eb Compare August 27, 2015 01:50
@Djelibeybi

Copy link
Copy Markdown
Contributor

I'm getting the following error trying to build docker-engine in docker-engine.spec:

error: line 59: Unclosed %if

@jessfraz
jessfraz force-pushed the add-docker-seliux-policy-for-rpm branch from 3ba82eb to bafdc6e Compare August 27, 2015 02:45
@jessfraz

Copy link
Copy Markdown
Contributor Author

fixed moved too fast

@rhatdan

rhatdan commented Aug 27, 2015

Copy link
Copy Markdown
Contributor

We have been asked by the upstream developers of selinux-policy (Which I used to be primary) to start shipping our own policy. Getting fixes into RHEL/Centos selinux-policy base is too slow for a fast moving project like docker. It only gets updated every 6-9 months. The docker-selinux policy replaces and updates the docker.pp package.

@Djelibeybi

Copy link
Copy Markdown
Contributor

Thanks @rhatdan, makes perfect sense.

@jessfraz
jessfraz force-pushed the add-docker-seliux-policy-for-rpm branch from bafdc6e to 0551f36 Compare August 28, 2015 03:00
@ewindisch

Copy link
Copy Markdown
Contributor

LGTM

@Djelibeybi

Copy link
Copy Markdown
Contributor

I'm testing this now, but the new spec file logic still looks weird to me. It's also 7am and I haven't had enough coffee, so I'm running a full RPM build to check before I comment further though.

@jessfraz

Copy link
Copy Markdown
Contributor Author

I built them all and tested

@jessfraz

Copy link
Copy Markdown
Contributor Author

But let me know what you find

@jessfraz
jessfraz force-pushed the add-docker-seliux-policy-for-rpm branch from 0551f36 to 8fe675d Compare August 29, 2015 01:21
@jessfraz

Copy link
Copy Markdown
Contributor Author

Just rebased and force pushed what i had locally, so mad at myself for that sorry, would have gone the whole weekend mad about it haha

also thanks for testing, let me know if you find anything w these

@Djelibeybi

Copy link
Copy Markdown
Contributor

Heh, makes total sense to me (which is why I'm reviewing on Saturday morning here in Melbourne). My reading of the updated commit looks OK, so I've triggered a full build of all RPMs just to be 100% sure.

Also, good excuse to test the performance of Oralce Linux in VMware Fusion 8 Pro. :)

@hqhq

hqhq commented Aug 29, 2015

Copy link
Copy Markdown
Contributor

Tested on RHEL7, I can confirm it fixes the problem, thanks.

@Djelibeybi

Copy link
Copy Markdown
Contributor

Built and tested on Fedora 21, 22, CentOS 7 and Oracle Linux: confirmed as fixed. 👍

LGTM.

@jessfraz

Copy link
Copy Markdown
Contributor Author

\o/ ping @diogomonica @NathanMcCauley @ewindisch @icecrime merge it 0:)

@icecrime

Copy link
Copy Markdown
Contributor

LGTM!

icecrime pushed a commit that referenced this pull request Aug 29, 2015
@icecrime
icecrime merged commit 626c050 into moby:master Aug 29, 2015
@jessfraz
jessfraz deleted the add-docker-seliux-policy-for-rpm branch August 29, 2015 18:36
@thaJeztah

Copy link
Copy Markdown
Member

thanks @jfrazelle and @Djelibeybi. Great work!

@Djelibeybi

Copy link
Copy Markdown
Contributor

@jfrazelle and @thaJeztah: how do we mark this for cherry-picking into the 1.8 stream, out of interest?

@jessfraz

Copy link
Copy Markdown
Contributor Author

We won't do that I don't think, it's too large a change I say we wait to roll out for 1.9.0

On Sat, Aug 29, 2015 at 2:45 PM -0700, "Avi Miller" [email protected] wrote:

@jfrazelle and @thaJeztah: how do we mark this for cherry-picking into the 1.8 stream, out of interest?

—
Reply to this email directly or view it on GitHub.

@Djelibeybi

Copy link
Copy Markdown
Contributor

So we're not going to have SElinux support for the EL7 distros for the life of 1.8?

@jessfraz

Copy link
Copy Markdown
Contributor Author

Yes there is SELinux support you can download the policy distributed by red hat etc. 

On Sat, Aug 29, 2015 at 2:59 PM -0700, "Avi Miller" [email protected] wrote:

So we're not going to have SElinux support for the EL7 distros for the life of 1.8?

—
Reply to this email directly or view it on GitHub.

@jessfraz

Copy link
Copy Markdown
Contributor Author

If you read the issue that is mentioned here that this fixes there is a very easy way to install that ;) so I don't think we should cherry pick a large change

On Sat, Aug 29, 2015 at 2:59 PM -0700, "Avi Miller" [email protected] wrote:

So we're not going to have SElinux support for the EL7 distros for the life of 1.8?

—
Reply to this email directly or view it on GitHub.

@Djelibeybi

Copy link
Copy Markdown
Contributor

Gotcha. Will let our documentation team to document the requirement to ensure that selinux-policy-targeted is installed if SElinux is going to be used.

@moxiegirl

Copy link
Copy Markdown
Contributor

@thaJeztah added changelog to this seems significant. Remove if I overstepped of course.

@thaJeztah

Copy link
Copy Markdown
Member

Thanks @moxiegirl, SGTM. Also, any maintainer is allowed to add those labels, so no worries!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1.8.0: Systemd can't start docker on Centos 7.1

9 participants