rootless

package
v3.0.0-rc43 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package rootless is the accounts a namespace may run rootless containers as.

A rootless container runs its podman commands as the unix account its rootless_user keyword names, and as the group rootless_group names, or the primary group of the account. The account owns the container, its image store and its files, so an account is a boundary: whoever runs a container as it reaches everything else that account owns on the node, the rootless containers of other objects included.

Which accounts are the namespace's to use is not the namespace's to decide, so the namespace configuration lists them, and only the squatter writes it:

[DEFAULT]
rootless_users = web-ns1
rootless_groups = web-ns1

A namespace listing none has no account to run rootless containers as. An allowed user allows its primary group. The root account and the root group are never allowed, whatever the lists say.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DescribeShared

func DescribeShared(shared map[string][]string) string

DescribeShared says the namespaces sharing the accounts of a namespace, for a warning.

Types

type Allowed

type Allowed struct {
	Namespace string
	Users     []string
	Groups    []string
}

Allowed is what a namespace lists, as written.

func Load

func Load(namespace string) (Allowed, error)

Load reads what a namespace allows from its configuration on this node, and allows nothing for a namespace whose configuration this node does not hold.

It is read from the node and never over the api, as a claim is: a namespace configuration is on every node.

func (Allowed) Check

func (a Allowed) Check(userName, groupName string) error

Check says why a namespace may not run a container as the user and the group given, and nil when it may. An empty user is a rootful container, which is not an account of the namespace.

The ids are compared, not the names: an account allowed by name is the same account named by its uid, and a name resolving to another uid on another node is another account there.

func (Allowed) SharedWith

func (a Allowed) SharedWith() (map[string][]string, error)

SharedWith returns the other namespaces allowing one of the users this one allows, by the uid they share.

Two namespaces running containers as the same account reach each other's containers, images and files, which is allowed, the squatter deciding it, and said.

Jump to

Keyboard shortcuts

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