Skip to content

Commit

Permalink
chore: add templates
Browse files Browse the repository at this point in the history
  • Loading branch information
hazcod committed Jul 7, 2021
1 parent c9b1a20 commit b827bae
Showing 1 changed file with 36 additions and 15 deletions.
51 changes: 36 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,42 @@ email:
domain: "mycompany"

# what is sent to the user in Go templating
message: |
*:warning: We found security vulnerabilities on your device(s)*
Hi {{ .Slack.Profile.FirstName }} {{ .Slack.Profile.LastName }}! One or more of your devices seem to be vulnerable.
Luckily we noticed there are patches available. :tada:
Can you please update following software as soon as possible?
{{ range $device := .User.Devices }}
:computer: {{ $device.MachineName }}
{{ range $vuln := $device.Findings }}
`{{ $vuln.ProductName }}`
{{ end }}
{{ end }}
Please update them as soon as possible. In case of any issues, hop into *#security*.
Thank you! :wave:
templates:
user_message: |
*:warning: We found security vulnerabilities on your device(s)*
Hi {{ .Slack.Profile.FirstName }} {{ .Slack.Profile.LastName }}! One or more of your devices seem to be vulnerable.
Luckily we noticed there are patches available. :tada:
Can you please update following software as soon as possible?
{{ range $device := .User.Devices }}
:computer: {{ $device.MachineName }}
{{ range $vuln := $device.Findings }}
`{{ $vuln.ProductName }}`
{{ end }}
{{ end }}
Please update them as soon as possible. In case of any issues, hop into *#security*.
Thank you! :wave:
security_overview_message: |
:information_source: *Device Posture overview* {{ .Date.Format "Jan 02, 2006 15:04:05 UTC" }}
{{ if not .Results }}Nothing to report! :white_check_mark: {{ else }}
{{ range $result := .Results }}
:man-surfing: *{{ $result.Email }}*
{{ range $device := $result.Devices }}
:computer: {{ $device.MachineName}}
{{ range $vuln := $device.Findings }}- {{ $vuln.ProductName }} ({{ $vuln.CveSeverity }}) ({{ $vuln.TimestampFound }}) ({{ $vuln.CveID }}){{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ if .Errors }}
:warning: *Errors:*
{{ range $err := .Errors }}
- {{ $err }}
{{ end }}
{{ end }}
```
4. Run `css -config=your-config.yml`.
5. See it popup in Slack!

0 comments on commit b827bae

Please sign in to comment.