NAME

CrowdSec::Client - CrowdSec client

SYNOPSIS

use CrowdSec::Client;
my $client = CrowdSec::Client->new({
  machineId => "myid",
  password  => "mypass",
  baseUrl   => "http://127.0.0.1:8080",
  autoLogin => 1;
});
$client->banIp({
  ip       => '1.2.3.4',
  duration => '5h',            # default 4h
  reason   => 'Ban by my app', # default: 'Banned by CrowdSec::Client'
}) or die( $client->error );

DESCRIPTION

CrowdSec::Client is a simple CrowdSec Watcher. It permits to ban an IP.

Constructor

CrowdSec::Client requires a hashref as argument with the following keys:

Methods

banIp()

banIp adds the given IP into decisions. Usage:

$client->banIp( { %parameters } );

Parameters:

Enrollment

SEE ALSO

CrowdSec

AUTHOR

Xavier Guimard xguimard@linagora.mu

COPYRIGHT AND LICENSE

Copyright (C) 2023 by Linagora

License: AGPL-3.0 (see LICENSE file)