Skip to content

Commit fa9af8c

Browse files
author
Jean-François Hivert
committed
Version 2.0
1 parent a706ff6 commit fa9af8c

71 files changed

Lines changed: 10867 additions & 6025 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 49 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,77 +2,104 @@
22

33
This repository is the addon for PHP-CLI SHELL about FIREWALL (acl) service.
44
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.
66

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.
1018

1119
You have to use base PHP-CLI SHELL project that is here: https://github.com/cloudwatt/php-cli-shell_base
1220

1321

1422
# INSTALLATION
1523

1624
#### APT PHP
25+
Ubuntu only, you can get last PHP version from this PPA:
1726
__*https://launchpad.net/~ondrej/+archive/ubuntu/php*__
1827
* 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__
2134

2235
#### REPOSITORIES
2336
* git clone https://github.com/cloudwatt/php-cli-shell_base
24-
* git checkout tags/v1.1
37+
* git checkout tags/v2.0
2538
* git clone https://github.com/cloudwatt/php-cli-shell_firewall
26-
* git checkout tags/v1.0
39+
* git checkout tags/v2.0
2740
* Merge these two repositories
2841

2942
#### PHPIPAM (Optionnal)
3043
If you have PHPIPAM and you want object name autocompletion, you have to perform these steps:
3144
* git clone https://github.com/cloudwatt/php-cli-shell_phpipam
32-
* git checkout tags/v1.1
45+
* git checkout tags/v2.0
3346
* Merge this repository with two previous repositories (base and firewall)
3447
* Install PHP-CLI SHELL for PHPIPAM with README helper
3548
https://github.com/cloudwatt/php-cli-shell_phpipam/blob/master/README.md
36-
49+
50+
3751
#### 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
4055
* Adapt configuration to your network topology
4156
* Of course you can add more than two sites
4257
* 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*
4558
* Optionnal
4659
* You can create user configuration files for base and firewall services to overwrite some configurations
4760
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
4963
Change configuration like path or file
5064
* 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+
5268

5369
#### PHP LAUNCHER FILE
5470
* mv firewall.php.example firewall.php
5571
* vim firewall.php
5672
* Change [IPAM_SERVER_KEY] with the key of your PHPIPAM server in configuration file
5773
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
5979

60-
#### CREDENTIALS FILE (Only if you install PHPIPAM service)
61-
/!\ For security reason, use a read only account!
80+
81+
#### CREDENTIALS FILE
6282
__*Change informations which are between []*__
6383
* vim credentialsFile
6484
* 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]
6693
* 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__
6895

6996

7097
# EXECUTION
7198

7299
#### SHELL
73100
Launch PHP-CLI Shell for FIREWALL service
74101
* source credentialsFile
75-
* php firewall.php
102+
* php firewall.[env].php
76103

77104
#### CLI
78105
Call commands directly from your OS shell.

configurations/.gitignore renamed to applications/firewall/configurations/.gitignore

File renamed without changes.

0 commit comments

Comments
 (0)