Skip to content

feat(ujust harden-flatpak): rewrite script to check app ID and existing overrides#1069

Merged
RoyalOughtness merged 8 commits intosecureblue:livefrom
HastD:harden-flatpak
Jun 4, 2025
Merged

feat(ujust harden-flatpak): rewrite script to check app ID and existing overrides#1069
RoyalOughtness merged 8 commits intosecureblue:livefrom
HastD:harden-flatpak

Conversation

@HastD
Copy link
Copy Markdown
Collaborator

@HastD HastD commented May 24, 2025

  • If the app ID does not match an installed flatpak, instead of creating overrides for a nonexistent app, do a case-insensitive search for the provided string among app IDs of installed flatpaks. If none is found, exit; if some are found, prompt the user to select one. This also means you can do something like ujust harden-flatpak libreoffice and it'll find the full app ID for you (and prompt you for confirmation).
  • If hardened_malloc is applied globally, just remove the app's local overrides that block hardened_malloc instead of adding new overrides.

@HastD HastD requested a review from RoyalOughtness as a code owner May 24, 2025 21:28
@HastD HastD changed the title fix: rewrite ujust harden-flatpak to check app ID and existing overrides feat(ujust): rewrite ujust harden-flatpak to check app ID and existing overrides May 25, 2025
@HastD HastD force-pushed the harden-flatpak branch from 7d9ea55 to 3cbfe5d Compare May 25, 2025 12:18
@HastD HastD changed the title feat(ujust): rewrite ujust harden-flatpak to check app ID and existing overrides feat(ujust harden-flatpak): rewrite script to check app ID and existing overrides May 25, 2025
@HastD HastD force-pushed the harden-flatpak branch from 3cbfe5d to 6124cdf Compare May 31, 2025 21:50
HastD added 5 commits May 31, 2025 20:18
* Give an error if the app ID does not match an installed flatpak.
* If hardened_malloc is applied globally, just remove the app's local
  overrides that block hardened_malloc instead of adding new overrides.
* If hardened_malloc is not applied globally, inform the user of this
  and that it's recommended to enable it globally.

Signed-off-by: Daniel Hast <[email protected]>
If the user-provided ID doesn't exactly match an installed flatpak,
rather than just exiting, do a case-insensitive search for the string
among installed flatpak apps, and prompt the user to select one if
found. This means the user can just type part of the the ID instead of
the whole ID (e.g. `ujust harden-flatpak libreoffice` will work).

Signed-off-by: Daniel Hast <[email protected]>
@HastD HastD force-pushed the harden-flatpak branch from 6124cdf to b954953 Compare June 1, 2025 00:18
@RoyalOughtness RoyalOughtness enabled auto-merge (squash) June 4, 2025 01:48
@RoyalOughtness RoyalOughtness merged commit 882f485 into secureblue:live Jun 4, 2025
16 checks passed
@HastD HastD deleted the harden-flatpak branch June 4, 2025 02:45
RoyalOughtness pushed a commit to RoyalOughtness/secureblue-dev that referenced this pull request Jun 12, 2025
…ng overrides (secureblue#1069)

* fix: rewrite ujust harden-flatpak to check app ID and existing overrides

* Give an error if the app ID does not match an installed flatpak.
* If hardened_malloc is applied globally, just remove the app's local
  overrides that block hardened_malloc instead of adding new overrides.
* If hardened_malloc is not applied globally, inform the user of this
  and that it's recommended to enable it globally.

Signed-off-by: Daniel Hast <[email protected]>

* feat: fallback prompt if invalid ID given in ujust harden-flatpak

If the user-provided ID doesn't exactly match an installed flatpak,
rather than just exiting, do a case-insensitive search for the string
among installed flatpak apps, and prompt the user to select one if
found. This means the user can just type part of the the ID instead of
the whole ID (e.g. `ujust harden-flatpak libreoffice` will work).

Signed-off-by: Daniel Hast <[email protected]>

* fix(ujust): only allow app IDs, not runtime IDs, in harden-flatpak

* remove warning message as suggested

* refactor: simplify control flow, avoid unnecessary checks

---------

Signed-off-by: Daniel Hast <[email protected]>
RoyalOughtness pushed a commit to RoyalOughtness/secureblue-dev that referenced this pull request Aug 4, 2025
…ng overrides (secureblue#1069)

* fix: rewrite ujust harden-flatpak to check app ID and existing overrides

* Give an error if the app ID does not match an installed flatpak.
* If hardened_malloc is applied globally, just remove the app's local
  overrides that block hardened_malloc instead of adding new overrides.
* If hardened_malloc is not applied globally, inform the user of this
  and that it's recommended to enable it globally.

Signed-off-by: Daniel Hast <[email protected]>

* feat: fallback prompt if invalid ID given in ujust harden-flatpak

If the user-provided ID doesn't exactly match an installed flatpak,
rather than just exiting, do a case-insensitive search for the string
among installed flatpak apps, and prompt the user to select one if
found. This means the user can just type part of the the ID instead of
the whole ID (e.g. `ujust harden-flatpak libreoffice` will work).

Signed-off-by: Daniel Hast <[email protected]>

* fix(ujust): only allow app IDs, not runtime IDs, in harden-flatpak

* remove warning message as suggested

* refactor: simplify control flow, avoid unnecessary checks

---------

Signed-off-by: Daniel Hast <[email protected]>
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.

3 participants