Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
virtcontainers: Add SELinux support for running VM Confinement
Browse files Browse the repository at this point in the history
We want to launch the KVM launcher tool (qemu?) with an SELinux label, similar
to what we do with libvirt.

Currently when I use kata with Podman, it complains if we specify a label that
kata does not support SELinux labels. What I would like to do is have kata just
use this label to apply to the KVM launcher. Then I will work to generate a new
policy type (container_kvm_t) that will allow the KVM Launcher tool to do its
thing, but prevent breakout.

Fixes: #2501

Signed-off-by: Fabiano Fidêncio <[email protected]>
Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Apr 2, 2020
1 parent 705713b commit e4eb553
Show file tree
Hide file tree
Showing 18 changed files with 1,847 additions and 3 deletions.
13 changes: 13 additions & 0 deletions Gopkg.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -98,3 +98,7 @@
[[constraint]]
name = "github.com/blang/semver"
version = "3.6.1"

[[constraint]]
name = "github.com/opencontainers/selinux"
version = "1.3.3"
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -464,8 +464,11 @@ QUIET_GENERATE = $(Q:@=@echo ' GENERATE '$@;)
QUIET_INST = $(Q:@=@echo ' INSTALL '$@;)
QUIET_TEST = $(Q:@=@echo ' TEST '$@;)

SELINUXTAG := $(shell ./hack/selinux_tag.sh)
BUILDTAGS := --tags "$(SELINUXTAG)"

# go build common flags
BUILDFLAGS := -buildmode=pie
BUILDFLAGS := -buildmode=pie ${BUILDTAGS}

# whether stipping the binary
ifeq ($(STRIP),yes)
Expand Down
7 changes: 7 additions & 0 deletions hack/selinux_tag.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#
# Copyright 2020 Red Hat Inc.
#
# SPDX-License-Identifier: Apache-2.0
#
pkg-config libselinux 2> /dev/null && echo selinux
201 changes: 201 additions & 0 deletions vendor/github.com/opencontainers/selinux/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit e4eb553

Please sign in to comment.