Peios Learn
Products
PePeios pkpekit PvProvium UDUniversal Directory TrTrail PrProject WiWispist
Using Peios Security Basics Technical Documentation Source
Using Peios Security Basics Technical Documentation Source
Peios

Constants and Catalogs

Single-page view · as markdown

Constants and catalogs

Peios / Using Peios / Constants and Catalogs

Numeric constants — right bits, type values, enum members, limits — are catalogued in exactly one place each. This topic is either that place or a pointer to it.

What lives here #

PageHolds
Access mask bitsPer-object-type rights for files, processes, tokens, registry keys and services; the GenericMapping tables; the *_ALL_ACCESS and STANDARD_RIGHTS_* aggregates.
Other constantsImpersonation levels, integrity levels, logon types, elevation types, PIP tiers, audit policy flags, create dispositions, SECURITY_INFORMATION flags, and the kernel's size limits.

What lives elsewhere #

Three catalogues are owned by documents that also define their semantics, and are not duplicated here.

CatalogueCanonical home
ACE types, ACE flags, and their numeric valuesPCDS §5.4 — see ACE types and flags
Well-known SIDsPCDS §4.4 — see Well-known SIDs
Every privilege, with its LUID bitPeios Kernel TRM §3.4.2 — see Privilege catalog

The three pages above are signposts. Following one gets you to the table.

Note

A constant with two spellings is listed under the name you would meet it by. Where a header and a specification disagree — and they do, for impersonation levels, create dispositions and the group attribute flags — the page says so and names both. The full mapping is the Peios Kernel TRM §3.A.

Related catalogues #

  • Every event type the system emits: the Peios Events Index.
  • Every audit event's payload schema: the same book, chapters 3 to 8.

Well-known SIDs

Peios / Using Peios / Constants and Catalogs

The well-known SID catalogue is PCDS §4.4, in the Peios Core Data Structures specification. It is normative there, and is not duplicated here.

It covers the universal SIDs (S-1-1-0 Everyone, S-1-3-0 CREATOR OWNER, and the rest), the NT authority SIDs under S-1-5, the BUILTIN groups under S-1-5-32, domain SID structure, integrity label SIDs under S-1-16, capability SIDs under S-1-15, service SIDs under S-1-5-80, and the PIP trust labels under S-1-19.

For the conceptual treatment — which principals matter and why — read Well-known principals.

A note on the BUILTIN range #

PCDS lists the BUILTIN groups KACS assigns meaning to. It deliberately does not enumerate S-1-5-32-547 through S-1-5-32-583, which Active Directory defines: KACS gives them no special semantics, and they participate in ACE matching like any other group SID.

An older revision of this reference tabulated them. That table was removed on purpose, not lost — enumerating names the system does not act on implies a behaviour that does not exist.

PIP trust labels #

The S-1-19-T-L ladder encodes two dimensions: T is the PIP type axis, L the trust axis. Dominance requires both to be greater than or equal.

The numeric tiers are in Other constants, and the full SID list is in PCDS §4.4. The mechanism is Process integrity protection.

Privilege catalog

Peios / Using Peios / Constants and Catalogs

The per-privilege catalogue — every name, its LUID bit position, and what it does — is in the Peios Kernel TRM §3.4.2, "Catalogue". It is not duplicated here.

The conceptual treatment is Privileges, and the four-category model is Categories.

Five privileges influence an access check #

Only five can contribute bits to a granted mask, and therefore only five can appear in a privilege-use event:

  • SeSecurityPrivilege
  • SeTakeOwnershipPrivilege
  • SeBackupPrivilege
  • SeRestorePrivilege
  • SeRelabelPrivilege

Any other bit fails the audit encoder closed rather than emitting an unnamed privilege. See the Events Index §3.3.

Two are enforced but not nameable #

SeTakeOwnershipPrivilege and SeRelabelPrivilege are enforced by KACS but absent from the published privilege table, so they cannot be named in a service's RequiredPrivileges. A service needing either declares nothing and takes its source token's defaults, or fails to start if it tries to name one.

That asymmetry is peinit's, not the kernel's — see the peinit TRM §4.5.

ACE types and flags

Peios / Using Peios / Constants and Catalogs

The ACE catalogue is PCDS §5.4, in the Peios Core Data Structures specification. It is normative there, and is not duplicated here.

It covers every AceType value from 0x00 to 0x15 — the body layout of each family, the AceFlags bits, and the ACL revision rules that constrain which types may appear.

Twenty of those values have behaviour. Two do not: 0x04 (ACCESS_ALLOWED_COMPOUND_ACE, never implemented anywhere) and 0x15 (SYSTEM_ACCESS_FILTER_ACE, an MS-DTYP type Peios has not implemented). Both are named by the kernel ABI so that a decoder can label the byte, but neither affects an access decision: they are skipped when the descriptor is evaluated and preserved unchanged when it is written back. sd has no name for either and prints them as OTHER(0x04) and OTHER(0x15).

Two names per type #

PCDS names both the ACE structure and the AceType constant that selects it, because a reader may arrive with either — one from a declaration, the other from a hex dump. ACCESS_ALLOWED_ACE is the structure; ACCESS_ALLOWED_ACE_TYPE is the constant whose value is 0x00.

The headers use a third spelling, moving the qualifier to the front: KACS_ACE_TYPE_ACCESS_ALLOWED. The Peios Kernel TRM §3.A maps the two vocabularies.

Inheritance flags #

The four propagation flags and the INHERITED_ACE provenance flag are catalogued with the inheritance algorithm in PCDS §5.6, rather than with the type values.

MIC policy bits #

The mask of a SYSTEM_MANDATORY_LABEL_ACE carries policy bits saying what a non-dominant caller may not do. Those bits are in PCDS §5.4 alongside the ACE type; the mechanism is Mandatory integrity control.

Access mask bits

Peios / Using Peios / Constants and Catalogs

The 32-bit access mask has the same shape for every object type. Bits 0–15 are object-specific, 16–20 are standard rights, 24–25 are special, 28–31 are generic. The standard, special and generic regions are uniform; the object-specific bits carry different meanings for different object types.

This page is the catalogue of right values. What the mask means — how it is evaluated, how generic bits expand — is PCDS §5.3, which is normative. The bit layout of the mask within a descriptor is PCDS §5.1.

Bit rangeRegionExamples
0–15Object-specificFILE_READ_DATA, PROCESS_TERMINATE, TOKEN_QUERY
16–20Standard rightsDELETE, READ_CONTROL, WRITE_DAC, WRITE_OWNER, SYNCHRONIZE
21–23ReservedRejected at parse. PCDS §5.3.
24–25SpecialACCESS_SYSTEM_SECURITY, MAXIMUM_ALLOWED
26–27ReservedRejected at parse.
28–31GenericGENERIC_ALL, GENERIC_EXECUTE, GENERIC_WRITE, GENERIC_READ

File access rights #

RightValueFor filesFor directories (alias)
FILE_READ_DATA0x0001Read file contentFILE_LIST_DIRECTORY — list entries
FILE_WRITE_DATA0x0002Write file contentFILE_ADD_FILE — create files
FILE_APPEND_DATA0x0004Append-only writeFILE_ADD_SUBDIRECTORY — create subdirectory
FILE_READ_EA0x0008Read extended attributesSame
FILE_WRITE_EA0x0010Write extended attributesSame
FILE_EXECUTE0x0020Execute fileFILE_TRAVERSE — traverse through
FILE_DELETE_CHILD0x0040(not applicable)Delete children regardless of their permissions
FILE_READ_ATTRIBUTES0x0080Read attributesSame
FILE_WRITE_ATTRIBUTES0x0100Write attributesSame

The directory names are aliases: identical bit values, different naming convention depending on whether the object is a file or a directory.

File GenericMapping #

Generic rightMaps to
GENERIC_READFILE_READ_DATA | FILE_READ_ATTRIBUTES | FILE_READ_EA | READ_CONTROL | SYNCHRONIZE
GENERIC_WRITEFILE_WRITE_DATA | FILE_APPEND_DATA | FILE_WRITE_ATTRIBUTES | FILE_WRITE_EA | READ_CONTROL | SYNCHRONIZE
GENERIC_EXECUTEFILE_EXECUTE | FILE_READ_ATTRIBUTES | READ_CONTROL | SYNCHRONIZE
GENERIC_ALLEvery file-specific bit, plus DELETE, READ_CONTROL, WRITE_DAC, WRITE_OWNER, SYNCHRONIZE

FILE_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FF = 0x001F01FF.

Process access rights #

RightValueMeaning
PROCESS_TERMINATE0x0001Send terminating signals.
PROCESS_SIGNAL0x0002Send non-terminating informational signals — SIGCHLD, SIGURG, SIGWINCH.
PROCESS_VM_READ0x0010Read process memory — ptrace(PTRACE_PEEK*), process_vm_readv, /proc/<pid>/mem reads.
PROCESS_VM_WRITE0x0020Write process memory — ptrace(PTRACE_POKE*, ATTACH), process_vm_writev.
PROCESS_DUP_HANDLE0x0040Duplicate file descriptors out via pidfd_getfd.
PROCESS_SET_INFORMATION0x0200Change process attributes — priority, affinity, rlimits, /proc/<pid>/* writes.
PROCESS_QUERY_INFORMATION0x0400Detailed process info — token, full /proc/<pid>/* reads.
PROCESS_SUSPEND_RESUME0x0800Send stop and continue signals.
PROCESS_QUERY_LIMITED0x1000Basic info — PID, image name, state. Required by pidfd_open.

Bits 0x0004, 0x0008, 0x0080 and 0x0100 are unused.

Process GenericMapping #

Generic rightMaps to
GENERIC_READPROCESS_QUERY_INFORMATION | PROCESS_VM_READ | READ_CONTROL
GENERIC_WRITEPROCESS_SET_INFORMATION | PROCESS_VM_WRITE | WRITE_DAC
GENERIC_EXECUTEPROCESS_TERMINATE | PROCESS_SUSPEND_RESUME | PROCESS_QUERY_LIMITED
GENERIC_ALLAll process-specific bits, plus STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE

PROCESS_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE | 0x1FFF = 0x001F1FFF.

Token access rights #

RightValueMeaning
TOKEN_ASSIGN_PRIMARY0x0001Install as a process's primary token.
TOKEN_DUPLICATE0x0002Create a copy.
TOKEN_IMPERSONATE0x0004Install as a thread's impersonation token.
TOKEN_QUERY0x0008Read token information.
TOKEN_QUERY_SOURCE0x0010Subsumed by TOKEN_QUERY. Reserved for format compatibility.
TOKEN_ADJUST_PRIVILEGES0x0020Enable, disable or remove privileges.
TOKEN_ADJUST_GROUPS0x0040Enable or disable groups.
TOKEN_ADJUST_DEFAULT0x0080Change default DACL, owner index, primary group index.
TOKEN_ADJUST_SESSIONID0x0100Change interactive_session_id. Additionally requires SeTcbPrivilege.

TOKEN_QUERY_SOURCE is a documented bit position rather than an enforced right: a token fd granting TOKEN_QUERY suffices for everything, and TOKEN_QUERY_SOURCE is not separately checked.

Token GenericMapping #

Generic rightMaps to
GENERIC_READTOKEN_QUERY | READ_CONTROL
GENERIC_WRITETOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS | TOKEN_ADJUST_DEFAULT | WRITE_DAC
GENERIC_EXECUTETOKEN_IMPERSONATE
GENERIC_ALLTOKEN_ALL_ACCESS

TOKEN_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED | 0x01FF = 0x000F01FF. Note the absence of SYNCHRONIZE, unlike the file and process aggregates.

Registry-key access rights #

RightValueMeaning
KEY_QUERY_VALUE0x0001Read a value.
KEY_SET_VALUE0x0002Write a value.
KEY_CREATE_SUB_KEY0x0004Create a subkey.
KEY_ENUMERATE_SUB_KEYS0x0008Enumerate subkeys.
KEY_NOTIFY0x0010Watch for changes.
KEY_CREATE_LINK0x0020Create a symbolic link to another key.

Bits from 0x0040 upward are reserved.

Registry GenericMapping #

Generic rightMaps to
GENERIC_READKEY_QUERY_VALUE | KEY_ENUMERATE_SUB_KEYS | KEY_NOTIFY | READ_CONTROL
GENERIC_WRITEKEY_SET_VALUE | KEY_CREATE_SUB_KEY | READ_CONTROL
GENERIC_EXECUTEREAD_CONTROL
GENERIC_ALLAll key-specific bits, plus STANDARD_RIGHTS_REQUIRED | SYNCHRONIZE

Service access rights #

RightValueMeaning
SERVICE_QUERY_CONFIG0x0001Read configuration.
SERVICE_CHANGE_CONFIG0x0002Modify configuration.
SERVICE_QUERY_STATUS0x0004Read runtime status.
SERVICE_ENUMERATE_DEPENDENTS0x0008List dependent services.
SERVICE_START0x0010Start the service.
SERVICE_STOP0x0020Stop the service.
SERVICE_PAUSE_CONTINUE0x0040Pause and resume.
SERVICE_INTERROGATE0x0080Request a status update.
SERVICE_USER_DEFINED_CONTROL0x0100Send service-specific control codes.

Standard, special and generic rights #

RightValue
DELETE0x00010000
READ_CONTROL0x00020000
WRITE_DAC0x00040000
WRITE_OWNER0x00080000
SYNCHRONIZE0x00100000
ACCESS_SYSTEM_SECURITY0x01000000
MAXIMUM_ALLOWED0x02000000
GENERIC_ALL0x10000000
GENERIC_EXECUTE0x20000000
GENERIC_WRITE0x40000000
GENERIC_READ0x80000000

The STANDARD_RIGHTS aggregates #

ConstantValueComposition
STANDARD_RIGHTS_REQUIRED0x000F0000DELETE | READ_CONTROL | WRITE_DAC | WRITE_OWNER
STANDARD_RIGHTS_READ0x00020000Alias of READ_CONTROL
STANDARD_RIGHTS_WRITE0x00020000Alias of READ_CONTROL
STANDARD_RIGHTS_EXECUTE0x00020000Alias of READ_CONTROL
STANDARD_RIGHTS_ALL0x001F0000All five standard rights

Three of these are the same value. STANDARD_RIGHTS_READ, _WRITE and _EXECUTE are all aliases of READ_CONTROL, which surprises people reading a mask and expecting them to differ. Only STANDARD_RIGHTS_REQUIRED and STANDARD_RIGHTS_ALL name distinct values.

STANDARD_RIGHTS_REQUIRED is the conventional minimum included in every *_ALL_ACCESS aggregate.

Other constants

Peios / Using Peios / Constants and Catalogs

Enumerated values that are not access rights. Access rights are catalogued separately in Access mask bits.

Note

Names here are the ones uapi/pkm/ declares, because that is where a reader meets them. Several were published under different spellings in older design documents; where that is so, this page says which. The Peios Kernel TRM §3.A carries the full mapping.

Impersonation levels #

A token's impersonation level. The conceptual model is Impersonation levels.

ConstantValueMeaning
KACS_IMLEVEL_ANONYMOUS0No identity.
KACS_IMLEVEL_IDENTIFICATION1Inspect only. Cannot be used for an access check.
KACS_IMLEVEL_IMPERSONATION2Act as the client locally. The default.
KACS_IMLEVEL_DELEGATION3Act as the client locally, and forward credentials to remote machines.

Older documents spell these KACS_LEVEL_*. That spelling does not exist in any header.

A primary token reports level 0.

Integrity levels #

The RIDs used in S-1-16-* SIDs and in a token's integrity_level field. The model is Mandatory integrity control.

ConstantRIDName
INTEGRITY_LEVEL_UNTRUSTED0Untrusted
INTEGRITY_LEVEL_LOW4096Low
INTEGRITY_LEVEL_MEDIUM8192Medium
INTEGRITY_LEVEL_HIGH12288High
INTEGRITY_LEVEL_SYSTEM16384System

Spaced by 4096, so future levels can be inserted between existing ones.

These are named levels, not a closed enum. The integrity level is the S-1-16 SID's single sub-authority as an unsigned integer, compared numerically. Any such value is valid, and non-standard ones appear in Windows-interop descriptors — medium-plus at 8448, protected at 20480. Code that switches on the five names will mishandle those.

Mandatory policy flags #

A token's mandatory_policy field. Both are immutable after token creation.

FlagValueMeaning
NO_WRITE_UP0x01MIC blocks write-category access from lower integrity.
NEW_PROCESS_MIN0x02At exec, lower the token's integrity to match the binary if the binary is lower.

Logon types #

A session's logon_type field. The model is Logon types.

ConstantValueMeaning
LOGON_TYPE_INTERACTIVE2Console, SSH, terminal services.
LOGON_TYPE_NETWORK3Network resource access — SMB, RPC, federated.
LOGON_TYPE_BATCH4Scheduled job.
LOGON_TYPE_SERVICE5Service running under a specific principal.
LOGON_TYPE_NETWORK_CLEARTEXT8Network logon with a cleartext credential.
LOGON_TYPE_NEW_CREDENTIALS9Keep the local identity; use alternative credentials outbound.

Values 1, 6, 7 and 10 upward are reserved.

Elevation types #

A token's elevation_type field.

ConstantValueMeaning
KACS_ELEVATION_DEFAULT1Not part of a linked pair.
KACS_ELEVATION_FULL2The elevated half of a linked pair.
KACS_ELEVATION_LIMITED3The non-elevated half.

PIP tiers #

A process's PSB pip_type field.

ValueMeaning
0None. Unprotected, the default for unsigned binaries.
512Protected. Standard PIP protection.
1024Isolated. Reserved; no signing key targets it.

There are no public constants for these. Nothing in uapi/pkm/ names the tiers, and PIP_TYPE_NONE / _PROTECTED / _ISOLATED — which older documents use — exist nowhere in the tree. Protected survives only as the kernel-private PKM_KACS_PIP_TYPE_PROTECTED.

A program reasoning about tiers compares the numbers. The Peios Kernel TRM §3.7 says the same.

Token audit policy flags #

A token's audit_policy field. These are what force the audit events in the Events Index.

FlagValueMeaning
OBJECT_ACCESS_SUCCESS0x01Force an audit event on every successful access.
OBJECT_ACCESS_FAILURE0x02Force an audit event on every failed access.
PRIVILEGE_USE_SUCCESS0x04Emit a privilege-use event when a privilege's bits survive.
PRIVILEGE_USE_FAILURE0x08Emit a privilege-use event when its bits are stripped.

Create dispositions #

For kacs_open.

ConstantValueBehaviour
KACS_DISPOSITION_SUPERSEDE0If it exists, delete and recreate; otherwise create.
KACS_DISPOSITION_OPEN1If it exists, open; otherwise fail with ENOENT.
KACS_DISPOSITION_CREATE2If it exists, fail with EEXIST; otherwise create.
KACS_DISPOSITION_OPEN_IF3If it exists, open; otherwise create.
KACS_DISPOSITION_OVERWRITE4If it exists, truncate and open; otherwise fail with ENOENT.
KACS_DISPOSITION_OVERWRITE_IF5If it exists, truncate and open; otherwise create.

Older documents spell these KACS_FILE_SUPERSEDE, KACS_FILE_OPEN and so on. That spelling does not exist in any header.

SECURITY_INFORMATION flags #

For kacs_get_sd and kacs_set_sd. Declared as KACS_SECINFO_*; the names below are the MS-DTYP spellings PCDS uses.

FlagValueRight to readRight to write
OWNER_SECURITY_INFORMATION0x01READ_CONTROLWRITE_OWNER
GROUP_SECURITY_INFORMATION0x02READ_CONTROLWRITE_OWNER
DACL_SECURITY_INFORMATION0x04READ_CONTROLWRITE_DAC
SACL_SECURITY_INFORMATION0x08ACCESS_SYSTEM_SECURITYACCESS_SYSTEM_SECURITY
LABEL_SECURITY_INFORMATION0x10READ_CONTROLWRITE_OWNER, plus the integrity rules

SACL_SECURITY_INFORMATION and LABEL_SECURITY_INFORMATION are mutually exclusive in one call.

Process mitigation flags #

The KACS_MIT_* flags on the PSB. The catalogue of what each one gates is Process mitigations.

Size and count limits #

LimitValueContext
Max SD size65,535 bytesAny SD blob. Normative in PCDS §5.1.
Max ACL size64 KBAny ACL within an SD
Max single ACE size64 KBBounded by the ACL size
Min SID size8 bytesRevision, count and authority, no sub-authorities
Max SID size68 bytes15 sub-authorities
Max token wire spec64 KBkacs_create_token input
Max session wire spec4096 byteskacs_create_session input
Max CAAP wire spec256 KBkacs_set_caap input
Max CAAP rules per policy256
Max applies-to expression64 KBPer CAAP rule
Max conditional stack depth1024Evaluator limit
Max TLP cache entries64Trusted Library Path prefixes
Max TLP path length4096 bytesPer prefix
Max mount template SD64 KBkacs_set_mount_policy template

Peios Learn — documentation for the Peios project.

Built with Trail.