@continuoussecuritytooling/keycloak-reporter 0.5.1 → 0.6.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.
- package/Dockerfile +4 -1
- package/charts/keycloak-reporter/Chart.yaml +1 -1
- package/charts/keycloak-reporter/README.md +4 -9
- package/charts/keycloak-reporter/templates/_helpers.tpl +8 -8
- package/charts/keycloak-reporter/templates/cronjob.yaml +21 -16
- package/charts/keycloak-reporter/templates/secret.yaml +6 -8
- package/charts/keycloak-reporter/values.yaml +40 -38
- package/cli.ts +2 -0
- package/dist/cli.js +18 -17
- package/dist/cli.js.map +1 -1
- package/package.json +2 -2
- package/config.json +0 -9
- package/k8s.yaml +0 -51
- package/keycloak-reporter-0.5.0.tgz +0 -0
- package/test.values.yaml +0 -8
package/Dockerfile
CHANGED
|
@@ -22,7 +22,7 @@ version: 1.0.0
|
|
|
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
24
|
# renovate: datasource=github-tags depName=ContinuousSecurityTooling/keycloak-reporter
|
|
25
|
-
appVersion: "0.
|
|
25
|
+
appVersion: "0.6.0"
|
|
26
26
|
maintainers:
|
|
27
27
|
# Martin Reinhardt
|
|
28
28
|
- name: hypery2k
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# keycloak-reporter
|
|
2
2
|
|
|
3
|
-
  
|
|
4
4
|
|
|
5
5
|
A Helm chart for Kubernetes
|
|
6
6
|
|
|
@@ -15,17 +15,12 @@ A Helm chart for Kubernetes
|
|
|
15
15
|
| Key | Type | Default | Description |
|
|
16
16
|
|-----|------|---------|-------------|
|
|
17
17
|
| affinity | object | `{}` | |
|
|
18
|
-
| cronjobs
|
|
19
|
-
| cronjobs
|
|
20
|
-
| cronjobs[0].script | string | `"/app/index.js listClients"` | |
|
|
21
|
-
| cronjobs[1].name | string | `"users"` | |
|
|
22
|
-
| cronjobs[1].schedule | string | `"0 0 1 */3 *"` | |
|
|
23
|
-
| cronjobs[1].script | string | `"/app/index.js listUsers"` | |
|
|
18
|
+
| cronjobs.clients | string | `"0 0 1 */3 *"` | |
|
|
19
|
+
| cronjobs.users | string | `"0 0 1 */3 *"` | |
|
|
24
20
|
| env | object | `{}` | |
|
|
25
21
|
| fullnameOverride | string | `""` | |
|
|
26
22
|
| image.pullPolicy | string | `"IfNotPresent"` | |
|
|
27
23
|
| image.repository | string | `"continuoussecuritytooling/keycloak-reporting-cli"` | |
|
|
28
|
-
| image.tag | string | `"latest"` | |
|
|
29
24
|
| imagePullSecrets | list | `[]` | |
|
|
30
25
|
| keycloak.config.clientId | string | `""` | |
|
|
31
26
|
| keycloak.config.clientSecret | string | `""` | |
|
|
@@ -48,4 +43,4 @@ A Helm chart for Kubernetes
|
|
|
48
43
|
| tolerations | list | `[]` | |
|
|
49
44
|
|
|
50
45
|
----------------------------------------------
|
|
51
|
-
Autogenerated from chart metadata using [helm-docs v1.11.
|
|
46
|
+
Autogenerated from chart metadata using [helm-docs v1.11.2](https://github.com/norwoodj/helm-docs/releases/v1.11.2)
|
|
@@ -66,18 +66,18 @@ Create the name of the service account to use
|
|
|
66
66
|
{{/*
|
|
67
67
|
Create the name of the service account to use
|
|
68
68
|
*/}}
|
|
69
|
-
{{- define "keycloak-reporter.cronJobs" }}
|
|
70
|
-
{{- $cronJobs := list -}}
|
|
69
|
+
{{- define "keycloak-reporter.cronJobs" -}}
|
|
71
70
|
{{- if .Values.cronjobs.users }}
|
|
72
|
-
|
|
73
|
-
|
|
71
|
+
users:
|
|
72
|
+
script: "listUsers"
|
|
73
|
+
schedule: {{ .Values.cronjobs.users }}
|
|
74
74
|
{{- end }}
|
|
75
75
|
{{- if .Values.cronjobs.clients }}
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
{{
|
|
79
|
-
{{ join "," $cronJobs }}
|
|
76
|
+
clients:
|
|
77
|
+
script: "listClients"
|
|
78
|
+
schedule: {{ .Values.cronjobs.clients }}
|
|
80
79
|
{{- end }}
|
|
80
|
+
{{- end -}}
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
|
|
@@ -1,38 +1,47 @@
|
|
|
1
1
|
{{- $fullName := include "keycloak-reporter.fullname" . }}
|
|
2
|
-
{{- range include "keycloak-reporter.cronJobs" $ |
|
|
2
|
+
{{- range $name, $config := include "keycloak-reporter.cronJobs" $ | fromYaml }}
|
|
3
3
|
apiVersion: batch/v1
|
|
4
4
|
kind: CronJob
|
|
5
5
|
metadata:
|
|
6
|
-
name: {{ printf "%s-job-%s" $fullName
|
|
6
|
+
name: {{ printf "%s-job-%s" $fullName $name }}
|
|
7
7
|
spec:
|
|
8
|
-
schedule:
|
|
8
|
+
schedule: {{ $config.schedule }}
|
|
9
9
|
jobTemplate:
|
|
10
10
|
spec:
|
|
11
11
|
template:
|
|
12
12
|
{{- with $.Values.podAnnotations }}
|
|
13
13
|
annotations:
|
|
14
|
-
{{- toYaml
|
|
14
|
+
{{- toYaml $ | nindent 10 }}
|
|
15
15
|
{{- end }}
|
|
16
16
|
spec:
|
|
17
17
|
{{- with $.Values.imagePullSecrets }}
|
|
18
18
|
imagePullSecrets:
|
|
19
|
-
{{- toYaml . | nindent
|
|
19
|
+
{{- toYaml . | nindent 12 }}
|
|
20
20
|
{{- end }}
|
|
21
|
+
# automountServiceAccountToken: false # fix KubernetesClustersShouldDisableAutomountingAPICredentialsMonitoringEffect OPA policy
|
|
22
|
+
serviceAccountName: {{ default "default" ($.Values.serviceAccount).name }}
|
|
23
|
+
securityContext:
|
|
24
|
+
{{- toYaml $.Values.podSecurityContext | nindent 12 }}
|
|
21
25
|
containers:
|
|
22
|
-
- name: {{
|
|
26
|
+
- name: {{ $name }}
|
|
23
27
|
image: "{{ $.Values.image.repository }}:{{ $.Values.image.tag | default $.Chart.AppVersion }}"
|
|
24
28
|
imagePullPolicy: {{ $.Values.image.pullPolicy }}
|
|
25
29
|
command:
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
node /app/cli.js {{ .script }}
|
|
30
|
+
- node
|
|
31
|
+
- /app/cli.js
|
|
32
|
+
- {{ $config.script }}
|
|
30
33
|
env:
|
|
31
34
|
- name: CONFIG_FILE
|
|
32
35
|
value: "/app/config.json"
|
|
33
36
|
{{- with $.Values.env }}
|
|
34
37
|
{{- tpl (toYaml .) $ | nindent 12 }}
|
|
35
38
|
{{- end }}
|
|
39
|
+
{{- if $.Values.resources }}
|
|
40
|
+
resources:
|
|
41
|
+
{{- toYaml $.Values.resources | nindent 16 }}
|
|
42
|
+
{{- end }}
|
|
43
|
+
securityContext:
|
|
44
|
+
{{- toYaml $.Values.securityContext | nindent 16 }}
|
|
36
45
|
volumeMounts:
|
|
37
46
|
- name: config-file
|
|
38
47
|
mountPath: "/app/config.json"
|
|
@@ -43,17 +52,13 @@ spec:
|
|
|
43
52
|
mountPath: "/app/reports"
|
|
44
53
|
{{- end }}
|
|
45
54
|
restartPolicy: OnFailure
|
|
46
|
-
{{- if $.Values.resources }}
|
|
47
|
-
resources:
|
|
48
|
-
{{ toYaml $.Values.resources }}
|
|
49
|
-
{{- end }}
|
|
50
55
|
{{- if $.Values.nodeSelector }}
|
|
51
56
|
nodeSelector:
|
|
52
|
-
{{ toYaml $.Values.nodeSelector |
|
|
57
|
+
{{ toYaml $.Values.nodeSelector | nindent 12 }}
|
|
53
58
|
{{- end }}
|
|
54
59
|
{{- if $.Values.tolerations }}
|
|
55
60
|
tolerations:
|
|
56
|
-
{{ toYaml $.Values.tolerations |
|
|
61
|
+
{{ toYaml $.Values.tolerations | nindent 12 }}
|
|
57
62
|
{{- end }}
|
|
58
63
|
volumes:
|
|
59
64
|
- name: config-file
|
|
@@ -4,11 +4,9 @@ kind: Secret
|
|
|
4
4
|
metadata:
|
|
5
5
|
name: {{ $fullName }}
|
|
6
6
|
stringData:
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
reports: /app/reports
|
|
14
|
-
{{- end }}
|
|
7
|
+
config.json: |
|
|
8
|
+
{{- $config:= .Values.keycloak.config }}
|
|
9
|
+
{{- if (.Values.keycloak.config.volumes).reports }}
|
|
10
|
+
$config := merge $config (dict "reports" "/app/reports")
|
|
11
|
+
{{- end }}
|
|
12
|
+
{{ $config | toJson }}
|
|
@@ -11,8 +11,8 @@ image:
|
|
|
11
11
|
#tag: "latest"
|
|
12
12
|
|
|
13
13
|
imagePullSecrets: []
|
|
14
|
-
nameOverride:
|
|
15
|
-
fullnameOverride:
|
|
14
|
+
nameOverride: ''
|
|
15
|
+
fullnameOverride: ''
|
|
16
16
|
|
|
17
17
|
serviceAccount:
|
|
18
18
|
# Specifies whether a service account should be created
|
|
@@ -21,52 +21,54 @@ serviceAccount:
|
|
|
21
21
|
annotations: {}
|
|
22
22
|
# The name of the service account to use.
|
|
23
23
|
# If not set and create is true, a name is generated using the fullname template
|
|
24
|
-
name:
|
|
24
|
+
name: ''
|
|
25
25
|
|
|
26
26
|
podAnnotations: {}
|
|
27
|
-
|
|
28
|
-
podSecurityContext:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
# @ignore, Configure pod security context
|
|
28
|
+
podSecurityContext:
|
|
29
|
+
runAsNonRoot: true
|
|
30
|
+
runAsUser: 1000
|
|
31
|
+
fsGroup: 2000
|
|
32
|
+
# @ignore, Configure security context
|
|
33
|
+
securityContext:
|
|
34
|
+
runAsUser: 1000
|
|
35
|
+
runAsNonRoot: true
|
|
36
|
+
readOnlyRootFilesystem: true
|
|
37
|
+
allowPrivilegeEscalation: false
|
|
38
|
+
# Hardening
|
|
39
|
+
capabilities:
|
|
40
|
+
drop: ['ALL']
|
|
41
|
+
seccompProfile:
|
|
42
|
+
type: 'RuntimeDefault'
|
|
43
|
+
# -- (map) additonal environment variables
|
|
33
44
|
env: {}
|
|
34
|
-
|
|
35
|
-
# drop:
|
|
36
|
-
# - ALL
|
|
37
|
-
# readOnlyRootFilesystem: true
|
|
38
|
-
# runAsNonRoot: true
|
|
39
|
-
# runAsUser: 1000
|
|
40
|
-
|
|
45
|
+
# -- (map) Keycloak configuration
|
|
41
46
|
keycloak:
|
|
42
47
|
config:
|
|
43
|
-
url:
|
|
44
|
-
clientId:
|
|
45
|
-
clientSecret:
|
|
46
|
-
output:
|
|
47
|
-
webhookType:
|
|
48
|
-
webhookUrl:
|
|
48
|
+
url: ''
|
|
49
|
+
clientId: ''
|
|
50
|
+
clientSecret: ''
|
|
51
|
+
output: 'webhook'
|
|
52
|
+
webhookType: ''
|
|
53
|
+
webhookUrl: ''
|
|
49
54
|
# -- optional message for the webhook post
|
|
50
|
-
webhookMessage:
|
|
55
|
+
webhookMessage: ''
|
|
51
56
|
volumes:
|
|
52
|
-
reports:
|
|
57
|
+
reports: ''
|
|
53
58
|
|
|
59
|
+
# -- (map) Cron configuration
|
|
54
60
|
cronjobs:
|
|
55
|
-
clients:
|
|
56
|
-
users:
|
|
57
|
-
|
|
58
|
-
resources: {}
|
|
59
|
-
# We usually recommend not to specify default resources and to leave this as a conscious
|
|
60
|
-
# choice for the user. This also increases chances charts run on environments with little
|
|
61
|
-
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
|
62
|
-
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
|
63
|
-
# limits:
|
|
64
|
-
# cpu: 100m
|
|
65
|
-
# memory: 128Mi
|
|
66
|
-
# requests:
|
|
67
|
-
# cpu: 100m
|
|
68
|
-
# memory: 128Mi
|
|
61
|
+
clients: '0 0 1 */3 *'
|
|
62
|
+
users: '0 0 1 */3 *'
|
|
69
63
|
|
|
64
|
+
# @ignore, Configure resource limits
|
|
65
|
+
resources:
|
|
66
|
+
limits:
|
|
67
|
+
cpu: 200m
|
|
68
|
+
memory: 256Mi
|
|
69
|
+
requests:
|
|
70
|
+
cpu: 100m
|
|
71
|
+
memory: 128Mi
|
|
70
72
|
|
|
71
73
|
nodeSelector: {}
|
|
72
74
|
|
package/cli.ts
CHANGED
|
@@ -62,6 +62,7 @@ async function convert(
|
|
|
62
62
|
switch (output) {
|
|
63
63
|
case 'webhook':
|
|
64
64
|
try {
|
|
65
|
+
console.log(`Sending report via webhook to ${config.type} ....`);
|
|
65
66
|
await post2Webhook(
|
|
66
67
|
config.type,
|
|
67
68
|
config.url,
|
|
@@ -69,6 +70,7 @@ async function convert(
|
|
|
69
70
|
outputContent,
|
|
70
71
|
config.message
|
|
71
72
|
);
|
|
73
|
+
console.log('Done sending.');
|
|
72
74
|
} catch (e) {
|
|
73
75
|
switch (e.code || e.message) {
|
|
74
76
|
case 'Request failed with status code 400':
|
package/dist/cli.js
CHANGED
|
@@ -17,7 +17,6 @@ class ReportConfig {
|
|
|
17
17
|
}
|
|
18
18
|
async function convert(format, output, reports, config, json) {
|
|
19
19
|
let outputContent;
|
|
20
|
-
console.log(output);
|
|
21
20
|
switch (format) {
|
|
22
21
|
case 'csv':
|
|
23
22
|
outputContent = (await convertJSON2CSV(json)).toString();
|
|
@@ -33,7 +32,9 @@ async function convert(format, output, reports, config, json) {
|
|
|
33
32
|
switch (output) {
|
|
34
33
|
case 'webhook':
|
|
35
34
|
try {
|
|
35
|
+
console.log(`Sending report via webhook to ${config.type} ....`);
|
|
36
36
|
await post2Webhook(config.type, config.url, config.title, outputContent, config.message);
|
|
37
|
+
console.log('Done sending.');
|
|
37
38
|
}
|
|
38
39
|
catch (e) {
|
|
39
40
|
switch (e.code || e.message) {
|
|
@@ -59,39 +60,39 @@ yargs(hideBin(process.argv))
|
|
|
59
60
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
60
61
|
() => { }, async (argv) => {
|
|
61
62
|
const users = await listUsers({
|
|
62
|
-
clientId:
|
|
63
|
-
clientSecret:
|
|
64
|
-
?
|
|
65
|
-
:
|
|
66
|
-
rootUrl:
|
|
63
|
+
clientId: config.clientId ? config.clientId : argv.clientId,
|
|
64
|
+
clientSecret: config.clientSecret
|
|
65
|
+
? config.clientSecret
|
|
66
|
+
: argv.clientSecret,
|
|
67
|
+
rootUrl: config.url ? config.url : argv.url
|
|
67
68
|
});
|
|
68
69
|
await convert(config.format ? config.format : argv.format, config.output ? config.output : argv.output, {
|
|
69
70
|
name: 'user_listing',
|
|
70
71
|
directory: argv.reports ? argv.reports : config.reports
|
|
71
72
|
}, new WebhookConfig(config.webhookType
|
|
72
73
|
? config.webhookType
|
|
73
|
-
: argv.webhookType, config.webhookUrl ? config.webhookUrl : argv.webhookUrl, 'User Listing',
|
|
74
|
-
?
|
|
75
|
-
:
|
|
74
|
+
: argv.webhookType, config.webhookUrl ? config.webhookUrl : argv.webhookUrl, 'User Listing', config.webhookMessage
|
|
75
|
+
? config.webhookMessage
|
|
76
|
+
: argv.webhookMessage), users);
|
|
76
77
|
})
|
|
77
78
|
.command('listClients [url] [clientId] [clientSecret]', 'fetches all clients in the realms.',
|
|
78
79
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
79
80
|
() => { }, async (argv) => {
|
|
80
81
|
const clients = await listClients({
|
|
81
|
-
clientId:
|
|
82
|
-
clientSecret:
|
|
83
|
-
?
|
|
84
|
-
:
|
|
85
|
-
rootUrl:
|
|
82
|
+
clientId: config.clientId ? config.clientId : argv.clientId,
|
|
83
|
+
clientSecret: config.clientSecret
|
|
84
|
+
? config.clientSecret
|
|
85
|
+
: argv.clientSecret,
|
|
86
|
+
rootUrl: config.url ? config.url : argv.url
|
|
86
87
|
});
|
|
87
88
|
await convert(config.format ? config.format : argv.format, config.output ? config.output : argv.output, {
|
|
88
89
|
name: 'client_listing',
|
|
89
90
|
directory: argv.reports ? argv.reports : config.reports
|
|
90
91
|
}, new WebhookConfig(config.webhookType
|
|
91
92
|
? config.webhookType
|
|
92
|
-
: argv.webhookType, config.webhookUrl ? config.webhookUrl : argv.webhookUrl, 'Client Listing',
|
|
93
|
-
?
|
|
94
|
-
:
|
|
93
|
+
: argv.webhookType, config.webhookUrl ? config.webhookUrl : argv.webhookUrl, 'Client Listing', config.webhookMessage
|
|
94
|
+
? config.webhookMessage
|
|
95
|
+
: argv.webhookMessage), clients);
|
|
95
96
|
})
|
|
96
97
|
.option('format', {
|
|
97
98
|
alias: 'f',
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,SAAS,EACT,WAAW,EAEX,eAAe,EACf,YAAY,EACb,MAAM,YAAY,CAAC;AACpB,OAAO,MAAM,MAAM,iBAAiB,CAAC;AAErC,MAAM,aAAa;IAKjB,YAAY,IAAY,EAAE,GAAW,EAAE,KAAa,EAAE,OAAgB;QACpE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;CACF;AAED,MAAM,YAAY;CAGjB;AAED,KAAK,UAAU,OAAO,CACpB,MAAc,EACd,MAAc,EACd,OAAqB,EACrB,MAAqB,EACrB,IAAY;IAEZ,IAAI,aAAqB,CAAC;IAC1B,
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,MAAM,aAAa,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EACL,SAAS,EACT,WAAW,EAEX,eAAe,EACf,YAAY,EACb,MAAM,YAAY,CAAC;AAC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IACxB,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,iBAAiB;CAC/B,CAAC;KACD,MAAM,CAAC,YAAY,EAAE;IACpB,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,aAAa;CAC3B,CAAC;KACD,MAAM,CAAC,SAAS,EAAE;IACjB,KAAK,EAAE,GAAG;IACV,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,mBAAmB;CACjC,CAAC;KACD,KAAK,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@continuoussecuritytooling/keycloak-reporter",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Reporting Tools for Keycloak",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@json2csv/node": "^7.0.0",
|
|
29
29
|
"@keycloak/keycloak-admin-client": "^22.0.0",
|
|
30
|
-
"@slack/webhook": "^
|
|
30
|
+
"@slack/webhook": "^7.0.0",
|
|
31
31
|
"ajv": "^8.12.0",
|
|
32
32
|
"install": "^0.13.0",
|
|
33
33
|
"ms-teams-webhook": "^2.0.2",
|
package/config.json
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"url": "https://id.m13t.de",
|
|
3
|
-
"clientId": "admin-cli",
|
|
4
|
-
"clientSecret": "PWkJ98Atq36QFP5Z25YXJDWs4tvsGvkI",
|
|
5
|
-
"output": "webhook",
|
|
6
|
-
"webhookType": "teams",
|
|
7
|
-
"webhookUrl": "https://m13t4mgmt.webhook.office.com/webhookb2/02950819-c8ca-4c83-9751-808d801e8810@09f6f098-3af9-474c-a398-d17786fff1bf/IncomingWebhook/b06222e267a04255aaa32a341acb1749/a4f92b5b-01c7-40a8-91ff-0695e08d76ff",
|
|
8
|
-
"webhookMessage": "TEST"
|
|
9
|
-
}
|
package/k8s.yaml
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
apiVersion: batch/v1
|
|
2
|
-
kind: Job
|
|
3
|
-
metadata:
|
|
4
|
-
name: test-job
|
|
5
|
-
namespace: kc-reporter
|
|
6
|
-
spec:
|
|
7
|
-
suspend: false
|
|
8
|
-
template:
|
|
9
|
-
spec:
|
|
10
|
-
containers:
|
|
11
|
-
- command:
|
|
12
|
-
- /bin/sh
|
|
13
|
-
- -c
|
|
14
|
-
- |
|
|
15
|
-
while true; do sleep 30; done;
|
|
16
|
-
env:
|
|
17
|
-
- name: CONFIG_FILE
|
|
18
|
-
value: /app/config.json
|
|
19
|
-
image: continuoussecuritytooling/keycloak-reporting-cli:0.5.1
|
|
20
|
-
imagePullPolicy: IfNotPresent
|
|
21
|
-
name: users
|
|
22
|
-
resources: {}
|
|
23
|
-
terminationMessagePath: /dev/termination-log
|
|
24
|
-
terminationMessagePolicy: File
|
|
25
|
-
volumeMounts:
|
|
26
|
-
- mountPath: /app/config.json
|
|
27
|
-
name: config-file
|
|
28
|
-
readOnly: true
|
|
29
|
-
subPath: config.json
|
|
30
|
-
dnsPolicy: ClusterFirst
|
|
31
|
-
restartPolicy: OnFailure
|
|
32
|
-
schedulerName: default-scheduler
|
|
33
|
-
securityContext: {}
|
|
34
|
-
terminationGracePeriodSeconds: 30
|
|
35
|
-
volumes:
|
|
36
|
-
- name: config-file
|
|
37
|
-
secret:
|
|
38
|
-
defaultMode: 420
|
|
39
|
-
secretName: kc-reporter-test-keycloak-reporter
|
|
40
|
-
status:
|
|
41
|
-
conditions:
|
|
42
|
-
- lastProbeTime: "2023-10-07T07:43:08Z"
|
|
43
|
-
lastTransitionTime: "2023-10-07T07:43:08Z"
|
|
44
|
-
message: Job has reached the specified backoff limit
|
|
45
|
-
reason: BackoffLimitExceeded
|
|
46
|
-
status: "True"
|
|
47
|
-
type: Failed
|
|
48
|
-
failed: 1
|
|
49
|
-
ready: 0
|
|
50
|
-
startTime: "2023-10-07T07:37:15Z"
|
|
51
|
-
uncountedTerminatedPods: {}
|
|
Binary file
|
package/test.values.yaml
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
installCRDs: true
|
|
2
|
-
keycloak:
|
|
3
|
-
config:
|
|
4
|
-
clientId: admin-cli
|
|
5
|
-
clientSecret: PWkJ98Atq36QFP5Z25YXJDWs4tvsGvkI
|
|
6
|
-
webhookType: teams
|
|
7
|
-
webhookUrl: https://m13t4mgmt.webhook.office.com/webhookb2/02950819-c8ca-4c83-9751-808d801e8810@09f6f098-3af9-474c-a398-d17786fff1bf/IncomingWebhook/b06222e267a04255aaa32a341acb1749/a4f92b5b-01c7-40a8-91ff-0695e08d76ff
|
|
8
|
-
webhookMessage: TEST
|