Skip to content

Harden browser managed policy permissions#5548

Open
afurm wants to merge 3 commits intobasecamp:devfrom
afurm:af/harden-browser-policy-perms
Open

Harden browser managed policy permissions#5548
afurm wants to merge 3 commits intobasecamp:devfrom
afurm:af/harden-browser-policy-perms

Conversation

@afurm
Copy link
Copy Markdown
Contributor

@afurm afurm commented May 2, 2026

Summary

Fixes #5547.

This keeps Chromium and Brave managed policy directories from being writable by every local user, while preserving no-sudo theme switching.

Changes

  • Create /etc/chromium/policies/managed and /etc/brave/policies/managed as root:root mode 755.
  • Pre-create Omarchy’s managed color.json as root:wheel mode 664.
  • Keep omarchy-theme-set-browser sudo-free by only overwriting the existing color.json.
  • Remove stale color.json paths during migration before recreating them, so old symlinks from the previous world-writable directory state are not followed.
  • Update the older migration path to use the same hardened directory/file setup.

Validation

  • bash -n bin/omarchy-theme-set-browser install/config/theme.sh migrations/1757147211.sh migrations/1777653181.sh
  • git diff --check
  • Focused shell checks for:
    • sudo-free theme writer
    • stale color.json symlink removal
    • root:root policy directories
    • root:wheel mode 664 policy file setup

Copilot AI review requested due to automatic review settings May 2, 2026 07:16
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d1aef6a0f5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bin/omarchy-theme-set-browser Outdated
@afurm afurm force-pushed the af/harden-browser-policy-perms branch from d1aef6a to 5b59ea0 Compare May 2, 2026 07:25
Copy link
Copy Markdown
Contributor

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

Note

Copilot was unable to run its full agentic suite in this review.

Hardens browser managed policy directory permissions for Chromium/Brave so theme policy files remain admin/root-controlled, and adds a migration to repair existing installs.

Changes:

  • Create managed policy directories with root ownership and 755 perms (instead of user-writable).
  • Write color.json via privileged write (sudo tee) and enforce root-owned 644 perms.
  • Add a migration to correct directory and color.json permissions on upgrade.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
migrations/1777653181.sh New migration to reset managed policy directory and color.json ownership/permissions, then re-apply policy.
migrations/1757147211.sh Updates initial directory creation to root-owned 755 (removes world-writable).
install/config/theme.sh Ensures managed policy directories are created root-owned 755 during install.
bin/omarchy-theme-set-browser Centralizes policy writing and switches to privileged writes with enforced ownership/mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread migrations/1777653181.sh
Comment thread migrations/1777653181.sh
Comment thread bin/omarchy-theme-set-browser Outdated
Copy link
Copy Markdown
Contributor

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@afurm afurm force-pushed the af/harden-browser-policy-perms branch from 5b59ea0 to d1e415b Compare May 2, 2026 17:19
@afurm afurm requested review from Copilot and dhh May 2, 2026 17:22
Copy link
Copy Markdown
Contributor

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

Copilot reviewed 3 out of 4 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread install/config/theme.sh Outdated
Comment thread migrations/1757147211.sh Outdated
Comment thread migrations/1777653181.sh Outdated
Comment thread migrations/1777653181.sh Outdated
@afurm afurm force-pushed the af/harden-browser-policy-perms branch from d1e415b to 86bfb30 Compare May 2, 2026 17:30
@afurm afurm requested a review from Copilot May 2, 2026 17:31
Copy link
Copy Markdown
Contributor

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

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread migrations/1777653181.sh
Comment thread migrations/1757147211.sh
Comment thread install/config/theme.sh
Copy link
Copy Markdown
Contributor

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

Copilot reviewed 3 out of 4 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread migrations/1757147211.sh Outdated
Comment thread migrations/1777653181.sh Outdated
Comment thread install/config/theme.sh Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings May 2, 2026 17:43
Copy link
Copy Markdown
Contributor

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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.

Browser managed policy directories are world-writable

3 participants