-
Notifications
You must be signed in to change notification settings - Fork 0
Now checks for privileged system users instead of groups + Unit tests #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
30 commits
Select commit
Hold shift + click to select a range
4bb4494
now checks for privileged system users instead of groups
wtripp180901 bd73d53
image bump
wtripp180901 e1bece1
can now specify additional privileged users
wtripp180901 cae4527
bump
wtripp180901 b1cb810
added unit tests
wtripp180901 1276b8f
fixed unprivileged service account being allowed
wtripp180901 e0c02d5
fixed JSON test
wtripp180901 20cfb57
formatting
wtripp180901 5935633
image bump
wtripp180901 68399ec
now allows protected service accounts to write to each other's namesp…
wtripp180901 f67fe91
bumped image
wtripp180901 e00a1fd
added protections for wildcard requests
wtripp180901 69a4d16
refactor + docs
wtripp180901 b83f978
bump
wtripp180901 d9eaf99
ensured allowed is always set
wtripp180901 92c6200
bump
wtripp180901 a3fa051
loosened all-namespace request rules
wtripp180901 59811f4
bump
wtripp180901 7ee025d
all namespace bans now only apply to secrets
wtripp180901 830fc0e
bump
wtripp180901 217ce15
nits
wtripp180901 4fa40af
added gofmt check
wtripp180901 16a5e3d
ci output + fixed formatting
wtripp180901 e4b5a15
typo
wtripp180901 97028f8
Logging improvements
wtripp180901 0acc2bb
debug
wtripp180901 e9f1d62
made allowed system users more explicit
wtripp180901 b93c713
Switched to multistage build
wtripp180901 c52cab4
Updated tests
wtripp180901 9728993
bumped image
wtripp180901 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| name: Go unit tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| build-and-test: | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Setup Go | ||
| uses: actions/setup-go@v5 | ||
| with: | ||
| go-version: '1.24.x' | ||
| - name: Check gofmt compliant | ||
| run: | | ||
| cd src | ||
| if [[ $(gofmt -l .) ]]; then | ||
| echo "Files not gofmt compliant:" | ||
| gofmt -l . | ||
| exit 1 | ||
| else | ||
| exit 0 | ||
| fi | ||
| - name: Install dependencies | ||
| run: | | ||
| cd src | ||
| go get . | ||
| - name: Test with Go | ||
| run: | | ||
| cd src | ||
| go test -v | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Azimuth Authorization Webhook | ||
|
|
||
| A Kubernetes authorization webhook to protect sensitive namespaces when users require | ||
| read-write access to all other cluster resources (e.g when they wish to install arbitrary CRDS). | ||
|
|
||
| Policy: | ||
| - Users cannot read secrets in protected namespaces by default | ||
| - Users cannot write any other resource in protected namespaces by default | ||
| - Internal K8s `system:` users may read/write to protected namespaces, excluding service accounts and `system:anonymous` | ||
| - Service accounts in protected namespaces may read/write to all protected namespaces | ||
| - Users specified as privileged may read/write to protected namespaces | ||
|
|
||
| ## Flags | ||
| | Flag | Arguments | | ||
| | --- | --- | | ||
| | `--allow-opinion-mode` | Specifies if the webhook should give its opinion on requests which it doesn't deny. If true, will set 'allowed' to `true` in SubjectAccessReview response. Default: `false` | | ||
| | `--additional-privileged-users` | Comma separate listed of users to be given read/write access to protected namespaces. Default: `""` | | ||
| | `--log-level` | Verbosity of logs <br>`0`: Internal errors only. <br>`1`: Logs high level requests info. <br>`2`: Logs HTTP dumps of requests. <br>Default: `1` | | ||
| | `--protected-namespaces` | Comma separated list of protected namespaces. Default: `kube-system,openstack-system` | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.