webhook templates
This commit is contained in:
60
app/web/templates/webhook_presets/slack.j2
Normal file
60
app/web/templates/webhook_presets/slack.j2
Normal file
@@ -0,0 +1,60 @@
|
||||
{
|
||||
"text": "{{ alert.severity|upper }}: {{ alert.message }}",
|
||||
"blocks": [
|
||||
{
|
||||
"type": "header",
|
||||
"text": {
|
||||
"type": "plain_text",
|
||||
"text": "🚨 {{ alert.severity|upper }} Alert: {{ alert.type|title|replace('_', ' ') }}"
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "section",
|
||||
"fields": [
|
||||
{
|
||||
"type": "mrkdwn",
|
||||
"text": "*Alert:*\n{{ alert.message }}"
|
||||
},
|
||||
{
|
||||
"type": "mrkdwn",
|
||||
"text": "*Severity:*\n{{ alert.severity|upper }}"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "section",
|
||||
"fields": [
|
||||
{
|
||||
"type": "mrkdwn",
|
||||
"text": "*Scan:*\n{{ scan.title }}"
|
||||
},
|
||||
{
|
||||
"type": "mrkdwn",
|
||||
"text": "*Rule:*\n{{ rule.name }}"
|
||||
}
|
||||
]
|
||||
}{% if alert.ip_address or alert.port %},
|
||||
{
|
||||
"type": "section",
|
||||
"fields": [{% if alert.ip_address %}
|
||||
{
|
||||
"type": "mrkdwn",
|
||||
"text": "*IP Address:*\n{{ alert.ip_address }}"
|
||||
}{% if alert.port %},{% endif %}{% endif %}{% if alert.port %}
|
||||
{
|
||||
"type": "mrkdwn",
|
||||
"text": "*Port:*\n{{ alert.port }}"
|
||||
}{% endif %}
|
||||
]
|
||||
}{% endif %},
|
||||
{
|
||||
"type": "context",
|
||||
"elements": [
|
||||
{
|
||||
"type": "mrkdwn",
|
||||
"text": "Scan ID: {{ scan.id }} | Alert ID: {{ alert.id }} | {{ timestamp.strftime('%Y-%m-%d %H:%M:%S UTC') }}"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user