# KACS

> Peios kernel kacs documentation.

All of KACS as one markdown file: [/kernel/internals/kacs/print.md](/kernel/internals/kacs/print.md)

## Start here

- [Overview](/kernel/internals/kacs/start-here/overview.md): KACS is the security core of Peios — an LSM inside PKM providing identity-based access control — and how it relates to MS-DTYP.
- [Boot and trust invariants](/kernel/internals/kacs/start-here/boot-and-trust-invariants.md): Boot and trust invariants: behaviour and implementation of the Peios kernel.

## Tokens

- [Tokens](/kernel/internals/kacs/tokens/overview.md): Find the Peios kernel articles about tokens.
- [The Token Model](/kernel/internals/kacs/tokens/the-token-model.md): A token is a thread's identity and security policy — how it relates to Linux credentials, primary against effective, and the evaluation context.
- [Token Structure](/kernel/internals/kacs/tokens/token-structure.md): Every token field by mutability class — fixed identity, adjustable privileges, one-way elevation — and what each carries.
- [Token Lifecycle](/kernel/internals/kacs/tokens/token-lifecycle.md): How tokens follow a process through fork, clone and exec — NEW_PROCESS_MIN, self-installation, bootstrap tokens and external tokens.
- [Token Creation](/kernel/internals/kacs/tokens/token-creation.md): The three operations that produce a token — CreateToken from nothing, DuplicateToken from another, FilterToken for a restricted one.
- [Token Adjustment](/kernel/internals/kacs/tokens/token-adjustment.md): What can be changed on a live token — privileges, groups, interactivity scope and object-creation defaults — and what cannot.
- [Linked Tokens and Elevation](/kernel/internals/kacs/tokens/linked-tokens-and-elevation.md): Two linked tokens for one principal — what the kernel does with the link, what it deliberately leaves to userspace, and the pair's lifecycle.
- [LogonSessions and Revocation](/kernel/internals/kacs/tokens/logonsessions-and-revocation.md): The LUID-identified object every token references — how sessions are created, how they expire, and how revocation propagates.
- [Token Access Rights](/kernel/internals/kacs/tokens/token-access-rights.md): Tokens are securable objects — obtaining a token file descriptor, the token-specific rights, the generic mapping and the default descriptor.

## Process security

- [Process security](/kernel/internals/kacs/process-security/overview.md): Find the Peios kernel articles about process security.
- [State and lifetime](/kernel/internals/kacs/process-security/state-and-lifetime.md): The per-process structure describing what a process is, independent of the principal running it.
- [PSB Fields](/kernel/internals/kacs/process-security/psb-fields.md): Every PSB field — the process GUID fixed at fork, the protection fields set at exec, the one-way mitigations and the UI access flag.
- [Process Security Descriptors](/kernel/internals/kacs/process-security/process-security-descriptors.md): The descriptor controlling who may operate on a process — the access rights, signal classification, what bypasses the check, and the default.

## Privileges

- [Privileges](/kernel/internals/kacs/privileges/overview.md): Find the Peios kernel articles about privileges.
- [The Privilege Model](/kernel/internals/kacs/privileges/the-privilege-model.md): Rights that do not fit the subject-object model — the privilege lifecycle, the two enforcement categories, intent gating, assignment and auditing.
- [Privilege Catalogue](/kernel/internals/kacs/privileges/privilege-catalogue.md): Every Peios privilege with the bit it occupies in the token's four privilege words, grouped by what it governs.

## Impersonation

- [Impersonation](/kernel/internals/kacs/impersonation/overview.md): Find the Peios kernel articles about impersonation.
- [Levels and admission](/kernel/internals/kacs/impersonation/levels-and-admission.md): The four levels at which a server thread may assume a client's identity, and what each permits.
- [State transitions](/kernel/internals/kacs/impersonation/state-transitions.md): State transitions: behaviour and implementation of the Peios kernel.
- [Transport and per-message identity](/kernel/internals/kacs/impersonation/transport-and-per-message-identity.md): Transport and per-message identity: behaviour and implementation of the Peios kernel.

## Executable trust

- [Executable trust](/kernel/internals/kacs/executable-trust/overview.md): Find the Peios kernel articles about executable trust.
- [Signature verification](/kernel/internals/kacs/executable-trust/signature-verification.md): Signature verification: behaviour and implementation of the Peios kernel.
- [Exec and library integrity](/kernel/internals/kacs/executable-trust/exec-and-library-integrity.md): Exec and library integrity: behaviour and implementation of the Peios kernel.
- [Firmware verification](/kernel/internals/kacs/executable-trust/firmware-verification.md): Firmware verification: behaviour and implementation of the Peios kernel.
- [Process integrity protection](/kernel/internals/kacs/executable-trust/process-integrity-protection.md): PIP protects objects through trust label ACEs and processes through a dominance test — where it is enforced, and the limits of what it can do.

## Access check

- [Access check](/kernel/internals/kacs/access-check/overview.md): Find the Peios kernel articles about access check.
- [AccessCheck Overview](/kernel/internals/kacs/access-check/accesscheck-overview.md): The function that connects tokens to descriptors — its two API variants, and the three state values a right can hold during evaluation.
- [The DACL Walk](/kernel/internals/kacs/access-check/the-dacl-walk.md): Walking the ACEs in order under first-writer-wins — SID matching, absent and empty DACLs, owner implicit rights and MAXIMUM_ALLOWED.
- [Mandatory Integrity Control](/kernel/internals/kacs/access-check/mandatory-integrity-control.md): MIC restricts what the DACL is allowed to grant along a vertical trust hierarchy — the labels, the policy bits, and the algorithm.
- [Restricted Tokens](/kernel/internals/kacs/access-check/restricted-tokens.md): The second pass a restricted token forces — when it runs, how privileges bypass it, and how owner rights and virtual groups behave in it.
- [Object ACEs and Property-Level Access](/kernel/internals/kacs/access-check/object-aces-and-property-level-access.md): Per-property access control through GUID-scoped ACEs — object type lists, propagation, PRINCIPAL_SELF, and per-node results.
- [Application Confinement](/kernel/internals/kacs/access-check/application-confinement.md): An absolute boundary a confined token cannot cross whatever the DACL says — normal and strict confinement, and where it sits in the order.
- [PIP in AccessCheck](/kernel/internals/kacs/access-check/pip-in-accesscheck.md): How a trust label ACE is evaluated — the label SID, the privileges it revokes, the algorithm, and where the compared values come from.
- [Central Access and Auditing Policy](/kernel/internals/kacs/access-check/central-access-and-auditing-policy.md): Policy defined once and referenced by objects — the policy structure, access and audit evaluation, the cache, and the recovery policy.
- [Auditing in AccessCheck](/kernel/internals/kacs/access-check/auditing-in-accesscheck.md): Auditing is purely observational and never changes a decision — access, continuous and privilege-use auditing, and per-token policy.
- [The Algorithm](/kernel/internals/kacs/access-check/the-algorithm.md): How every layer composes — the definitive statement of the evaluation order, from EvaluateSecurityDescriptor down through AccessCheckCore.

## File security

- [File security](/kernel/internals/kacs/file-security/overview.md): Find the Peios kernel articles about file security.
- [The Handle Model](/kernel/internals/kacs/file-security/the-handle-model.md): FACS is the file-specific enforcement surface of KACS — mount policy, scope, how a handle is acquired, and stacked backing files.
- [KACS-Native Open](/kernel/internals/kacs/file-security/kacs-native-open.md): Opening a file by naming every right up front — handle modes, rights granted through the parent, share access, create dispositions, the creator's access and what the open reports.
- [Legacy Open Compatibility](/kernel/internals/kacs/file-security/legacy-open-compatibility.md): Linux open flags cannot express WRITE_DAC or READ_CONTROL — how FACS maps them to core and compat rights, and what O_PATH does.
- [Use-Time Semantics](/kernel/internals/kacs/file-security/use-time-semantics.md): Every operation on an open descriptor is a mask check against the granted mask — data, metadata, traversal, append-only, fcntl and ioctl.
- [Descriptor storage and caching](/kernel/internals/kacs/file-security/descriptor-storage-and-caching.md): Descriptor storage and caching: behaviour and implementation of the Peios kernel.
- [Mount classes and bootstrap descriptors](/kernel/internals/kacs/file-security/mount-classes-and-bootstrap-descriptors.md): Mount classes and bootstrap descriptors: behaviour and implementation of the Peios kernel.
- [The Set-Security Interface](/kernel/internals/kacs/file-security/the-set-security-interface.md): The single syscall all descriptor modification flows through — ownership, integrity labels, the SeRestorePrivilege bypass and mandatory attributes.
- [Sharing and Deletion](/kernel/internals/kacs/file-security/sharing-and-deletion.md): NT share modes enforced for every process, delete-pending files, deletion and renaming through an open handle, and pinning a file's ancestors.
- [Byte-Range Locks](/kernel/internals/kacs/file-security/byte-range-locks.md): NT byte-range locks, kept by the kernel and enforced on every read and write — when they are checked, what they block, and the limit on who can block whom.
- [Leases](/kernel/internals/kacs/file-security/leases.md): NT caching leases kept by the kernel for a lease manager such as a file server — the read, handle and write states, what breaks them, and how breaks are delivered.
- [Special Attributes](/kernel/internals/kacs/file-security/special-attributes.md): The read-only flag KACS enforces for every process, and the settable Created At date, kept in the special-attributes extended attribute.

## Linux credentials

- [Linux credentials](/kernel/internals/kacs/linux-credentials/overview.md): Find the Peios kernel articles about linux credentials.
- [DAC Neutralisation](/kernel/internals/kacs/linux-credentials/dac-neutralisation.md): Linux evaluates DAC before any LSM hook fires, so KACS has to neutralise it — the capability switchboard, the compatibility state and the LSM stack.
- [setuid Behaviour](/kernel/internals/kacs/linux-credentials/setuid-behaviour.md): Under KACS a UID has no security properties — what the setuid syscalls do, what the setuid bit does at exec, and the compatibility gaps that remain.
- [Netlink](/kernel/internals/kacs/linux-credentials/netlink.md): Netlink requests are authorised through the capability switchboard — both the socket opener's token and the sender's — synchronously, in the sender's own context.

## System V IPC

- [System V IPC](/kernel/internals/kacs/system-v-ipc/overview.md): Find the Peios kernel articles about system v ipc.
- [Objects and Their Descriptors](/kernel/internals/kacs/system-v-ipc/objects-and-their-descriptors.md): Every System V message queue, shared memory segment and semaphore array carries a security descriptor, stamped at creation and enforced through the LSM IPC hooks.

## Network objects

- [Network objects](/kernel/internals/kacs/network-objects/overview.md): Find the Peios kernel articles about network objects.
- [Port Reservations](/kernel/internals/kacs/network-objects/port-reservations.md): Binding a TCP or UDP port is an access check against a reservation — a security descriptor keyed by protocol and port range, read from the registry — not a privilege test against a port number.
- [Socket Identity](/kernel/internals/kacs/network-objects/socket-identity.md): The governing identity KACS stamps on every inet socket for network policy — which token, taken when, and how the engine reads it.

## Mount namespaces

- [Mount namespaces](/kernel/internals/kacs/mount-namespaces/overview.md): Find the Peios kernel articles about mount namespaces.
- [A Private Mount Table](/kernel/internals/kacs/mount-namespaces/a-private-mount-table.md): A mount namespace is a KACS object — any process may create one without privilege, and what it may then do to its own mount table is decided by the namespace's security descriptor, not by a capability manufactured in a user namespace.

## Auditing

- [Auditing](/kernel/internals/kacs/auditing/overview.md): Find the Peios kernel articles about auditing.
- [Event families and delivery](/kernel/internals/kacs/auditing/event-families-and-delivery.md): The audit records KACS emits through KMES — the event families, their shared payload records, and how they are delivered.

## Integration

- [Integration](/kernel/internals/kacs/integration/overview.md): Find the Peios kernel articles about integration.
- [LSM hooks and object state](/kernel/internals/kacs/integration/lsm-hooks-and-object-state.md): The KACS security blobs, registered Linux Security Module hooks, and direct entry points at patched file-metadata call sites.
