selinux

package
v1.9.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2024 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package selinux provides generic code for managing SELinux.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() error

Init initializes SELinux based on the configured mode. It loads the policy and enforces it if necessary.

func IsEnabled

func IsEnabled() bool

IsEnabled checks if SELinux is enabled on the system by reading the kernel command line. It returns true if SELinux is enabled, otherwise it returns false. It also ensures we're not in a container. By default SELinux is disabled.

func IsEnforcing

func IsEnforcing() bool

IsEnforcing checks if SELinux is enabled and the mode should be enforcing. By default if SELinux is enabled we consider it to be permissive.

func SetLabel

func SetLabel(filename string, label string) error

SetLabel sets label for file or directory, following symlinks It does not perform the operation in case SELinux is disabled or provided label is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL