Skip to content

Commit 87a0e8c

Browse files
authored
Merge pull request #8 from hazcod/feat/overview
Feature: send an overview to the Security/Fallback user
2 parents 9280382 + b827bae commit 87a0e8c

File tree

10 files changed

+472
-284
lines changed

10 files changed

+472
-284
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@ updates:
77
time: '04:00'
88
open-pull-requests-limit: 10
99
target-branch: dev
10+
- package-ecosystem: docker
11+
directory: "/"
12+
schedule:
13+
interval: daily
14+
time: '04:00'
15+
open-pull-requests-limit: 10
16+
target-branch: dev
1017
- package-ecosystem: github-actions
1118
directory: "/"
1219
schedule:

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
12
FROM alpine:latest AS builder
23

34
# add ca certificates and timezone data files
@@ -31,4 +32,4 @@ COPY --chown=app css /app
3132
USER 1000
3233

3334
# entrypoint
34-
ENTRYPOINT ["/app"]
35+
ENTRYPOINT ["/app"]

Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,3 @@ clean:
66
build:
77
go build -o slacker ./cmd/
88
chmod +x slacker
9-

README.md

Lines changed: 39 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,33 +15,56 @@ slack:
1515
# slack bot token
1616
token: "XXX"
1717
# Slack user that receives messages if the user is not found
18-
fallback_user: "[email protected]"
18+
security_user: "[email protected]"
1919

2020
falcon:
2121
clientid: "XXX"
2222
secret: "XXX"
2323
cloud_region: "eu-1"
24+
# skip vulnerabilities without patches available
25+
skip_no_mitigation: true
2426

2527
email:
2628
# email domain
2729
domain: "mycompany"
2830

2931
# what is sent to the user in Go templating
30-
message: |
31-
*:warning: We found security vulnerabilities on your device(s)*
32-
Hi {{ .Slack.Profile.FirstName }} {{ .Slack.Profile.LastName }}! One or more of your devices seem to be vulnerable.
33-
Luckily we noticed there are patches available. :tada:
34-
Can you please update following software as soon as possible?
35-
36-
{{ range $device := .User.Devices }}
37-
:computer: {{ $device.MachineName }}
38-
{{ range $vuln := $device.Findings }}
39-
`{{ $vuln.ProductName }}`
40-
{{ end }}
41-
{{ end }}
42-
43-
Please update them as soon as possible. In case of any issues, hop into *#security*.
44-
Thank you! :wave:
32+
templates:
33+
user_message: |
34+
*:warning: We found security vulnerabilities on your device(s)*
35+
Hi {{ .Slack.Profile.FirstName }} {{ .Slack.Profile.LastName }}! One or more of your devices seem to be vulnerable.
36+
Luckily we noticed there are patches available. :tada:
37+
Can you please update following software as soon as possible?
38+
39+
{{ range $device := .User.Devices }}
40+
:computer: {{ $device.MachineName }}
41+
{{ range $vuln := $device.Findings }}
42+
`{{ $vuln.ProductName }}`
43+
{{ end }}
44+
{{ end }}
45+
46+
Please update them as soon as possible. In case of any issues, hop into *#security*.
47+
Thank you! :wave:
48+
49+
security_overview_message: |
50+
:information_source: *Device Posture overview* {{ .Date.Format "Jan 02, 2006 15:04:05 UTC" }}
51+
52+
{{ if not .Results }}Nothing to report! :white_check_mark: {{ else }}
53+
{{ range $result := .Results }}
54+
:man-surfing: *{{ $result.Email }}*
55+
{{ range $device := $result.Devices }}
56+
:computer: {{ $device.MachineName}}
57+
{{ range $vuln := $device.Findings }}- {{ $vuln.ProductName }} ({{ $vuln.CveSeverity }}) ({{ $vuln.TimestampFound }}) ({{ $vuln.CveID }}){{ end }}
58+
{{ end }}
59+
{{ end }}
60+
{{ end }}
61+
62+
{{ if .Errors }}
63+
:warning: *Errors:*
64+
{{ range $err := .Errors }}
65+
- {{ $err }}
66+
{{ end }}
67+
{{ end }}
4568
```
4669
4. Run `css -config=your-config.yml`.
4770
5. See it popup in Slack!

0 commit comments

Comments
 (0)