Skip to content

Instantly share code, notes, and snippets.

View francescor93's full-sized avatar

Francesco francescor93

View GitHub Profile
@francescor93
francescor93 / IubendaHelper.php
Created January 12, 2022 22:55
Help server-side check of Iubenda policies consents
<?php
/**
* Iubenda Helper
*
* A PHP class to help check the consents status of Iubenda policies
* when checking needs to be done on the server side.
*
* // Just instantiate the class:
* $helper = new IubendaHelper();
@francescor93
francescor93 / Fail2ban Mosquitto filter
Created September 12, 2020 15:50
Simple fail2ban jail for Mosquitto authentication
Following is a simple fail2ban jail for Mosquitto authentication.
When an authentication attempt fails, Mosquitto writes three lines like these to his log file:
---
<TIMESTAMP>: New connection from <HOST> on port <PORT>.
<TIMESTAMP>: Sending CONNACK to <HOST>
<TIMESTAMP>: Socket error on client <unknown>, disconnecting.
---
This filter looks for these three lines to get the host and allow you to ban it.