ansible-role-crowdsec/templates/email.yaml.j2

38 lines
1.6 KiB
Django/Jinja

type: email # Don't change
name: email_default # Must match the registered plugin in the profile
# One of "trace", "debug", "info", "warn", "error", "off"
log_level: info
# group_wait: # Time to wait collecting alerts before relaying a message to this plugin, eg "30s"
# group_threshold: # Amount of alerts that triggers a message before <group_wait> has expired, eg "10"
# max_retry: # Number of attempts to relay messages to plugins in case of error
timeout: 20s # Time to wait for response from the plugin before considering the attempt a failure, eg "10s"
#-------------------------
# plugin-specific options
# The following template receives a list of models.Alert objects
# The output goes in the email message body
format: | {{ "
{{range . -}}
{{$alert := . -}}
{{range .Decisions -}}
<html><body><p><a href=https://www.whois.com/whois/{{.Value}}>{{.Value}}</a> will get <b>{{.Type}}</b> for next <b>{{.Duration}}</b> for triggering <b>{{.Scenario}}</b> on machine <b>{{$alert.MachineID}}</b>.</p> <p><a href=https://www.shodan.io/host/{{.Value}}>Shodan</a></p></body></html>
{{end -}}
{{end -}}" }}
smtp_host: "{{ email.host }}"
smtp_username: "{{ email.username }}"
smtp_password: "{{ email.password }}"
smtp_port: {{ email.port }}
auth_type: "{{ email.auth }}" # Valid choices are "none", "crammd5", "login", "plain"
sender_name: "CrowdSec"
sender_email: "{{ email.from }}"
email_subject: "CrowdSec Notification"
receiver_emails: {{ cs_receiver_emails | to_json() }}
# - email1@gmail.com
# - email2@gmail.com
encryption_type: "{{ email.starttls }}" # One of "ssltls", "none"