The HTTP plugin is by default shipped with your CrowdSec installation. The following guide shows how to enable it.
Enabling the plugin:
In your profile file (by default
/etc/crowdsec/profiles.yaml) , uncomment the section
# - http_default
Every alert which would pass the profile's filter would be dispatched to
Configuring the plugin:
By default the configuration for HTTP plugin is located at
Configure how to make web requests by providing the
Adding the plugin configuration
By default there would be a http config at
/etc/crowdsec/notifications/http.yaml. Configure how to make web requests by providing the
Example config which posts the alerts serialized into json to localhost server.
# Don't change this
name: http_default # this must match with the registered plugin in the profile
log_level: info # Options include: trace, debug, info, warn, error, off
format: | # This template receives list of models.Alert objects. The request body would contain this.
url: http://localhost # plugin will make requests to this url. Eg value https://www.example.com/
method: POST # eg either of "POST", "GET", "PUT" and other http verbs is valid value.
# Authorization: token 0x64312313
# skip_tls_verification: # either true or false. Default is false
# group_wait: # duration to wait collecting alerts before sending to this plugin, eg "30s"
# group_threshold: # if alerts exceed this, then the plugin will be sent the message. eg "10"
# max_retry: # number of tries to attempt to send message to plugins in case of error.
# timeout: # duration to wait for response from plugin before considering this attempt a failure. eg "10s"
Let's restart crowdsec
sudo systemctl restart crowdsec
You can verify whether the plugin is properly working by triggering scenarios using tools like wapiti, nikto etc.