-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: GPX-670 Added Documentation (#7)
+ Added Documentation + Adopted new labels.yaml standard + Added release workflow + Write map if shutdown
- Loading branch information
Showing
9 changed files
with
209 additions
and
30 deletions.
There are no files selected for viewing
This file contains 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,75 @@ | ||
name: Publish new release | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
tags: | ||
- v* | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
golangci: | ||
name: lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.20' | ||
cache: true | ||
- uses: actions/checkout@v3 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v3 | ||
with: | ||
# Optional: golangci-lint command line arguments. | ||
args: --issues-exit-code=1 --timeout=5m --disable typecheck | ||
- name: go vet | ||
run: go vet ./... | ||
|
||
scan-code: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Run Trivy vulnerability scanner | ||
uses: aquasecurity/trivy-action@master | ||
with: | ||
scan-type: 'fs' | ||
scan-ref: '.' | ||
scanners: 'vuln,secret,config' | ||
ignore-unfixed: true | ||
format: 'sarif' | ||
output: 'trivy-results.sarif' | ||
severity: 'CRITICAL,HIGH, MEDIUM, LOW' | ||
exit-code: '1' | ||
|
||
- name: Upload Trivy scan results to GitHub Security tab | ||
uses: github/codeql-action/upload-sarif@v2 | ||
with: | ||
sarif_file: 'trivy-results.sarif' | ||
category: 'code' | ||
|
||
build-and-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '>=1.20.0' | ||
cache: true | ||
|
||
- name: Install dependencies | ||
run: go get . | ||
|
||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
File renamed without changes.
This file contains 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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
vendor | ||
./vendor | ||
users.yaml | ||
groups.yaml | ||
labels.yaml | ||
multena-rbac-collector |
This file contains 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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2023 Constantin Winkler | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains 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,60 @@ | ||
# Multena RBAC Collector | ||
|
||
![Go Version](https://img.shields.io/badge/Go-v1.20-blue) | ||
[![Go Report Card](https://goreportcard.com/badge/github.com/gepaplexx/multena-rbac-collector)](https://goreportcard.com/report/github.com/gepaplexx/multena-rbac-collector) | ||
[![Release](https://img.shields.io/github/v/release/gepaplexx/multena-rbac-collector)](https://github.com/gepaplexx/multena-rbac-collector/releases/latest) | ||
![License](https://img.shields.io/github/license/gepaplexx/multena-rbac-collector) | ||
|
||
The `multena-rbac-collector` is a Go program that collects the Role-Based Access Control (RBAC) data from an OpenShift | ||
cluster, specifically users and groups with their respective access to namespaces. | ||
|
||
```mermaid | ||
graph TB | ||
A[Start] --> B[Collects Users, Groups, and Namespaces] | ||
B --> C{Checks Access} | ||
C -- Yes --> D[Records Access Rights] | ||
D --> E{All Entities Checked?} | ||
E -- Yes --> F[Write to YAML] | ||
E -- No --> C | ||
F --> G[End] | ||
``` | ||
|
||
## Features | ||
|
||
- Collects the list of all users, groups, and namespaces from an OpenShift cluster | ||
- Checks access for each user and group to each namespace | ||
- Outputs the collected data into a YAML file | ||
|
||
## Prerequisites | ||
|
||
- OpenShift cluster | ||
- Configured `kubeconfig` file for accessing the cluster | ||
- Cluster admin privileges for the user that runs the program | ||
|
||
## Installation | ||
|
||
Clone the repository and build using Go: | ||
|
||
```bash | ||
git clone https://github.com/gepaplexx/multena-rbac-collector.git | ||
cd multena-rbac-collector | ||
go build | ||
``` | ||
|
||
## Usage | ||
|
||
Simply run the compiled binary: | ||
|
||
```bash | ||
./multena-rbac-collector | ||
``` | ||
|
||
This will create a `labels.yaml` file with the collected RBAC data. | ||
|
||
## Contributing | ||
|
||
We welcome contributions! Please open an issue if you have any questions or suggestions. | ||
|
||
## License | ||
|
||
This project is licensed under the terms of the MIT license. |
This file contains 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 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 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 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