# Inspecting and Editing File Security

_Peios / Using Peios / Permissions_

> Understand the scope of security-descriptor queries before changing access rules.

`sd` reads and edits security descriptors on files. A descriptor identifies an
owner and holds access, audit, and integrity information. Inspect the relevant
components before deciding which change addresses an access problem.

## A displayed descriptor is a selected view

`sd show` requests the owner, group, discretionary access control list (DACL),
and mandatory integrity-label view. It does not request the full system access
control list (SACL), which also contains audit rules.

Formatting switches do not widen that selection. The `--all` spelling does not
turn the query into a full export. Human and ordinary JSON summaries also omit
some access-control entry payload details.

Do not use `sd show --sddl` as a complete descriptor backup. It formats the
queried subset in security-descriptor definition language (SDDL). Matching two
summaries does not establish complete descriptor equality.

## Changes depend on the component

An allow or deny operation appends or replaces selected rules. Removing a
principal's rules removes both grants and denials for that principal, so it
can broaden access as well as narrow it. Rule order matters when rights are
decided.

An access-check simulation helps explain a possible decision without
performing the requested operation. It cannot reserve the object's state or
guarantee the outcome of a later open.

Ownership, audit rules, and integrity are distinct components with their own
access requirements. A change to one does not automatically supply the
authority needed to change another.

## Inheritance is stored state

Permitting inheritance lets a descriptor receive inheritable parent rules. It
does not create a live link that automatically updates existing children
whenever the parent changes. Propagation explicitly refreshes descendants.

Protected descendants retain their own rules. A propagation walk can report
individual failures and continue, so inspect the summary rather than assuming
the whole tree changed.

Recursive operations treat symbolic links as objects rather than descending
through them. A nonrecursive path normally follows the final link unless the
physical-link option is selected.

`sd(1)` owns principal syntax, permission names, component-selection rules,
and the exact subcommand interfaces.

## Make and verify a bounded change

Resolve the intended path and decide whether the final symlink or its target
is the object to change. Inspect the selected descriptor components and the
parent's inheritance before editing. State whether the goal concerns
ownership,
ordinary access, audit policy, or integrity; avoid replacing unrelated parts.

Choose the smallest supported operation, then read back the affected
components
and retry the original operation through a fresh handle. A recursive update
can partially succeed. Preserve individual failures, and do not treat a
matching
summary as full descriptor equality or as proof of application-level success.

Use the descriptor API instead of manipulating the sealed xattr directly.
Linux mode bits and `chmod` do not express the complete Peios policy. Missing
and corrupt descriptors need the kernel's documented repair contract; granting
a broad synthesis template is not a generic repair.
