Skip to content

Commit b827bae

Browse files
committed
chore: add templates
1 parent c9b1a20 commit b827bae

File tree

1 file changed

+36
-15
lines changed

1 file changed

+36
-15
lines changed

README.md

Lines changed: 36 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,21 +29,42 @@ email:
2929
domain: "mycompany"
3030

3131
# what is sent to the user in Go templating
32-
message: |
33-
*:warning: We found security vulnerabilities on your device(s)*
34-
Hi {{ .Slack.Profile.FirstName }} {{ .Slack.Profile.LastName }}! One or more of your devices seem to be vulnerable.
35-
Luckily we noticed there are patches available. :tada:
36-
Can you please update following software as soon as possible?
37-
38-
{{ range $device := .User.Devices }}
39-
:computer: {{ $device.MachineName }}
40-
{{ range $vuln := $device.Findings }}
41-
`{{ $vuln.ProductName }}`
42-
{{ end }}
43-
{{ end }}
44-
45-
Please update them as soon as possible. In case of any issues, hop into *#security*.
46-
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 }}
4768
```
4869
4. Run `css -config=your-config.yml`.
4970
5. See it popup in Slack!

0 commit comments

Comments
 (0)