@continuoussecuritytooling/keycloak-reporter 0.6.0 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/.docs/realm-config.json +0 -0
  2. package/.eslintrc.cjs +4 -3
  3. package/.github/FUNDING.yml +2 -1
  4. package/.github/workflows/pipeline.yml +61 -16
  5. package/.github/workflows/release.yml +6 -6
  6. package/.prettierrc +2 -2
  7. package/CHANGELOG.md +92 -11
  8. package/Dockerfile +16 -2
  9. package/README.md +8 -4
  10. package/artifacthub-repo.yml +6 -0
  11. package/charts/keycloak-reporter/Chart.yaml +10 -4
  12. package/charts/keycloak-reporter/README.md +7 -16
  13. package/charts/keycloak-reporter/ci.values.yaml +13 -0
  14. package/charts/keycloak-reporter/templates/cronjob.yaml +4 -5
  15. package/charts/keycloak-reporter/templates/tests/test-connection.yaml +57 -0
  16. package/charts/keycloak-reporter/values.yaml +2 -1
  17. package/cli.ts +59 -87
  18. package/config/schema.json +6 -1
  19. package/dist/cli.js +38 -37
  20. package/dist/cli.js.map +1 -1
  21. package/dist/config/schema.json +6 -1
  22. package/dist/index.js +1 -1
  23. package/dist/index.js.map +1 -1
  24. package/dist/lib/client.js +7 -24
  25. package/dist/lib/client.js.map +1 -1
  26. package/dist/lib/convert.js +0 -0
  27. package/dist/lib/convert.js.map +0 -0
  28. package/dist/lib/output.js +2 -2
  29. package/dist/lib/output.js.map +1 -1
  30. package/dist/lib/user.js +79 -44
  31. package/dist/lib/user.js.map +1 -1
  32. package/dist/src/commands.js +30 -0
  33. package/dist/src/commands.js.map +1 -0
  34. package/dist/src/config.js +0 -9
  35. package/dist/src/config.js.map +1 -1
  36. package/e2e/spec/clients.js +1 -1
  37. package/e2e/spec/config.js +25 -1
  38. package/e2e/spec/users.js +1 -1
  39. package/index.ts +2 -2
  40. package/keycloak-reporter-1.2.1.tgz +0 -0
  41. package/lib/client.ts +10 -37
  42. package/lib/output.ts +2 -2
  43. package/lib/user.ts +86 -49
  44. package/package.json +5 -4
  45. package/renovate.json +12 -5
  46. package/src/commands.ts +37 -0
  47. package/src/config.ts +6 -17
  48. package/dist/src/cli.js +0 -19
  49. package/dist/src/cli.js.map +0 -1
  50. package/src/cli.ts +0 -26
File without changes
package/.eslintrc.cjs CHANGED
@@ -2,13 +2,14 @@
2
2
  module.exports = {
3
3
  env: {
4
4
  node: true,
5
- commonjs: true
5
+ commonjs: true,
6
6
  },
7
7
  extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
8
8
  parser: '@typescript-eslint/parser',
9
9
  plugins: ['@typescript-eslint'],
10
10
  root: true,
11
11
  rules: {
12
- quotes: [2, 'single', { avoidEscape: true }]
13
- }
12
+ quotes: [2, 'single', { avoidEscape: true }],
13
+ 'comma-dangle': ['error', 'only-multiline'],
14
+ },
14
15
  };
@@ -1,2 +1,3 @@
1
1
  # These are supported funding model platforms
2
- open_collective: m13t
2
+ open_collective: m13t
3
+ github: ContinuousSecurityTooling
@@ -6,6 +6,8 @@ on:
6
6
  push:
7
7
  branches:
8
8
  - develop
9
+ tags:
10
+ - '*'
9
11
 
10
12
  jobs:
11
13
  build:
@@ -16,6 +18,7 @@ jobs:
16
18
  node_version:
17
19
  - 18
18
20
  - 20
21
+ - 21
19
22
  os:
20
23
  - ubuntu-latest
21
24
  - macOS-latest
@@ -23,7 +26,7 @@ jobs:
23
26
  steps:
24
27
  - uses: actions/checkout@v4
25
28
  - name: 'Use Node.js ${{ matrix.node_version }}'
26
- uses: actions/setup-node@v3
29
+ uses: actions/setup-node@v4
27
30
  with:
28
31
  node-version: '${{ matrix.node_version }}'
29
32
  - name: npm build and test
@@ -47,13 +50,13 @@ jobs:
47
50
  with:
48
51
  version: v3.11.2
49
52
 
50
- - uses: actions/setup-python@v4
53
+ - uses: actions/setup-python@v5
51
54
  with:
52
55
  python-version: '3.9'
53
56
  check-latest: true
54
57
 
55
58
  - name: Helm Chart Testing
56
- uses: helm/chart-testing-action@v2.4.0
59
+ uses: helm/chart-testing-action@v2.6.1
57
60
 
58
61
  - name: Run chart-testing (list-changed)
59
62
  id: list-changed
@@ -71,11 +74,15 @@ jobs:
71
74
  if: steps.list-changed.outputs.changed == 'true'
72
75
  uses: helm/kind-action@v1.8.0
73
76
 
74
- - name: Run chart-testing (install)
77
+ - name: Run chart-testing (install - no further args)
75
78
  if: steps.list-changed.outputs.changed == 'true'
76
- run: ct install --target-branch ${{ github.event.repository.default_branch }} --helm-extra-set-args "--set 'keycloak.config.url=http://localhost:8080' --set 'keycloak.config.url=http://localhost:8080' --set 'keycloak.config.clientId=clientId' --set 'keycloak.config.clientSecret=clientSecret' --set 'keycloak.config.webhookType=test' --set 'keycloak.config.webhookUrl=http://localhost:8888'"
79
+ run: ct install --target-branch ${{ github.event.repository.default_branch }} --helm-extra-set-args "--set 'keycloak.config.url=http://localhost:8080' --set 'keycloak.config.url=http://localhost:8080' --set 'keycloak.config.clientId=clientId' --set 'keycloak.config.clientSecret=clientSecret'"
77
80
 
78
- - uses: actions/upload-artifact@v3
81
+ - name: Run chart-testing (install - with args)
82
+ if: steps.list-changed.outputs.changed == 'true'
83
+ run: ct install --target-branch ${{ github.event.repository.default_branch }} --helm-extra-set-args "-f charts/keycloak-reporter/ci.values.yaml"
84
+
85
+ - uses: actions/upload-artifact@v4
79
86
  with:
80
87
  name: dist-folder
81
88
  path: dist
@@ -87,16 +94,18 @@ jobs:
87
94
  matrix:
88
95
  node_version:
89
96
  - 18
97
+ - 20
98
+ - 21
90
99
  os:
91
100
  - ubuntu-latest
92
101
  steps:
93
102
  - uses: actions/checkout@v4
94
103
  - name: 'Use Node.js ${{ matrix.node_version }}'
95
- uses: actions/setup-node@v3
104
+ uses: actions/setup-node@v4
96
105
  with:
97
106
  node-version: '${{ matrix.node_version }}'
98
107
  - name: Install Java
99
- uses: actions/setup-java@v3
108
+ uses: actions/setup-java@v4
100
109
  with:
101
110
  distribution: 'temurin' # See 'Supported distributions' for available options
102
111
  java-version: '17'
@@ -131,29 +140,65 @@ jobs:
131
140
  - end2end
132
141
  steps:
133
142
  - uses: actions/checkout@v4
134
- - uses: actions/setup-node@v3
135
- # TODO: Support Node 16+
143
+ - uses: actions/setup-node@v4
136
144
  with:
137
- node-version: '16'
145
+ # renovate: datasource=docker depName=node
146
+ node-version: '20'
138
147
  - name: 'Build Package'
139
148
  run: |
140
149
  npm run clean
141
150
  npm run build
142
- - name: Buildah Action
151
+
152
+ - name: Write version vars
153
+ run: |
154
+ BUILD_DATE=`date -u +"%Y-%m-%dT%H:%M:%SZ"`
155
+ BRANCH=${GITHUB_REF_NAME#v}
156
+ APP_VERSION=$(cat package.json | grep version| head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g')
157
+ echo Version: $APP_VERSION
158
+ echo "VERSION=$APP_VERSION" >> $GITHUB_ENV
159
+ echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV
160
+ echo "BUILD_DATE=$BUILD_DATE" >> $GITHUB_ENV
161
+
162
+ - name: Build Container Image
143
163
  id: build-image
144
164
  uses: redhat-actions/buildah-build@v2
145
165
  with:
146
166
  image: continuoussecuritytooling/keycloak-reporting-cli
147
- tags: 'v1 ${{ github.sha }}'
167
+ tags: 'latest next ${{env.APP_VERSION}} ${{env.APP_VERSION}}_rc'
148
168
  containerfiles: |
149
169
  ./Dockerfile
170
+ build-args: |
171
+ BUILD_DATE=${{env.BUILD_DATE}}
172
+ APP_VERSION=${{env.APP_VERSION}}
173
+
174
+ - name: Push To NPM Registry
175
+ id: push-to-npm-tagged
176
+ env:
177
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
178
+ run: |
179
+ echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
180
+ (cd core && npm i && npm publish)
181
+ (cd cli && npm i && npm publish)
182
+ if: github.ref_type == 'tag' || github.tag != ''
183
+
184
+ - name: Push To Docker Hub
185
+ id: push-to-dockerhub-preview
186
+ uses: redhat-actions/push-to-registry@v2
187
+ with:
188
+ image: ${{ steps.build-image.outputs.image }}
189
+ tags: 'next ${{env.APP_VERSION}}_rc'
190
+ registry: registry.hub.docker.com
191
+ username: continuoussecuritytooling
192
+ password: ${{ secrets.DOCKER_HUB_TOKEN }}
193
+ if: github.ref == 'refs/heads/develop'
194
+
150
195
  - name: Push To Docker Hub
151
- id: push-to-dockerhub
196
+ id: push-to-dockerhub-tagged
152
197
  uses: redhat-actions/push-to-registry@v2
153
198
  with:
154
199
  image: ${{ steps.build-image.outputs.image }}
155
- tags: ${{ steps.build-image.outputs.tags }}
200
+ tags: 'latest ${{env.APP_VERSION}}'
156
201
  registry: registry.hub.docker.com
157
202
  username: continuoussecuritytooling
158
203
  password: ${{ secrets.DOCKER_HUB_TOKEN }}
159
- if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main'
204
+ if: github.ref_type == 'tag' || github.tag != ''
@@ -26,22 +26,21 @@ jobs:
26
26
  - name: Install Helm
27
27
  uses: azure/setup-helm@v3
28
28
  - name: Install Python
29
- uses: actions/setup-python@v4
29
+ uses: actions/setup-python@v5
30
30
  with:
31
31
  python-version: '3.9'
32
32
  check-latest: true
33
33
  - name: Set up chart-testing
34
- uses: helm/chart-testing-action@v2.4.0
34
+ uses: helm/chart-testing-action@v2.6.1
35
35
 
36
36
  - name: Run chart-testing (lint)
37
- run: ct lint --config .ct.yaml
37
+ run: ct lint --config .ct.yaml
38
38
 
39
39
  - name: Run chart-releaser
40
- uses: helm/chart-releaser-action@v1.5.0
41
- with:
42
- charts_dir: charts/
40
+ uses: helm/chart-releaser-action@v1.6.0
43
41
  env:
44
42
  CR_TOKEN: '${{ secrets.GITHUB_TOKEN }}'
43
+ CR_GENERATE_RELEASE_NOTES: true
45
44
 
46
45
  - name: Login to GitHub Container Registry
47
46
  run: |
@@ -49,6 +48,7 @@ jobs:
49
48
 
50
49
  - name: Push Charts to GHCR
51
50
  run: |
51
+ shopt -s nullglob
52
52
  for pkg in .cr-release-packages/*; do
53
53
  if [ -z "${pkg:-}" ]; then
54
54
  break
package/.prettierrc CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "semi": true,
3
- "trailingComma": "none",
3
+ "trailingComma": "es5",
4
4
  "singleQuote": true,
5
- "printWidth": 80
5
+ "printWidth": 120
6
6
  }
package/CHANGELOG.md CHANGED
@@ -1,22 +1,103 @@
1
- # 0.2.0 (2023-06-02)
1
+ # [0.8.0](https://github.com/ContinuousSecurityTooling/keycloak-reporter/compare/v0.7.2...v0.8.0) (2023-12-14)
2
+
3
+ ### Features
4
+
5
+ * **Config:** Adding config validation and helm test hook ([c29e945](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/c29e945567b4dfcdc9a10e710efa2b1a8c00f970))
6
+
7
+ ### Bug Fixes
8
+
9
+ * **deps:** update dependency @continuoussecuritytooling/keycloak-auditor to v1.1.2 ([2b985d5](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/2b985d5daa4d271bf4a1219b6df71b16515b4106))
10
+ * **deps:** update dependency @continuoussecuritytooling/keycloak-auditor to v1.1.3 ([2ed9c0f](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/2ed9c0faff14bc7d43b5e739a48e7175c1e74c4c))
11
+ * **deps:** update dependency @json2csv/node to v7.0.4 ([2488240](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/2488240525fd1d8c20cf5205be50c069e6ac0cd1))
12
+ * **deps:** update dependency @keycloak/keycloak-admin-client to v23 ([12e4485](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/12e4485a0e4c508cc90fe86d3ab39efb647486ce))
13
+ * **deps:** update dependency @keycloak/keycloak-admin-client to v23.0.1 ([babdf78](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/babdf78ce6b0f2736ce6703cb83338e37066639b))
14
+ * **deps:** update dependency npm to v10.2.4 ([8529acf](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/8529acf82bf8ea1581c7510783087ba5d8d45dde))
15
+ * **deps:** update dependency npm to v10.2.5 ([52a3c8b](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/52a3c8b48cbf0ee0d795aa00a9af36291025ae05))
16
+
17
+
18
+
19
+ ## [0.7.2](https://github.com/ContinuousSecurityTooling/keycloak-reporter/compare/v0.7.1...v0.7.2) (2023-11-16)
2
20
 
3
21
 
4
22
  ### Bug Fixes
5
23
 
6
- * **deps:** update dependency @json2csv/node to v7 ([42934da](https://github.com/ContinuousSecurityTooling/[object Object]/commit/42934da57a546b1a0db324183b3db51c27ff1cc2))
7
- * **deps:** update dependency @json2csv/node to v7.0.1 ([b0aeb36](https://github.com/ContinuousSecurityTooling/[object Object]/commit/b0aeb366b07a38d8b648b4a0c763bab578db653a))
8
- * Stick to NodeJS 16 ([595d799](https://github.com/ContinuousSecurityTooling/[object Object]/commit/595d799510e81de885430d7cc62549dd8a272aee))
24
+ * Try to fix release ([ed7ebdf](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/ed7ebdf6ca9677621d19d8f829f611183602135f))
25
+
26
+
27
+
28
+ ## [0.7.1](https://github.com/ContinuousSecurityTooling/keycloak-reporter/compare/v0.7.0...v0.7.1) (2023-11-16)
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * **deps:** update dependency @continuoussecuritytooling/keycloak-auditor to v1.1.1 ([4fb7c58](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/4fb7c5801f8d5519d6c7132eabd29976e640cff3))
34
+ * **deps:** update dependency @slack/webhook to v7.0.1 ([1c46ccf](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/1c46ccf7f9a91c4fc85464ddfe9aea8f8e588801))
35
+ * **deps:** update dependency npm to v10.2.3 ([a42ac5c](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/a42ac5c5df195d5e9b15595bb377261f53acca03))
9
36
 
10
37
 
11
38
  ### Features
12
39
 
13
- * **Config:** Provide config file functionality ([f9097f9](https://github.com/ContinuousSecurityTooling/[object Object]/commit/f9097f966c2dfc5240111e9294742ad3821c36ad))
14
- * **Config:** Use config file in helm chart ([21e0512](https://github.com/ContinuousSecurityTooling/[object Object]/commit/21e051243df1a3000d2b57f6ee0feab5f6314910))
15
- * **Helm:** Initial chart version ([401c740](https://github.com/ContinuousSecurityTooling/[object Object]/commit/401c7401b1b34b479bb5a370c9d1077a36f653b0)), closes [#1](https://github.com/ContinuousSecurityTooling/[object Object]/issues/1)
16
- * **Report:** Adding id to report ([8dbc3d4](https://github.com/ContinuousSecurityTooling/[object Object]/commit/8dbc3d4deacba0a5e1729da93b8d933557ebd45b))
17
- * **Testing:** Adding end2end testing via keycloak local ([036202f](https://github.com/ContinuousSecurityTooling/[object Object]/commit/036202f47324e8b3e40764fdc3a43a270a2687cf))
18
- * **Users:** Adding user and client listing functionality ([4c13fa0](https://github.com/ContinuousSecurityTooling/[object Object]/commit/4c13fa0642d75b8e229091aca052a83fa8c7eb32))
19
- * **Webhooks:** Adding Support for Teams and Slack ([66da168](https://github.com/ContinuousSecurityTooling/[object Object]/commit/66da168d2cd234ebc6dd961cfe62a3c8191c0ccc)), closes [#2](https://github.com/ContinuousSecurityTooling/[object Object]/issues/2)
40
+ * Using NodeJS 20 as default ([ba468cf](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/ba468cfa7e17615a38ea5ea7e81c859e1f734f67))
41
+
42
+
43
+
44
+ # [0.7.0](https://github.com/ContinuousSecurityTooling/keycloak-reporter/compare/v0.6.0...v0.7.0) (2023-11-02)
45
+
46
+
20
47
 
48
+ # [0.6.0](https://github.com/ContinuousSecurityTooling/keycloak-reporter/compare/4c13fa0642d75b8e229091aca052a83fa8c7eb32...v0.6.0) (2023-11-01)
21
49
 
22
50
 
51
+ ### Bug Fixes
52
+
53
+ * **Build:** ci health workflow network fix and setup JDK ([9878cac](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/9878cacd99b8c7a66c9c2f7e26d9087f48b809fe))
54
+ * **Chart:** Add only non-empty strings to secret ([eef4332](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/eef433203f33a14a322ecb0a46cd2701ef454eec))
55
+ * **Chart:** Correct default values for install ([50e9b5c](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/50e9b5ccbaeec2661b16cf2d6d959fc66231f21e))
56
+ * **Config:** Adding proper error handling for missing webhook URL ([1515b3d](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/1515b3dde0ec387ec226f8d5fe1ffd4f3a4af00d))
57
+ * **Config:** Correcting handling for auditor endpoint toogle ([d332e13](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/d332e13667e5ff770e2d5dcb1374730dcc896527))
58
+ * **Config:** Let config file overwrite defaults ([2df34a0](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/2df34a047ef8c2275f8ae4ef0d06209c1619d74e))
59
+ * Correct ref error ([2098b15](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/2098b1531e20d2037252f706713e4dd54a620128))
60
+ * Corrected missing variable ([3223ea3](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/3223ea31d33cad3ad7fd8d4b574ed88a737ced81))
61
+ * Corrected renovate config ([af1bd4a](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/af1bd4a6c4c8678d4a4b2ffc97c41b583986f513))
62
+ * **deps:** update dependency @json2csv/node to v7 ([42934da](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/42934da57a546b1a0db324183b3db51c27ff1cc2))
63
+ * **deps:** update dependency @json2csv/node to v7.0.1 ([b0aeb36](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/b0aeb366b07a38d8b648b4a0c763bab578db653a))
64
+ * **deps:** update dependency @json2csv/node to v7.0.2 ([bcca826](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/bcca8267291c79e13dc1bd563d80d59d1d6d0f27))
65
+ * **deps:** update dependency @json2csv/node to v7.0.3 ([e61eaf2](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/e61eaf2b12243cc10903ac6235e03de78e6c4ae7))
66
+ * **deps:** update dependency @keycloak/keycloak-admin-client to v22 ([cf5caac](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/cf5caac67d0a35b56e7c7a16dd5ee815aaf96d6c))
67
+ * **deps:** update dependency @keycloak/keycloak-admin-client to v22.0.4 ([608703c](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/608703ce5f7d6c05c76eb88296c19e34eee20137))
68
+ * **deps:** update dependency @keycloak/keycloak-admin-client to v22.0.5 ([e56d8ad](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/e56d8ada3b1b7e3ce0a456190f1d4a549309480c))
69
+ * **deps:** update dependency @slack/webhook to v7 ([87872b5](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/87872b5bf56877ace56b49e9b70ace6fd90778a2))
70
+ * **deps:** update dependency npm to v10 ([ff38e4f](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/ff38e4faa13b34d7794b9b36f46d11d61fdc90bf))
71
+ * **deps:** update dependency npm to v10.1.0 ([48bf21a](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/48bf21ae8c251993295901f75150580f3b2a9988))
72
+ * **deps:** update dependency npm to v10.2.0 ([203c3f0](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/203c3f03a25838e52dea15eefd564490ba137c2f))
73
+ * **deps:** update dependency npm to v10.2.1 ([1544ee5](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/1544ee58ce2cd0e6f1951d45ce77a4cbaf2b0fac))
74
+ * **deps:** update dependency npm to v9.7.1 ([1eeaf8f](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/1eeaf8fc51a643da62d46e0669751f732069ee3d))
75
+ * **deps:** update dependency openid-client to v5.4.3 ([6cc9fba](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/6cc9fba92585393bb50cc586a8a7f994b8a6431c))
76
+ * **deps:** update dependency openid-client to v5.5.0 ([efebce8](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/efebce81d16b95e9407bff874a62c5832bdc826e))
77
+ * **deps:** update dependency openid-client to v5.6.0 ([b9020b8](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/b9020b82786a5f5ead45262b756c09a58ff4eb3a))
78
+ * **deps:** update dependency openid-client to v5.6.1 ([ce75f52](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/ce75f527b58f3b3e0de240a0933f3bec79ddd7e1))
79
+ * **deps:** update dependency ramda to v0.29.1 ([015da4c](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/015da4c065810d4aeb3d19b3fbc55633f39ba6af))
80
+ * Fix chart deploy ([0f95f78](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/0f95f78cfcb98cac3da5b8c2bdf84c7bca324d57))
81
+ * **Kubernetes:** Adjust helm chart config error ([f074b0e](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/f074b0eca275e8ee07e0dad6096cd64962dcae80))
82
+ * Stick to NodeJS 16 ([595d799](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/595d799510e81de885430d7cc62549dd8a272aee))
83
+ * **Webhooks:** Corrected error handling ([afe2c60](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/afe2c601852ef5564fcaafe6b959475a4271a9ec))
84
+ * **Webhooks:** Correcting webhook additional message handling and improve error handling ([1fe6fdf](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/1fe6fdf3d93dd746c55ea3009a8414cfe3206d2f))
85
+
86
+
87
+ ### Features
88
+
89
+ * Adding report directory support for archiving ([9347ef1](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/9347ef116b8d753b21e66826792865971ce7571d))
90
+ * Allow chart to pass env vars ([37b19b4](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/37b19b428a07c373f308aee529a1ff376b87156e))
91
+ * **API:** Use audit endpoint ([8ed489a](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/8ed489ae0c3e6b66f8506a6d6b87147e50b9a06c))
92
+ * **Config:** Provide config file functionality ([f9097f9](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/f9097f966c2dfc5240111e9294742ad3821c36ad))
93
+ * **Config:** Use config file in helm chart ([21e0512](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/21e051243df1a3000d2b57f6ee0feab5f6314910))
94
+ * **Helm:** Adding OCI helm chart support ([4b3d433](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/4b3d433e2b94550541b821172c7d270abf2363fa))
95
+ * **Helm:** Initial chart version ([401c740](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/401c7401b1b34b479bb5a370c9d1077a36f653b0)), closes [#1](https://github.com/ContinuousSecurityTooling/keycloak-reporter/issues/1)
96
+ * **OCI:** Use OCI standard labels for container image ([3371f13](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/3371f136f51fa0482c253602b281ed508473ed44))
97
+ * **Report:** Adding id to report ([8dbc3d4](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/8dbc3d4deacba0a5e1729da93b8d933557ebd45b))
98
+ * **Security:** apt-upgrade in docker image ([3ac8217](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/3ac82179fcdcec5ff72179e1f33f5e0e9c50c45f))
99
+ * **Security:** Hardening deployment with security config ([3d9fdec](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/3d9fdec7174bc5287b7c382d4aec8207051d3a11))
100
+ * **Testing:** Adding end2end testing via keycloak local ([036202f](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/036202f47324e8b3e40764fdc3a43a270a2687cf))
101
+ * **Users:** Adding user and client listing functionality ([4c13fa0](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/4c13fa0642d75b8e229091aca052a83fa8c7eb32))
102
+ * **Webhook:** Allow custom text for message ([1707e24](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/1707e249c1c9c4c22b1510c767470a2670a4b33b))
103
+ * **Webhooks:** Adding Support for Teams and Slack ([66da168](https://github.com/ContinuousSecurityTooling/keycloak-reporter/commit/66da168d2cd234ebc6dd961cfe62a3c8191c0ccc)), closes [#2](https://github.com/ContinuousSecurityTooling/keycloak-reporter/issues/2)
package/Dockerfile CHANGED
@@ -1,6 +1,15 @@
1
- FROM node:18
1
+ FROM node:20
2
2
 
3
- LABEL org.opencontainers.image.source https://github.com/ContinuousSecurityTooling/keycloak-reporter
3
+ ARG BUILD_DATE
4
+ ARG APP_VERSION
5
+
6
+ LABEL org.opencontainers.image.authors='Martin Reinhardt (martin@m13t.de)' \
7
+ org.opencontainers.image.created=$BUILD_DATE \
8
+ org.opencontainers.image.version=$APP_VERSION \
9
+ org.opencontainers.image.url='https://hub.docker.com/r/continuoussecuritytooling/keycloak-reporting-cli' \
10
+ org.opencontainers.image.documentation='https://github.com/ContinuousSecurityTooling/keycloak-reporter' \
11
+ org.opencontainers.image.source='https://github.com/ContinuousSecurityTooling/keycloak-reporter.git' \
12
+ org.opencontainers.image.licenses='MIT'
4
13
 
5
14
  ENV CONFIG_FILE=/app/config.json
6
15
 
@@ -11,6 +20,11 @@ WORKDIR /app
11
20
  RUN cd /app && npm install --omit=dev &&\
12
21
  chown -R 1000:2000 /app
13
22
 
23
+ # apt update
24
+ RUN apt-get update && apt-get -y upgrade &&\
25
+ # clean up to slim image
26
+ apt-get clean autoclean && apt-get autoremove --yes && rm -rf /var/lib/{apt,dpkg,cache,log}/
27
+
14
28
  USER 1000
15
29
 
16
30
  ENTRYPOINT ["/app/docker_entrypoint.sh"]
package/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  # Keycloak Reporter
2
2
 
3
+ Keycloak user and client reporting tool for automated regular access checks.
3
4
 
4
5
  [![License](https://img.shields.io/github/license/ContinuousSecurityTooling/keycloak-reporter.svg)](LICENSE)
5
6
  [![CI](https://github.com/ContinuousSecurityTooling/keycloak-reporter/actions/workflows/pipeline.yml/badge.svg)](https://github.com/ContinuousSecurityTooling/keycloak-reporter/actions/workflows/pipeline.yml)
@@ -7,8 +8,8 @@
7
8
  [![npm downloads](https://img.shields.io/npm/dm/@continuoussecuritytooling%2Fkeycloak-reporter.svg)](https://www.npmjs.com/package/@continuoussecuritytooling/keycloak-reporter)
8
9
  [![Docker Stars](https://img.shields.io/docker/stars/continuoussecuritytooling/keycloak-reporting-cli.svg)](https://hub.docker.com/r/continuoussecuritytooling/keycloak-reporting-cli/)
9
10
  [![Known Vulnerabilities](https://snyk.io/test/github/ContinuousSecurityTooling/keycloak-reporter/badge.svg)](https://snyk.io/test/github/ContinuousSecurityTooling/keycloak-reporter)
10
-
11
11
  [![Docker Stars](https://img.shields.io/docker/stars/continuoussecuritytooling/keycloak-reporting-cli.svg)](https://hub.docker.com/r/continuoussecuritytooling/keycloak-reporting-cli/)
12
+ [![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/keycloak-reporter)](https://artifacthub.io/packages/helm/keycloak-reporter/keycloak-reporter)
12
13
 
13
14
  ## Usage
14
15
 
@@ -58,12 +59,15 @@ Valid commands are:
58
59
 
59
60
  ### Helm
60
61
 
61
- To install the Helm Chart use the OCI Package:
62
+ To install the Helm Chart use the [OCI Package Registry](https://github.com/orgs/CloudTooling/packages):
62
63
 
63
64
  ```
64
- helm install keycloak-reporter oci://cloudtooling/helm-charts
65
+ helm install keycloak-reporter oci://ghcr.io/cloudtooling/helm-charts
65
66
  ```
66
67
 
68
+ >**NOTE**
69
+ >Keep in mind, that you need a client/service account in keycloak with the appropriate rights. You can use this [template](.docs/realm-config.json) to deploy with [keycloak-config-cli](https://github.com/adorsys/keycloak-config-cli) a service account.
70
+
67
71
  ### Config file
68
72
 
69
73
  You can also provider a config file via env var `CONFIG_FILE` and then just provide the commands, e.g.:
@@ -85,4 +89,4 @@ And for Teams:
85
89
  kc-reporter listUsers <Keycloak_Root_URL> <Client_ID> <Client_Secret> --format=json --output=webhook --webhookType=teams --webhookUrl=$WEBHOOK_TESTING_TEAMS
86
90
  ```
87
91
  the following entry in slack will be created:
88
- ![Team Sample](.docs/webhook-teams-sample.png)
92
+ ![Team Sample](.docs/webhook-teams-sample.png)
@@ -0,0 +1,6 @@
1
+ # Artifact Hub repository metadata file
2
+ # Used to become verified publisher and more - https://artifacthub.io/docs/topics/repositories/#verified-publisher
3
+ repositoryID: 7283911f-50c6-484a-961c-36546321ef56
4
+ owners:
5
+ - name: hypery2k
6
+ email: martin@m13t.de
@@ -1,6 +1,6 @@
1
1
  apiVersion: v2
2
2
  name: keycloak-reporter
3
- description: A Helm chart for Kubernetes
3
+ description: Keycloak user and client reporting tool for automated regular access checks.
4
4
 
5
5
  # A chart can be either an 'application' or a 'library' chart.
6
6
  #
@@ -15,15 +15,21 @@ type: application
15
15
  # This is the chart version. This version number should be incremented each time you make changes
16
16
  # to the chart and its templates, including the app version.
17
17
  # Versions are expected to follow Semantic Versioning (https://semver.org/)
18
- version: 1.0.0
18
+ version: 1.2.1
19
19
 
20
20
  # This is the version number of the application being deployed. This version number should be
21
21
  # incremented each time you make changes to the application. Versions are not expected to
22
22
  # follow Semantic Versioning. They should reflect the version the application is using.
23
23
  # It is recommended to use it with quotes.
24
- # renovate: datasource=github-tags depName=ContinuousSecurityTooling/keycloak-reporter
25
- appVersion: "0.6.0"
24
+ # renovate: datasource=docker depName=ContinuousSecurityTooling/keycloak-reporter
25
+ appVersion: '0.8.0'
26
26
  maintainers:
27
27
  # Martin Reinhardt
28
28
  - name: hypery2k
29
29
  email: martin@m13t.de
30
+ annotations:
31
+ artifacthub.io/links: |
32
+ - name: GitHub
33
+ url: https://github.com/ContinuousSecurityTooling/keycloak-reporter
34
+ - name: Keycloak Auditor
35
+ url: https://github.com/ContinuousSecurityTooling/keycloak-auditor
@@ -1,8 +1,8 @@
1
1
  # keycloak-reporter
2
2
 
3
- ![Version: 1.0.0](https://img.shields.io/badge/Version-1.0.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.5.0](https://img.shields.io/badge/AppVersion-0.5.0-informational?style=flat-square)
3
+ ![Version: 1.2.1](https://img.shields.io/badge/Version-1.2.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.8.0](https://img.shields.io/badge/AppVersion-0.8.0-informational?style=flat-square)
4
4
 
5
- A Helm chart for Kubernetes
5
+ Keycloak user and client reporting tool for automated regular access checks.
6
6
 
7
7
  ## Maintainers
8
8
 
@@ -15,32 +15,23 @@ A Helm chart for Kubernetes
15
15
  | Key | Type | Default | Description |
16
16
  |-----|------|---------|-------------|
17
17
  | affinity | object | `{}` | |
18
- | cronjobs.clients | string | `"0 0 1 */3 *"` | |
19
- | cronjobs.users | string | `"0 0 1 */3 *"` | |
20
- | env | object | `{}` | |
18
+ | cronjobs | map | `{"clients":"0 0 1 */3 *","users":"0 0 1 */3 *"}` | Cron configuration |
19
+ | env | map | `{}` | additonal environment variables |
21
20
  | fullnameOverride | string | `""` | |
22
21
  | image.pullPolicy | string | `"IfNotPresent"` | |
23
22
  | image.repository | string | `"continuoussecuritytooling/keycloak-reporting-cli"` | |
23
+ | image.tag | string | `""` | |
24
24
  | imagePullSecrets | list | `[]` | |
25
- | keycloak.config.clientId | string | `""` | |
26
- | keycloak.config.clientSecret | string | `""` | |
27
- | keycloak.config.output | string | `"webhook"` | |
28
- | keycloak.config.url | string | `""` | |
25
+ | keycloak | map | `{"config":{"clientId":"","clientSecret":"","output":"webhook","url":"","useAuditingEndpoint":false,"webhookMessage":"","webhookType":"","webhookUrl":""},"volumes":{"reports":""}}` | Keycloak configuration |
29
26
  | keycloak.config.webhookMessage | string | `""` | optional message for the webhook post |
30
- | keycloak.config.webhookType | string | `""` | |
31
- | keycloak.config.webhookUrl | string | `""` | |
32
- | keycloak.volumes.reports | string | `""` | |
33
27
  | nameOverride | string | `""` | |
34
28
  | nodeSelector | object | `{}` | |
35
29
  | podAnnotations | object | `{}` | |
36
- | podSecurityContext | object | `{}` | |
37
30
  | replicaCount | int | `1` | |
38
- | resources | object | `{}` | |
39
- | securityContext | object | `{}` | |
40
31
  | serviceAccount.annotations | object | `{}` | |
41
32
  | serviceAccount.create | bool | `true` | |
42
33
  | serviceAccount.name | string | `""` | |
43
34
  | tolerations | list | `[]` | |
44
35
 
45
36
  ----------------------------------------------
46
- Autogenerated from chart metadata using [helm-docs v1.11.2](https://github.com/norwoodj/helm-docs/releases/v1.11.2)
37
+ Autogenerated from chart metadata using [helm-docs v1.11.3](https://github.com/norwoodj/helm-docs/releases/v1.11.3)
@@ -0,0 +1,13 @@
1
+ env:
2
+ - name: CLIENT_ID
3
+ value: "clientId"
4
+ - name: CLIENT_SECRET
5
+ valueFrom:
6
+ secretKeyRef:
7
+ key: clientSecret
8
+ name: kc-reporter
9
+ keycloak:
10
+ config:
11
+ url: http://localhost:8080
12
+ webhookType: test
13
+ webhookUrl: http://localhost:8888
@@ -18,7 +18,6 @@ spec:
18
18
  imagePullSecrets:
19
19
  {{- toYaml . | nindent 12 }}
20
20
  {{- end }}
21
- # automountServiceAccountToken: false # fix KubernetesClustersShouldDisableAutomountingAPICredentialsMonitoringEffect OPA policy
22
21
  serviceAccountName: {{ default "default" ($.Values.serviceAccount).name }}
23
22
  securityContext:
24
23
  {{- toYaml $.Values.podSecurityContext | nindent 12 }}
@@ -28,14 +27,14 @@ spec:
28
27
  imagePullPolicy: {{ $.Values.image.pullPolicy }}
29
28
  command:
30
29
  - node
31
- - /app/cli.js
30
+ - /app/cli.js
32
31
  - {{ $config.script }}
33
32
  env:
34
33
  - name: CONFIG_FILE
35
34
  value: "/app/config.json"
36
- {{- with $.Values.env }}
37
- {{- tpl (toYaml .) $ | nindent 12 }}
38
- {{- end }}
35
+ {{- with $.Values.env }}
36
+ {{- tpl (toYaml .) $ | nindent 16 }}
37
+ {{- end }}
39
38
  {{- if $.Values.resources }}
40
39
  resources:
41
40
  {{- toYaml $.Values.resources | nindent 16 }}
@@ -0,0 +1,57 @@
1
+ {{- $fullName := include "keycloak-reporter.fullname" . }}
2
+ apiVersion: v1
3
+ kind: Pod
4
+ metadata:
5
+ name: {{ printf "%s-test-connection" $fullName }}
6
+ annotations:
7
+ helm.sh/hook: test
8
+ helm.sh/hook-delete-policy: "hook-succeeded,before-hook-creation"
9
+ helm.sh/hook-weight: "5"
10
+ spec:
11
+ containers:
12
+ - name: config-test
13
+ image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag | default $.Chart.AppVersion }}"
14
+ imagePullPolicy: {{ $.Values.image.pullPolicy }}
15
+ command:
16
+ - node
17
+ - /app/cli.js
18
+ - configTest
19
+ env:
20
+ - name: CONFIG_FILE
21
+ value: "/app/config.json"
22
+ {{- with $.Values.env }}
23
+ {{- tpl (toYaml .) $ | nindent 8 }}
24
+ {{- end }}
25
+ {{- if $.Values.resources }}
26
+ resources:
27
+ {{- toYaml $.Values.resources | nindent 10 }}
28
+ {{- end }}
29
+ securityContext:
30
+ {{- toYaml $.Values.securityContext | nindent 10 }}
31
+ volumeMounts:
32
+ - name: config-file
33
+ mountPath: "/app/config.json"
34
+ subPath: "config.json"
35
+ readOnly: true
36
+ {{- if ($.Values.keycloak.config.volumes).reports }}
37
+ - name: reports-dir
38
+ mountPath: "/app/reports"
39
+ {{- end }}
40
+ {{- if $.Values.nodeSelector }}
41
+ nodeSelector:
42
+ {{ toYaml $.Values.nodeSelector | nindent 4 }}
43
+ {{- end }}
44
+ {{- if $.Values.tolerations }}
45
+ tolerations:
46
+ {{ toYaml $.Values.tolerations | nindent 4 }}
47
+ {{- end }}
48
+ volumes:
49
+ - name: config-file
50
+ secret:
51
+ secretName: {{ $fullName }}
52
+ {{- if ($.Values.keycloak.config.volumes).reports }}
53
+ - name: reports-dir
54
+ persistentVolumeClaim:
55
+ claimName: {{ $fullName }}-reports
56
+ {{- end }}
57
+ restartPolicy: Never
@@ -8,7 +8,7 @@ image:
8
8
  repository: continuoussecuritytooling/keycloak-reporting-cli
9
9
  pullPolicy: IfNotPresent
10
10
  # Overrides the image tag whose default is the chart appVersion.
11
- #tag: "latest"
11
+ tag: ""
12
12
 
13
13
  imagePullSecrets: []
14
14
  nameOverride: ''
@@ -51,6 +51,7 @@ keycloak:
51
51
  output: 'webhook'
52
52
  webhookType: ''
53
53
  webhookUrl: ''
54
+ useAuditingEndpoint: false
54
55
  # -- optional message for the webhook post
55
56
  webhookMessage: ''
56
57
  volumes: