Skip to content

broker: Set broker.conf.d permissions to 755#1426

Merged
adombeck merged 4 commits intomainfrom
UDENG-9634-broker-conf-d-perms
Apr 15, 2026
Merged

broker: Set broker.conf.d permissions to 755#1426
adombeck merged 4 commits intomainfrom
UDENG-9634-broker-conf-d-perms

Conversation

@adombeck
Copy link
Copy Markdown
Contributor

@adombeck adombeck commented Apr 9, 2026

This is a config directory, so admins are expected to read and modify the files in that directory. However, the permissions 700 don't allow non-root users to list the directory contents, so tab-completion doesn't list any files. That has caused confusion on multiple occasions.

The config files can contain secrets (e.g. the client_secret setting), so it's important that the files are not world-readable, but that's ensured as long as the permissions of the files are 600.

UDENG-9634

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 81.81818% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.19%. Comparing base (15c4664) to head (068c001).
⚠️ Report is 11 commits behind head on main.

Files with missing lines Patch % Lines
authd-oidc-brokers/cmd/authd-oidc/daemon/daemon.go 85.71% 2 Missing ⚠️
authd-oidc-brokers/cmd/authd-oidc/daemon/fs.go 75.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1426      +/-   ##
==========================================
- Coverage   87.05%   80.19%   -6.87%     
==========================================
  Files          93       20      -73     
  Lines        6367     1015    -5352     
  Branches      111        0     -111     
==========================================
- Hits         5543      814    -4729     
+ Misses        768      201     -567     
+ Partials       56        0      -56     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@adombeck adombeck force-pushed the UDENG-9634-broker-conf-d-perms branch from e7293f1 to 646032d Compare April 9, 2026 23:53
@adombeck adombeck requested a review from Copilot April 9, 2026 23:54
Comment thread authd-oidc-brokers/cmd/authd-oidc/daemon/daemon.go
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

This PR adjusts how the OIDC broker’s configuration drop-in directory (broker.conf.d) is permissioned so non-root users can list it (improving discoverability and shell tab-completion) while still requiring config files to be non-world-readable.

Changes:

  • Add a snap post-refresh migration to chmod broker.conf.d to 0755 and enforce 0600 on files within it.
  • Change the daemon to create/require broker.conf.d with 0755 instead of 0700.
  • Add runtime permission checks to ensure broker.conf and drop-in config files are 0600.

Reviewed changes

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

File Description
snap/hooks/post-refresh Adds a migration to make broker.conf.d listable (0755) while forcing config files to 0600.
authd-oidc-brokers/cmd/authd-oidc/daemon/fs.go Introduces a helper to validate config file permissions.
authd-oidc-brokers/cmd/authd-oidc/daemon/daemon.go Creates broker.conf.d with 0755 and checks permissions on config files at startup.

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

Comment thread snap/hooks/post-refresh
Comment thread snap/hooks/post-refresh Outdated
Comment thread snap/hooks/post-refresh Outdated
Comment thread authd-oidc-brokers/cmd/authd-oidc/daemon/fs.go Outdated
Comment thread authd-oidc-brokers/cmd/authd-oidc/daemon/daemon.go Outdated
Comment thread authd-oidc-brokers/cmd/authd-oidc/daemon/daemon.go Outdated
Comment thread authd-oidc-brokers/cmd/authd-oidc/daemon/daemon.go
Comment thread authd-oidc-brokers/cmd/authd-oidc/daemon/daemon.go 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.

Pull request overview

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


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

Comment thread authd-oidc-brokers/cmd/authd-oidc/daemon/daemon.go Outdated
Comment thread authd-oidc-brokers/cmd/authd-oidc/daemon/fs.go Outdated
This is a config directory, so admins are expected to read and modify
the files in that directory.  However, the permissions 700 don't allow
non-root users to list the directory contents, so tab-completion doesn't
list any files. That has caused confusion on multiple occasions.

The config files can contain secrets (e.g. the client_secret setting),
so it's important that the files are not world-readable, but that's
ensured as long as the permissions of the *files* are 600.
@adombeck adombeck force-pushed the UDENG-9634-broker-conf-d-perms branch 2 times, most recently from 907c250 to c2c61fd Compare April 14, 2026 17:16
@adombeck adombeck marked this pull request as ready for review April 14, 2026 21:04
@adombeck adombeck requested a review from denisonbarbosa April 14, 2026 21:05
Comment thread authd-oidc-brokers/cmd/authd-oidc/daemon/daemon_test.go
Copilot AI and others added 2 commits April 14, 2026 23:30
It's not insecure if directories are world-readable as long as the files
actually containing secrets have secure permissions - and it's
definitely not insecure if the directories have e.g. permissions 0700
instead of the expected 0755. The broker failing to start, on the other
hand, can have pretty bad consequences, because users are not able to
log in.
@adombeck adombeck force-pushed the UDENG-9634-broker-conf-d-perms branch from c2c61fd to 068c001 Compare April 14, 2026 21:30
@adombeck
Copy link
Copy Markdown
Contributor Author

Fixed the linter issue

@adombeck adombeck merged commit 2ebeae7 into main Apr 15, 2026
23 of 28 checks passed
@adombeck adombeck deleted the UDENG-9634-broker-conf-d-perms branch April 15, 2026 11:09
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