-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
34 lines (25 loc) · 748 Bytes
/
index.php
File metadata and controls
34 lines (25 loc) · 748 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<html>
<head>
<title>AWS Cloudflare Security Group Test</title>
</head>
<body>
Test Functions - uncomment to test<br>
<?php
include("aws-cloudflare.class.php");
/*Config options can also be set in separate config file*/
$config = array(
'access_key_id' => 'YOUR_ACCESS_KEY',
'secret_access_key' => 'YOUR_SECRET_KEY',
'region' => 'ap-southeast-1',
'security_group' => 'sg-123456789'
);
$awsCf = new AwsCf($config);;
$ip_arr = array(array("CidrIp"=>"1.2.3.4/24"));
//$res = $awsCf->open_port($ip_arr, "1234", "tcp");
//$res = $awsCf->close_port($ip_arr, "1234", "tcp");
//$awsCf->close_all_by_port("1234");
$res = $awsCf->cloudflare_firewall("12345");
if($res === true){echo("Success");}else{echo("Failure - ".$res);}
?>
</body>
</html>