security

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 8 Imported by: 5

Documentation

Overview

Package security manages:

  • Cache clearing (cache.go)
  • Privilege manipulation (privileges.go)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DropFilesystemCache added in v0.2.2

func DropFilesystemCache() error

DropFilesystemCache instructs the kernel to free the reclaimable inodes and dentries. This has the effect of making encrypted directories whose keys are not present no longer accessible. Requires root privileges.

func GetUids added in v0.2.6

func GetUids() (int, int, int)

GetUids gets the process's real, effective, and saved UIDs.

func SetProcessPrivileges added in v0.2.4

func SetProcessPrivileges(privs *Privileges) error

SetProcessPrivileges sets the privileges of the current process to have those specified by privs. The original privileges can be obtained by first saving the output of ProcessPrivileges, calling SetProcessPrivileges with the desired privs, then calling SetProcessPrivileges with the saved privs.

func SetUids added in v0.2.6

func SetUids(ruid, euid, suid int) error

SetUids sets the process's real, effective, and saved UIDs.

Types

type Privileges

type Privileges struct {
	// contains filtered or unexported fields
}

Privileges encapsulate the effective uid/gid and groups of a process.

func ProcessPrivileges added in v0.2.4

func ProcessPrivileges() (*Privileges, error)

ProcessPrivileges returns the process's current effective privileges.

func UserPrivileges added in v0.2.4

func UserPrivileges(user *user.User) (*Privileges, error)

UserPrivileges returns the default privileges for the specified user.

Jump to

Keyboard shortcuts

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