A wrapper over the Cloudflare WAF.
Stop threats at the network edge, not at your application.
$zone = The Cloudflare Zone ID
$account_id = The Cloudflare Account ID;
$email = The email address associated with the cloudflare account;
$api_key = The cloudflare API key (must have permissions with write Zone Rulesets and Rules);
$waf = new \Turbo124\Waf\Waf($api_key, $email, $zone, $account_id);
$waf->unbanIp('103.15.248.112');
$waf->unbanIp('103.15.248.112');
$waf->banAsn('10343');
$waf->unbanAsn('10343');
$waf->banCountry('DE');
$waf->unbanCountry('DE');
$waf->challengeIp('103.15.248.112');
$waf->unchallengeIp('103.15.248.112');
Cloudflare providers some nifty intelligence metrics on certain domains and IP addresses and can provide risk ratings
$waf->meta->getDomainInfo('example.com');
[
"domain" => "puabook.com",
"ip" => "51.254.35.55",
"risk_type_string" => "Parked & For Sale Domains,Security Risks",
"risk_type" => [
[
"id" => 128,
"super_category_id" => 32,
"name" => "Parked & For Sale Domains",
],
[
"id" => 32,
"name" => "Security Risks",
],
],
"content_catgories" => [],
"content_category_string" => "",
]
$waf->meta->getIpInfo('210.140.43.55');
[
"ip" => "210.140.43.55",
"asn" => 4694,
"country" => "JP",
"risk_types" => [],
]