Skip to content

Local authorization

Authorizes a user request via the local user database of the host on which Bifröst is running.

Note

On Linux, this authorization requires Bifröst to run with root permissions.
On Windows, the default authorizedKeys path uses .user.homeDir, which requires LocalSystem to resolve the user's profile via S4U. For a custom path without .user.homeDir, Bifröst only needs permission to read the file. The Windows local environment also requires LocalSystem to start processes as the local account.

Properties

type

Authorization Type = "local"

Has to be set to local to enable the local authorization.

rememberMe

RememberMe = "forbidden"

Controls saved browser and SSH access. Resumption requires key-possession proof, the same account name and UID/SID, and current account and access checks. Missing required checks deny resumption; no password is saved or replayed. Registered SSH keys need not appear in authorized_keys. Windows requires LocalSystem and local SAM accounts; see Compatibility.

Warning

Saved access skips repeated password/MFA authentication. With PAM, the account stack must enforce the required restrictions; auth is not repeated.

remoteName

string Authorization Request = "{{.remote.user}}"

Account name used for native lookup and credential checks. The original requesting name remains unchanged in flow requirements and audit records. Mapping creates no account and grants no OS rights; see the example.

trustedUserCAs

OpenSSH public keys of certificate authorities that may sign user certificates for existing local users. The resolved remoteName must be included in the certificate's principals; by default this is the requesting name.

trustedUserCAsFile

Same as trustedUserCAs, but loaded from one file when the authorization is initialized. Both properties can be used together. A configured file must exist, contain at least one valid public key, and be no larger than 4 MiB.

authorizedKeys

["{{.user.homeDir}}/.ssh/authorized_keys"]

Contains files with the format of classic authorized keys, in which Bifröst will look for SSH Public Keys.

The request's .connection and the selected native .user are available; .remote.user remains the original requesting name.

An entry with the cert-authority option treats its key as a user certificate authority for that local user. The optional principals="..." option restricts it further. An empty authorizedKeys list does not disable certificate authentication through trustedUserCAs or trustedUserCAsFile.

User certificates must be current, signed by the selected CA, have the resolved remoteName as a principal, and contain no critical options. Missing permit-pty, permit-port-forwarding, or permit-agent-forwarding certificate extensions disable the corresponding capability. Authorized-key options can only restrict these capabilities further.

password

See below.

pamService

string = "<os and edition specific>"

If set to a non-empty value, this PAM service will be directly used during the authorization process instead of /etc/passwd and /etc/shadow.

Fresh PAM logins must pass authentication and account checks. Account denial, a required password change or an account-phase prompt rejects login; Bifröst does not change passwords or open a PAM session. The direct peer is supplied as PAM_RHOST.

On macOS this property must be non-empty. For supported platforms and editions, see Compatibility.

Default settings
linux/extended darwin/generic anything else
sshd sshd empty

Password

  • On Linux, passwords are validated via /etc/passwd and /etc/shadow when pamService is empty, or via PAM when it is set.
  • On macOS, a non-empty PAM service is required; there is no local password-repository fallback.
  • On Windows, password and keyboard-interactive authentication validate the password of an existing local SAM account. Windows account restrictions (such as disabled accounts or denied network logon) still apply. Domain and Microsoft Entra accounts are not supported by local authorization.

Properties

allowed

If true, the user is allowed to use passwords via classic password authentication.

interactiveAllowed

If true, the user is allowed to use passwords via interactive authentication.

emptyAllowed

If true, the user is allowed to use empty passwords.

Danger

Allowing empty passwords is not recommended.

Context

This authorization will produce a context of type Authorization Local.

Examples

Using OpenSSH Certificates

1
2
3
4
5
type: local
rememberMe: allowedAndEnabledByDefault
trustedUserCAsFile: /etc/engity/bifroest/trusted-user-cas
authorizedKeys:
  - "{{.user.homeDir}}/.ssh/authorized_keys"

Using Local accounts

1
2
3
4
5
6
7
8
9
flows:
  - name: local
    authorization:
      type: local
      rememberMe: allowedAndEnabledByDefault
    environment:
      type: local
      name: '{{ .authorization.user.name }}'
      uid: '{{ .authorization.user.uid }}'

RememberMe with PAM

Use an existing PAM service whose account stack enforces the required access restrictions:

1
2
3
type: local
rememberMe: allowedAndEnabledByDefault
pamService: bifroest

Login name with an SSH suffix

Authenticate SSH login foo@bar as the existing account foo, while keeping HTTP login names unchanged:

1
2
3
4
5
6
7
8
type: local
rememberMe: allowedAndEnabledByDefault
remoteName: >
  {{- if eq .connection.transport "ssh" -}}
    {{- regexReplaceAll "@[^@]+$" .remote.user "" -}}
  {{- else -}}
    {{- .remote.user -}}
  {{- end -}}

Flow requirements still match the original name: use requirement.ssh.includedRequestingName: '@bar$' for this suffix and, for example, requirement.http.includedSlug: '^docker$' for the browser link. Connect with ssh -l 'foo@bar' bifroest.example.org, or open /#docker and enter foo.

Compatibility

Feature linux darwin windows
PAM / / /
Password/interactive RememberMe without PAM / / /
RememberMe with PAM / / /
anything else / / /