add selinux category range to config
This allows an admin to set the upper bounds on the category range for selinux labels. This can be useful when handling allocation of PVs or other volume types that need to be shared with selinux enabled on the hosts and volumes. Signed-off-by: Michael Crosby <michael@thepasture.io>
This commit is contained in:
parent
9b06da4773
commit
5f5d954b6a
@ -35,6 +35,10 @@ version = 2
|
|||||||
# enable_selinux indicates to enable the selinux support.
|
# enable_selinux indicates to enable the selinux support.
|
||||||
enable_selinux = false
|
enable_selinux = false
|
||||||
|
|
||||||
|
# selinux_category_range allows the upper bound on the category range to be set.
|
||||||
|
# if not specified or set to 0, defaults to 1024 from the selinux package.
|
||||||
|
selinux_category_range = 1024
|
||||||
|
|
||||||
# sandbox_image is the image used by sandbox container.
|
# sandbox_image is the image used by sandbox container.
|
||||||
sandbox_image = "k8s.gcr.io/pause:3.2"
|
sandbox_image = "k8s.gcr.io/pause:3.2"
|
||||||
|
|
||||||
|
@ -198,6 +198,9 @@ type PluginConfig struct {
|
|||||||
StreamIdleTimeout string `toml:"stream_idle_timeout" json:"streamIdleTimeout"`
|
StreamIdleTimeout string `toml:"stream_idle_timeout" json:"streamIdleTimeout"`
|
||||||
// EnableSelinux indicates to enable the selinux support.
|
// EnableSelinux indicates to enable the selinux support.
|
||||||
EnableSelinux bool `toml:"enable_selinux" json:"enableSelinux"`
|
EnableSelinux bool `toml:"enable_selinux" json:"enableSelinux"`
|
||||||
|
// SelinuxCategoryRange allows the upper bound on the category range to be set.
|
||||||
|
// If not specified or set to 0, defaults to 1024 from the selinux package.
|
||||||
|
SelinuxCategoryRange int `toml:"selinux_category_range" json:"selinuxCategoryRange"`
|
||||||
// SandboxImage is the image used by sandbox container.
|
// SandboxImage is the image used by sandbox container.
|
||||||
SandboxImage string `toml:"sandbox_image" json:"sandboxImage"`
|
SandboxImage string `toml:"sandbox_image" json:"sandboxImage"`
|
||||||
// StatsCollectPeriod is the period (in seconds) of snapshots stats collection.
|
// StatsCollectPeriod is the period (in seconds) of snapshots stats collection.
|
||||||
|
@ -44,12 +44,13 @@ func DefaultConfig() PluginConfig {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
DisableTCPService: true,
|
DisableTCPService: true,
|
||||||
StreamServerAddress: "127.0.0.1",
|
StreamServerAddress: "127.0.0.1",
|
||||||
StreamServerPort: "0",
|
StreamServerPort: "0",
|
||||||
StreamIdleTimeout: streaming.DefaultConfig.StreamIdleTimeout.String(), // 4 hour
|
StreamIdleTimeout: streaming.DefaultConfig.StreamIdleTimeout.String(), // 4 hour
|
||||||
EnableSelinux: false,
|
EnableSelinux: false,
|
||||||
EnableTLSStreaming: false,
|
SelinuxCategoryRange: 1024,
|
||||||
|
EnableTLSStreaming: false,
|
||||||
X509KeyPairStreaming: X509KeyPairStreaming{
|
X509KeyPairStreaming: X509KeyPairStreaming{
|
||||||
TLSKeyFile: "",
|
TLSKeyFile: "",
|
||||||
TLSCertFile: "",
|
TLSCertFile: "",
|
||||||
|
@ -44,6 +44,9 @@ func (c *criService) initPlatform() error {
|
|||||||
if !selinux.GetEnabled() {
|
if !selinux.GetEnabled() {
|
||||||
logrus.Warn("Selinux is not supported")
|
logrus.Warn("Selinux is not supported")
|
||||||
}
|
}
|
||||||
|
if r := c.config.SelinuxCategoryRange; r > 0 {
|
||||||
|
selinux.CategoryRange = uint32(r)
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
selinux.SetDisabled()
|
selinux.SetDisabled()
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# cri dependencies
|
# cri dependencies
|
||||||
github.com/docker/docker 4634ce647cf2ce2c6031129ccd109e557244986f
|
github.com/docker/docker 4634ce647cf2ce2c6031129ccd109e557244986f
|
||||||
github.com/opencontainers/selinux v1.6.0
|
github.com/opencontainers/selinux v1.6.0
|
||||||
github.com/willf/bitset d5bec3311243426a3c6d1b7a795f24b17c686dbb # 1.1.10+ used by selinux pkg
|
|
||||||
github.com/tchap/go-patricia v2.2.6
|
github.com/tchap/go-patricia v2.2.6
|
||||||
|
github.com/willf/bitset d5bec3311243426a3c6d1b7a795f24b17c686dbb # 1.1.10+ used by selinux pkg
|
||||||
|
|
||||||
# containerd dependencies
|
# containerd dependencies
|
||||||
github.com/beorn7/perks v1.0.1
|
github.com/beorn7/perks v1.0.1
|
||||||
|
Loading…
Reference in New Issue
Block a user