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

isolate host containers and limit access to API socket #1056

Merged
merged 2 commits into from
Aug 20, 2020

Conversation

bcressey
Copy link
Contributor

Issue number:
N/A

Description of changes:
Create a distinction between host containers and orchestrated containers in the SELinux policy, and update host-ctr to match. Now host containers will run with one of two privileged labels, and the files they write will receive a different label.

Limit access to the API socket to processes with one of the privileged labels. All host containers will have access to the API, but orchestrated containers will need to opt-in to its use by running as either control_t or super_t.

Testing done:
Confirmed that apiclient in the control container and admin container still works, and that the files they create are correctly labeled.

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

Previously we used the "container_t" label by default for processes
running in host containers and in orchestrated containers, and they
shared the "local_t" label for their files.

Now orchestrated containers use "container_t" and "local_t", while
host containers use "control_t" and "state_t". Separating the types
allows us to enforce isolation even before we add MCS support.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
This inverts the default so that access to the API socket is blocked
unless the container runs with a privileged label.

A second label, `control_t`, has been added so that containers can
opt-in to API access without using the break-glass `super_t` label.

Signed-off-by: Ben Cressey <bcressey@amazon.com>
Copy link
Contributor

@zmrow zmrow left a comment

Choose a reason for hiding this comment

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

🦺

@bcressey bcressey merged commit 5110e8c into bottlerocket-os:develop Aug 20, 2020
@bcressey bcressey deleted the restrict-api-socket branch August 20, 2020 21:33
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.

None yet

4 participants