|
2 | 2 |
|
3 | 3 | This repository is the addon for PHP-CLI SHELL about FIREWALL (acl) service. |
4 | 4 | With this addon you can create ACLs (monosite, failover and fullmesh) and generate template for your firewall appliance. |
5 | | -For the moment, only JunOS templates are availables. There are 2 templates for JunOS: one formated with {} and one with set commands. |
| 5 | +It is possible to upload ACLs config file to firewall with SCP. For SCP, you can use an SSH bastion. |
6 | 6 |
|
7 | | -ACL monosite: basic ACL, source(s), destination(s), no automation. For this ACL category you can not enable fullmesh option! |
8 | | -ACL failover: failover ACL(s) will be automaticaly generated for all failover sites in inbound or outbound. |
9 | | -ACL failover with fullmesh option: source and destination of ACL will be isolated to process automation. |
| 7 | +For the moment, there are 2 templates: |
| 8 | +* Juniper JunOS |
| 9 | + __there are 2 templates for JunOS: one formated with {} and one with set commands__ |
| 10 | +* Cisco ASA |
| 11 | + |
| 12 | +ACL monosite: |
| 13 | +* basic ACL, source(s), destination(s), no automation. For this ACL category you can not enable fullmesh option! |
| 14 | + |
| 15 | +ACL failover: |
| 16 | +* __without fullmesh option:__ failover ACL(s) will be automaticaly generated for all failover sites in inbound or outbound. |
| 17 | +* __with fullmesh option:__ like without but source and destination of ACL will be isolated per zone to process automation. |
10 | 18 |
|
11 | 19 | You have to use base PHP-CLI SHELL project that is here: https://github.com/cloudwatt/php-cli-shell_base |
12 | 20 |
|
13 | 21 |
|
14 | 22 | # INSTALLATION |
15 | 23 |
|
16 | 24 | #### APT PHP |
| 25 | +Ubuntu only, you can get last PHP version from this PPA: |
17 | 26 | __*https://launchpad.net/~ondrej/+archive/ubuntu/php*__ |
18 | 27 | * add-apt-repository ppa:ondrej/php |
19 | | -* apt-get update |
20 | | -* apt install php7.1-cli php7.1-mbstring php7.1-readline |
| 28 | +* apt update |
| 29 | + |
| 30 | +You have to install a PHP version >= 7.1: |
| 31 | +* apt update |
| 32 | +* apt install php7.2-cli php7.2-mbstring php7.2-readline php7.2-curl |
| 33 | +__Do not forget to install php7.2-curl if you use PHPIPAM__ |
21 | 34 |
|
22 | 35 | #### REPOSITORIES |
23 | 36 | * git clone https://github.com/cloudwatt/php-cli-shell_base |
24 | | -* git checkout tags/v1.1 |
| 37 | +* git checkout tags/v2.0 |
25 | 38 | * git clone https://github.com/cloudwatt/php-cli-shell_firewall |
26 | | -* git checkout tags/v1.0 |
| 39 | +* git checkout tags/v2.0 |
27 | 40 | * Merge these two repositories |
28 | 41 |
|
29 | 42 | #### PHPIPAM (Optionnal) |
30 | 43 | If you have PHPIPAM and you want object name autocompletion, you have to perform these steps: |
31 | 44 | * git clone https://github.com/cloudwatt/php-cli-shell_phpipam |
32 | | -* git checkout tags/v1.1 |
| 45 | +* git checkout tags/v2.0 |
33 | 46 | * Merge this repository with two previous repositories (base and firewall) |
34 | 47 | * Install PHP-CLI SHELL for PHPIPAM with README helper |
35 | 48 | https://github.com/cloudwatt/php-cli-shell_phpipam/blob/master/README.md |
36 | | - |
| 49 | + |
| 50 | + |
37 | 51 | #### CONFIGURATION FILE |
38 | | -* mv configurations/firewall.json.example configurations/firewall.json |
39 | | -* vim configurations/firewall.json |
| 52 | +__[env] is not used by PHP-CLI, it is for user when he has many environments or sites to managed__ |
| 53 | +* mv applications/firewall/configurations/firewall.envA.json.example configurations/firewall.[env].json |
| 54 | +* vim configurations/firewall.[env].json |
40 | 55 | * Adapt configuration to your network topology |
41 | 56 | * Of course you can add more than two sites |
42 | 57 | * Do not change topology attribute names: internet, onPremise, interSite, private |
43 | | - * /!\ Zone name between site (MPLS-ADM, MPLS-USR) must be the same on all sites |
44 | | - *This is will change in next release to add more flexibility* |
45 | 58 | * Optionnal |
46 | 59 | * You can create user configuration files for base and firewall services to overwrite some configurations |
47 | 60 | These files will be ignored for commits, so your user config files can not be overwrited by a futur release |
48 | | - * vim configurations/firewall.user.json |
| 61 | + * mv applications/firewall/configurations/firewall.envA.user.json.example configurations/firewall.[env].user.json |
| 62 | + * vim configurations/firewall.[env].user.json |
49 | 63 | Change configuration like path or file |
50 | 64 | * All *.user.json files are ignored by .gitignore |
51 | | - |
| 65 | +* Cisco-ASA |
| 66 | + * Add this configuration in options section under sites to declare a global zone: "globalZone": "global" |
| 67 | + |
52 | 68 |
|
53 | 69 | #### PHP LAUNCHER FILE |
54 | 70 | * mv firewall.php.example firewall.php |
55 | 71 | * vim firewall.php |
56 | 72 | * Change [IPAM_SERVER_KEY] with the key of your PHPIPAM server in configuration file |
57 | 73 | You can add many PHPIPAM server, it is compatible multiple PHPIPAM |
58 | | - If you have not PHPIPAM service, remove argument or keep it empty |
| 74 | + If you have not PHPIPAM service, remove argument or keep it empty |
| 75 | +__[env] is not used by PHP-CLI, it is for user when he has many environments or sites to managed__ |
| 76 | +* mv firewall.envA.php.example firewall.[env].php |
| 77 | +* vim firewall.[env].php |
| 78 | + * Change [env] with the name of your environment |
59 | 79 |
|
60 | | -#### CREDENTIALS FILE (Only if you install PHPIPAM service) |
61 | | -/!\ For security reason, use a read only account! |
| 80 | + |
| 81 | +#### CREDENTIALS FILE |
62 | 82 | __*Change informations which are between []*__ |
63 | 83 | * vim credentialsFile |
64 | 84 | * read -sr USER_PASSWORD_INPUT |
65 | | - * export IPAM_[IPAM_SERVER_KEY]_LOGIN=[YourLoginHere] |
| 85 | + * export SSH_SYS_LOGIN=[YourSystemLoginHere] |
| 86 | + * export SSH_NET_LOGIN=[YourNetworkLoginHere] |
| 87 | + * export SSH_NET_PASSWORD=$USER_PASSWORD_INPUT |
| 88 | + __Bastion authentication must be base on certificate__ |
| 89 | + |
| 90 | + __PHPIPAM__ (Only if you use PHPIPAM service/addon) |
| 91 | + /!\ For security reason, use a read only account! |
| 92 | + * export IPAM_[IPAM_SERVER_KEY]_LOGIN=[YourLoginHere] |
66 | 93 | * export IPAM_[IPAM_SERVER_KEY]_PASSWORD=$USER_PASSWORD_INPUT |
67 | | - __Change [IPAM_SERVER_KEY] with the key of your PHPIPAM server in configuration file__ |
| 94 | + __Change [IPAM_SERVER_KEY] with the key of your PHPIPAM server in configuration file__ |
68 | 95 |
|
69 | 96 |
|
70 | 97 | # EXECUTION |
71 | 98 |
|
72 | 99 | #### SHELL |
73 | 100 | Launch PHP-CLI Shell for FIREWALL service |
74 | 101 | * source credentialsFile |
75 | | -* php firewall.php |
| 102 | +* php firewall.[env].php |
76 | 103 |
|
77 | 104 | #### CLI |
78 | 105 | Call commands directly from your OS shell. |
|
0 commit comments