Skip to content

docs/explanation/security: add authentication and authorization section#193

Open
ernestl wants to merge 18 commits intocanonical:mainfrom
ernestl:ernestl/ssdlc-security-policy-update-2
Open

docs/explanation/security: add authentication and authorization section#193
ernestl wants to merge 18 commits intocanonical:mainfrom
ernestl:ernestl/ssdlc-security-policy-update-2

Conversation

@ernestl
Copy link
Member

@ernestl ernestl commented Mar 16, 2026

Follow up of WIP #179 that was accidentally merged early.

Please also look at provide feedback on #179.

Copy link

@pedronis pedronis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did a first pass


A Linux system user is a standard user account on the host operating system.

System users are uniquely identified by their system username. Snapd may associate a Linux system user with a snapd user so that API requests originating from that account can be authenticated and authorized.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they can also be identified by their user id, both are unique

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to ...system username or user ID (UID)


System users are uniquely identified by their system username. Snapd may associate a Linux system user with a snapd user so that API requests originating from that account can be authenticated and authorized.

In managed environments such as Ubuntu Core systems, Linux system users may be created based on system user assertions signed by the device brand or retrieved from the Snap Store.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the last bit is strange, I would drop the "retrieved from" bit, I don't think it's true

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was referring to this https://github.com/canonical/snapd/blob/master/overlord/devicestate/users.go#L75.

I have now clarified: In managed environments such as Ubuntu Core systems, Linux system users may be created from system-user assertions signed by the device brand, or from user information retrieved from the Snap Store for a given store user email address.


This file contains the snapd user identity and authentication tokens. Clients such as the snap command-line tool read this file and include the relevant credentials when making requests to the snapd API.

These credentials allow snapd to authenticate subsequent API requests and perform operations on behalf of the user.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to be a bit more clear where API means snapd API vs store API. I would also "on behalf"/"for", unless you are thinking of store operations?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to "...snapd API requests and perform operations for the user."


## Interface-based authorization

Some API operations require that specific snap interfaces are connected.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

..., this is relevant for operation requested by snaps over the snap API access socket.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work? Some API operations requested by snaps via the snap API access socket require that specific snap interfaces are connected.

@ernestl ernestl requested a review from bboozzoo March 17, 2026 10:54
@ernestl ernestl requested review from bboozzoo, Copilot and pedronis and removed request for degville March 23, 2026 11:12
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR extends the Sphinx/MyST security documentation by adding new pages/sections covering snapd API authentication/authorization and snapd decommissioning, and by expanding existing security policy documentation (including cryptography provenance and security maintenance lifecycle details). The PR description references a follow-up to PR #179, but this review is limited to the diffs included here.

Changes:

  • Add new “API authentication and authorization” and “Decommissioning” explanation pages and link them from the security index.
  • Expand security-policies.md with cryptography provenance notes and a new “Security maintenance” section; fix a few formatting issues in refresh awareness text.
  • Add a dedicated anchor in data-locations.md for “Persisted data on Ubuntu Core” and update cross-references to point to it.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
docs/reference/administration/data-locations.md Adds an anchor label for the Ubuntu Core persisted data section to support more specific cross-references.
docs/explanation/security/snap-confinement.md Adjusts the Classic confinement link (currently in a way that likely breaks the reference).
docs/explanation/security/security-policies.md Adds cryptography provenance + security maintenance content; updates cross-references and refresh awareness formatting.
docs/explanation/security/index.md Adds nav links/toctree entries for the new security pages (currently with a toctree filename mismatch).
docs/explanation/security/decomissioning.md Introduces decommissioning guidance (currently has label whitespace + typos + structure issues, and filename spelling mismatch).
docs/explanation/security/api-authentication-and-authorization.md Introduces API auth/authz overview content, including auth data location and authorization mechanisms.


If required, root and other user data should be manually removed by wiping `/root/snap/` and `/root/.snap/` as well as `/home/$USER/snap/` and `/home/$USER/.snap/`.

## Removing journal logs
Copy link

Copilot AI Mar 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Removing journal logs" is at ## level while the preceding removal steps are ### subsections under "Classic systems". This breaks the page structure; it should likely be a ### subsection as well (or the earlier subsections should be promoted consistently).

Suggested change
## Removing journal logs
### Removing journal logs

Copilot uses AI. Check for mistakes.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this likely needs fixing

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link

@bboozzoo bboozzoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, assuming comments from copilot are addressed

The authenticated identity is persisted in:

```console
<home>/.snap/auth.json

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$HOME is probably more in line with using $USER elsewhere


If required, root and other user data should be manually removed by wiping `/root/snap/` and `/root/.snap/` as well as `/home/$USER/snap/` and `/home/$USER/.snap/`.

## Removing journal logs

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this likely needs fixing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants