scriptbox/crowdsec-notifications/discord.yaml

30 lines
810 B
YAML

type: http
name: discord
log_level: info
format: |
{
"content": null,
"embeds": [
{{range . -}}
{{$alert := . -}}
{{range .Decisions -}}
{
"title": "{{.Scenario}}",
"description": "{{if $alert.Source.Cn -}}:flag_{{ $alert.Source.Cn | lower }}:{{end}}{{if not $alert.Source.Cn -}}:pirate_flag:{{end}} {{$alert.Source.IP}}\nCount : {{ $alert.EventsCount }}\n{{if $alert.Source.AsNumber -}}AS{{ $alert.Source.AsNumber }}: {{ $alert.Source.AsName }}{{else}}AS: N/A{{end}}\nAction: {{.Type}} {{.Duration}} on {{ Hostname }}\nStart: {{ $alert.StartAt }}\nStop: {{ $alert.StopAt }}",
"color": "16711680"
}
{{end -}}
{{end -}}
]
}
url: https://discord.com/api/webhooks/[]/[]
method: POST
headers:
Content-Type: application/json