Skip to content

feat(audit): more flatpak checks, adjust warning severity, JSON support#1057

Merged
RoyalOughtness merged 10 commits intosecureblue:livefrom
HastD:audit-flatpak-permissions
May 25, 2025
Merged

feat(audit): more flatpak checks, adjust warning severity, JSON support#1057
RoyalOughtness merged 10 commits intosecureblue:livefrom
HastD:audit-flatpak-permissions

Conversation

@HastD
Copy link
Copy Markdown
Collaborator

@HastD HastD commented May 15, 2025

Flatpaks are now checked for a list of dangerous filesystem access permissions, permissions that grant the ability to acquire arbitrary permissions, more device permissions, SSH agent permissions, and PulseAudio permissions. The flatpak permission checks also have a new NOTICE status used for some detected permissions, and the code has been separated out into its own audit_flatpak module and refactored to reduce code duplication.

Kernel argument checks have been separated into kargs automatically set by ujust set-kargs-hardening (which give a failure status if not present) and optional/unstable kargs (which only give a warning if not present), and alphabetized within each list.

The script now supports a --json (or -j) option to produce JSON output.

The formatting of the output has also been improved: the output is a little wider (up to 100 columns) when the terminal size allows for it, and ellipses rather than spaces are used for padding to make it easier to visually trace between a description and the corresponding status.

RoyalOughtness
RoyalOughtness previously approved these changes May 19, 2025
RoyalOughtness
RoyalOughtness previously approved these changes May 19, 2025
HastD added 8 commits May 23, 2025 15:06
Flatpaks are now checked for "home" or "host" filesystem access,
permissions that grant the ability to acquire arbitrary permissions,
more device permissions, and PulseAudio permissions.

Kernel argument checks have been separated into kargs automatically set
by `ujust set-kargs-hardening` (which give a failure status if not
present) and optional/unstable kargs (which only give a warning if not
present).

A new status, `CAUTION`, has been added to allow for more fine-grained
feedback on flatpak permissions, and the warning level for various
flatpak permissions has been adjusting accordingly.

The script now supports a `--json` (or `-j`) option to produce JSON output.

Signed-off-by: Daniel Hast <[email protected]>
* Check for filesystem=xdg-cache, xdg-config, xdg-data permissions.
* Improve filesystem permissions parsing.
* Make session-bus, system-bus permissions a FAILURE.
* Make device=usb permissions a WARNING.

Also, a few minor style/formatting changes:
* Alphabetize karg checks for readability.
* Make punctuation consistent in recommendations.
* Remove extra '...' from reports.
The new class PermissionCheck encodes the necessary data for many basic
permission checks, allowing a lot of repetitive code to be factored out.

Also, parsing of flatpak permissions has been made more robust.
@RoyalOughtness RoyalOughtness enabled auto-merge (squash) May 24, 2025 23:51
@RoyalOughtness RoyalOughtness merged commit ff632dd into secureblue:live May 25, 2025
15 checks passed
@HastD HastD deleted the audit-flatpak-permissions branch May 25, 2025 00:31
RoyalOughtness pushed a commit to RoyalOughtness/secureblue-dev that referenced this pull request Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants