1- # PHP-CLI SHELL for FIREWALL
1+ PHP-CLI SHELL for FIREWALL
2+ -------------------
23
34This repository is the addon for PHP-CLI SHELL about FIREWALL (acl) service.
45With this addon you can create ACLs (monosite, failover and fullmesh) and generate template for your firewall appliance.
56It is possible to upload ACLs config file to firewall with SCP. For SCP, you can use an SSH bastion.
67
8+ ![ demo] ( documentation/readme/demo.gif )
9+
710For the moment, there are 3 templates:
811* Juniper JunOS
912 __ there are 2 templates for Juniper JunOS: one formated with {} and one with set commands__
@@ -21,7 +24,8 @@ ACL failover:
2124You have to use base PHP-CLI SHELL project that is here: https://github.com/cloudwatt/php-cli-shell_base
2225
2326
24- # INSTALLATION
27+ INSTALLATION
28+ -------------------
2529
2630#### APT PHP
2731Ubuntu only, you can get last PHP version from this PPA:
@@ -40,35 +44,58 @@ pcre.jit=0
4044```
4145* To locate your php.ini, use this command: php -i | grep "Configuration File"*
4246
47+
48+ ## USE PHAR
49+
50+ #### WIZARD
51+
52+ Download last PHAR release and its key from [ releases] ( https://github.com/cloudwatt/php-cli-shell_firewall/releases )
53+
54+ ![ wizard] ( documentation/readme/wizard.gif )
55+
56+ Wizard help:
57+ ` $ php php-cli-shell.phar --help `
58+
59+ Create firewall configuration with command:
60+ ` $ php php-cli-shell.phar configuration:application:factory firewall `
61+ * For more informations about configuration file, see 'CONFIGURATION FILE' section*
62+
63+ Create firewall launcher with command:
64+ ` $ php php-cli-shell.phar launcher:application:factory firewall `
65+
66+ __ * The PHAR contains all PHP-CLI SHELL components (Base, DCIM, IPAM and Firewall)* __
67+
68+
69+ ## USE SOURCE
70+
4371#### REPOSITORIES
4472* git clone https://github.com/cloudwatt/php-cli-shell_base
45- * git checkout tags/v2.1.1
73+ * git checkout tags/v2.1.2
4674* git clone https://github.com/cloudwatt/php-cli-shell_firewall
47- * git checkout tags/v2.1.1
75+ * git checkout tags/v2.1.2
4876* Merge these two repositories
4977
5078#### PHPIPAM (Optionnal)
5179If you have PHPIPAM and you want object name autocompletion, you have to perform these steps:
5280* git clone https://github.com/cloudwatt/php-cli-shell_phpipam
53- * git checkout tags/v2.1.1
81+ * git checkout tags/v2.1.2
5482* Merge this repository with two previous repositories (base and firewall)
55- * Install PHP-CLI SHELL for PHPIPAM with README helper
56- https://github.com/cloudwatt/php-cli-shell_phpipam
83+ * Install PHP-CLI SHELL for PHPIPAM with [ README] ( https://github.com/cloudwatt/php-cli-shell_phpipam ) helper
5784
5885#### CONFIGURATION FILE
5986__ [ env] is not used by PHP-CLI, it is for user when he has many environments or sites to managed__
60- * mv applications/firewall/ configurations/firewall.envA.json.example configurations/firewall.[ env] .json
87+ * mv configurations/firewall.envA.json.example configurations/firewall.[ env] .json
6188* vim configurations/firewall.[ env] .json
6289 * Adapt configuration to your network topology
6390 * Of course you can add more than two sites
6491 * Do not change topology attribute names: internet, onPremise, interSite, private
6592* Optionnal
6693 * You can create user configuration files for base and firewall services to overwrite some configurations
6794 These files will be ignored for commits, so your user config files can not be overwrited by a futur release
68- * mv applications/firewall/ configurations/firewall.envA.user.json.example configurations/firewall.[env].user.json
95+ * mv configurations/firewall.envA.user.json.example configurations/firewall.[env].user.json
6996 * vim configurations/firewall.[env].user.json
7097 Change configuration like path or file
71- * All *.user.json files are ignored by .gitignore
98+ * All \ *.user.json files are ignored by .gitignore
7299* Juniper JunOS
73100 * In firewall.json, you can change the configuration push method:
74101 ```json
@@ -98,36 +125,26 @@ __[env] is not used by PHP-CLI, it is for user when he has many environments or
98125* vim firewall.[ env] .php
99126 * Change [ env] with the name of your environment
100127
128+
129+ EXECUTION
130+ -------------------
131+
101132#### CREDENTIALS FILE
102133__ * Change informations which are between [ ] * __
103134* vim credentialsFile
104135 * read -sr USER_PASSWORD_INPUT
105- * export SSH_SYS_LOGIN=[YourSystemLoginHere]
106- * export SSH_NET_LOGIN=[YourNetworkLoginHere]
107- * export SSH_NET_PASSWORD=$USER_PASSWORD_INPUT
108- __Bastion authentication must be base on certificate__
109-
110- __PHPIPAM__ (Only if you use PHPIPAM service/addon)
111- /!\ For security reason, use a read only account!
112- * export IPAM_[IPAM_SERVER_KEY]_LOGIN=[YourLoginHere]
136+ * export SSH_SYS_LOGIN=[ YourSystemLoginHere]
137+ * export SSH_NET_LOGIN=[ YourNetworkLoginHere]
138+ * export SSH_NET_PASSWORD=$USER_PASSWORD_INPUT
139+ __ Bastion authentication must be base on certificate__
140+
141+ __PHPIPAM__ (Only if you use PHPIPAM service/addon)
142+ /!\ For security reason, use a read only account!
143+ * export IPAM_[IPAM_SERVER_KEY]_LOGIN=[YourLoginHere]
113144 * export IPAM_ [ IPAM_SERVER_KEY] _ PASSWORD=$USER_PASSWORD_INPUT
114- __Change [IPAM_SERVER_KEY] with the key of your PHPIPAM server in configuration file__
115-
116-
117- # EXECUTION
145+ __ Change [ IPAM_SERVER_KEY] with the key of your PHPIPAM server in configuration file__
118146
119147#### SHELL
120148Launch PHP-CLI Shell for FIREWALL service
121149* source credentialsFile
122150* php firewall.[ env] .php
123-
124- #### CLI
125- Call commands directly from your OS shell.
126- __ * Informations between [ ] are optionnal* __
127- * source credentialsFile
128- * php firewall.php --site name|all --create_host "name;IPv4[ ;IPv6] " --create_subnet "name;IPv4/mask[ ;IPv6/mask] " --create_network "name;IPv4-IPv4[ ;IPv6-IPv6] "
129- --create_rule monosite|failover [ --fullmesh] --action permit|deny
130- --source_host name --source_subnet name --source_network name
131- --destination_host name --destination_subnet name --destination_network name
132- --protocol protocol;number[ -number] --description maDescription
133- --save [ name;[ force]] --export_configuration "junos[ ;force] "
0 commit comments