Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #3

Merged
merged 40 commits into from
Aug 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
f84ed2a
removing some sample/test data
tpurschke Jul 3, 2021
33ebb7f
adjust dev docu
tpurschke Jul 3, 2021
2347be2
adding some audit logging
tpurschke Jul 3, 2021
1a359ac
prevent audit_user pwd setting in upgrade mode
tpurschke Jul 3, 2021
f60e214
typo
tpurschke Jul 3, 2021
002335e
Merge branch 'develop' of https://github.com/CactuseSecurity/firewall…
tpurschke Jul 4, 2021
d24f204
Merge branch 'develop' of https://github.com/CactuseSecurity/firewall…
tpurschke Jul 5, 2021
e88a4a1
Merge branch 'develop' of https://github.com/CactuseSecurity/firewall…
tpurschke Jul 5, 2021
6f9671a
Merge pull request #2 from CactuseSecurity/develop
tpurschke Jul 6, 2021
b357bec
fixing bug with long / int change
tpurschke Jul 6, 2021
40ccc8c
Merge branch 'develop' of https://github.com/CactuseSecurity/firewall…
tpurschke Jul 6, 2021
02cb72b
Merge branch 'develop' of https://github.com/CactuseSecurity/firewall…
tpurschke Jul 9, 2021
4a265e0
Merge pull request #1108 from CactuseSecurity/develop
abarz722 Jul 12, 2021
ddc145b
doc changes
tpurschke Jul 14, 2021
da4bea5
docker proxy cleanup
tpurschke Jul 14, 2021
23adbd1
Merge branch 'develop' of https://github.com/CactuseSecurity/firewall…
tpurschke Jul 14, 2021
778e3c9
Add user with groups and roles + fixes (#1118)
abarz722 Jul 15, 2021
2bf511a
add test-install workflow for develop branch
tpurschke Jul 15, 2021
c97d6fc
api help pages start
tpurschke Jul 15, 2021
20b235c
Merge branch 'develop' of https://github.com/CactuseSecurity/firewall…
tpurschke Jul 15, 2021
23249a8
text review
tpurschke Jul 15, 2021
cb43606
Merge pull request #1119 from tpurschke/develop
abarz722 Jul 15, 2021
ed7dfd1
some changes for fortinet vdom settings
tpurschke Jul 15, 2021
858de02
Merge branch 'CactuseSecurity:develop' into develop
tpurschke Jul 15, 2021
8af4d48
Merge pull request #1120 from tpurschke/develop
abarz722 Jul 16, 2021
8db7018
Develop - weekly merge with main - v5.3.3 (#1121)
tpurschke Jul 16, 2021
106fbf1
Update server-install.md
tpurschke Jul 16, 2021
dfda1d3
Update server-install.md
tpurschke Jul 16, 2021
7f7114c
Update server-install.md
tpurschke Jul 16, 2021
ffb1a16
Update server-install.md
tpurschke Jul 16, 2021
54a1102
some improvements group/role/user handling (#1122)
abarz722 Jul 16, 2021
0a0a7ac
minor fixes, webhook develop (#1126)
tpurschke Jul 20, 2021
f603ca3
rename master --> main
tpurschke Jul 22, 2021
81e1f47
Bump System.IdentityModel.Tokens.Jwt from 6.11.1 to 6.12.0 in /roles …
dependabot[bot] Jul 23, 2021
5ae02d1
Merge pull request #1125 from alf-cactus/develop
alf-cactus Jul 23, 2021
ac9a143
Develop adding get rules API query to help page (#1129)
tpurschke Jul 25, 2021
78b88c3
Merge branch 'main' into develop
tpurschke Jul 25, 2021
7b09d5b
Develop migrating to hasura 2.0 (#1131)
tpurschke Jul 30, 2021
5b4bb81
Develop moving CPR8x import user password to file (#1135)
tpurschke Jul 31, 2021
5144cb6
Db testing first database unit tests (#1139)
tpurschke Aug 5, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ name: Build

on:
push:
branches: [ master ]
branches: [ main,develop ]
paths-ignore:
- 'documentation/**'
- 'design/**'

pull_request:
types: [ ready_for_review review_requested ]
branches: [ master ]
branches: [ main,develop ]
paths-ignore:
- 'documentation/**'
- 'design/**'
Expand Down
1 change: 1 addition & 0 deletions ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
inventory = inventory
#timeout = 60
force_handlers = True
stdout_callback = yaml

[ssh_connection]
pipelining = True
68 changes: 68 additions & 0 deletions documentation/api/hasura-documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Hasura Documentation

## Upgrade tables & permissions

In FWO v5.3.4 we are migrating from hasura v1.x to v2.x.
Therefore upgrades to database tables and permissions now need to be handled as follows:
- apply your changes (e.g. permissions) in the graphql console (https://<ip>:9443/api/) after logging in with hasura admin secret (to be found in ~/etc/secrets/hasura_admin_pwd)
- go to settings menu (cogwheel in top right corner)
- choose export metadata to json file
- copy the metadata {...} part of this file to source roles/api/files/replace_metadata.json (also into metadata {} part)
- run `ansible-playbook site.yml "installation_mode=upgrade" -K`

## Configuration parameters

### HASURA_GRAPHQL_DATABASE_URL
- value: "postgres://{{ api_user }}:{{ api_user_password }}@{{ fworch_db_host }}:{{ fworch_db_port }}/{{ fworch_db_name }}"
- description: the database connection string (currently using a single database for firewall and metadata)

### HASURA_GRAPHQL_ENABLE_CONSOLE
- value: "true"
- description: default is true, set this to false if you want to disable access to hasura console (loosing graphiql access as well)

### HASURA_GRAPHQL_ENABLE_TELEMETRY
- value: "false"
- description: do not send telemtry data to hasura

### HASURA_GRAPHQL_ADMIN_SECRET
- value: "{{ api_hasura_admin_secret }}"
- description: randomly generated admin secret for hasura console access

### HASURA_GRAPHQL_LOG_LEVEL
- value: "{{ api_log_level }}"
- description: default = info

### HASURA_GRAPHQL_ENABLED_LOG_TYPES
- value: '{{ api_HASURA_GRAPHQL_ENABLED_LOG_TYPES }}'
- description: default="startup, http-log, websocket-log"

### HASURA_GRAPHQL_CONSOLE_ASSETS_DIR
- value: "/srv/console-assets"
- description: ?

### HASURA_GRAPHQL_V1_BOOLEAN_NULL_COLLAPSE
- value: "true"
- description: true means make the graphql API v2.x backward compatible with v1.0 (null result in where clause means true). Default settings "false" breaks query functionality. This might have to be migrated later to ensure new standard logic. See <https://hasura.io/docs/latest/graphql/core/guides/upgrade-hasura-v2.html#what-has-changed>.

### HASURA_GRAPHQL_CORS_DOMAIN
- value: "*"
- description: See https://hasura.io/docs/latest/graphql/core/deployment/graphql-engine-flags/config-examples.html. Value "*" means no restrictions. For CORS explanation see <https://en.wikipedia.org/wiki/Cross-origin_resource_sharing>. Can be restricted in customer environment if needed.

### HASURA_GRAPHQL_JWT_SECRET
- value:
```
'{
"type": "{{ api_hasura_jwt_alg|quote }}",
"key": "{{ api_hasura_jwt_secret | regex_replace(''\n'', ''\\n'') }}",
"claims_namespace_path": "$"
}'
```
- description: the JWT secret containing of algorithm, key (public key part) and an optional claims_namespace_path with default value "$", meaning to specific path.

### HTTP_PROXY
- value: "{{ http_proxy }}"
- description: allows outbound connections for the docker container via a proxy.

### HTTPS_PROXY
- value: "{{ https_proxy }}"
- description: allows outbound connections for the docker container via a proxy.
10 changes: 9 additions & 1 deletion documentation/installer/install-for-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,22 @@ Set debug level for extended debugging info during installation.
```console
ansible-playbook/ site.yml -e "debug_level='2'" -K
```
## Running tests after installation
## Running integration tests after installation/upgrade

To only run tests (for an existing installation) use tags as follows:

```console
ansible-playbook/ site.yml --tags test -K
```

## Running unit tests only

To only run tests (for an existing installation, can only be combined with installation_mode=upgrade) use tags as follows:

```console
ansible-playbook/ site.yml --tags unittest -e "installation_mode=upgrade" -K
```

## Parameter "api_no_metadata" to prevent meta data import

e.g. if your hasura metadata file needs to be re-created from scratch, then use the following switch::
Expand Down
46 changes: 8 additions & 38 deletions documentation/installer/server-install.md
Original file line number Diff line number Diff line change
@@ -1,59 +1,38 @@
# Installation instructions server

- use latest debian or ubuntu minimal server with ssh service running (need to install and configure sudo for debian)
- this will install various software components to your system. It is recommended to do so on a dedicated (test) system.
- currently recommended platform is Ubuntu Server 20.04 TLS
- We will install various software components to your system. It is recommended to do so on a dedicated (test) system.

1) prepare your test system (install packages needed for install script and create and autorize ssh key pair to allow ssh login to localhost for ansible connect)
1) prepare your test system (make sure your user has full sudo permissions)

```console
su -
apt-get install git ansible ssh sudo
apt-get install git ansible sudo
```
if not already configured, add your current user to sudo group (make sure to activate this change by starting new shell or even rebooting):

```console
usermod -a -G sudo `whoami`

exit
# from here in standard user context

ssh-keygen -b 4096
cat .ssh/id_rsa.pub >>.ssh/authorized_keys
chmod 600 .ssh/authorized_keys
```

2) test system connectivity necessary for installation

test ssh connectivity to localhost (127.0.0.1) using public key auth (add .ssh/authorized_keys)

```console
ssh 127.0.0.1
```

make sure you can use ansible locally

```console
ansible -m ping 127.0.0.1
```

3) get Firewall Orchestrator with the following command

2) get Firewall Orchestrator with the following command (as normal user)
```console
git clone https://github.com/CactuseSecurity/firewall-orchestrator.git
```

4) if ansible version < 2.8 (older systems like ubuntu 18.04, debian 10), install latest ansible
3) if ansible version < 2.8 (older systems like ubuntu 18.04, debian 10), install latest ansible

cd firewall-orchestrator; ansible-playbook scripts/install-latest-ansible.yml -K

5) install (on localhost)
4) install (on localhost)

```console
cd firewall-orchestrator; ansible-playbook site.yml -K
```
Enter sudo password when prompted "BECOME or SUDO password:"

That's it firewall-orchestrator is ready for usage. You will find the randomly generated login credentials printed out at the very end of the installation:
That's it. Firewall-orchestrator is ready for usage. You will find the randomly generated login credentials printed out at the very end of the installation:
```
...
TASK [display secrets for this installation] ***********************************
Expand All @@ -70,12 +49,3 @@ fworch-srv : ok=302 changed=171 unreachable=0 failed=0 s
Simply navigate to <https://localhost/> and login with user 'admin' and the UI admin password.

The api hasura admin secret can be used to access the API at <https://localhost:9443/>.


6) upgrade

```console
cd firewall-orchestrator
git pull
ansible-playbook site.yml -K -e "installation_mode=upgrade"
```
9 changes: 9 additions & 0 deletions documentation/installer/server-upgrade.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Upgrade instructions

it is really simple:

```console
cd firewall-orchestrator
git pull
ansible-playbook site.yml -K -e "installation_mode=upgrade"
```
3 changes: 3 additions & 0 deletions documentation/revision-history.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,6 @@ adding report template format fk and permissions
### 5.3.3 - 10.07.2021
- add column ldap_name to ldap_connection
- add column ldap_connection_id to uiuser

### 5.3.4 - 29.07.2021
- moving to API hasura v2.0
3 changes: 1 addition & 2 deletions inventory/group_vars/all.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
### general settings
product_version: "5.3.3"
product_version: "5.3.4"
ansible_python_interpreter: /usr/bin/python3
ansible_ssh_common_args: '-o StrictHostKeyChecking=no'
product_name: fworch
Expand Down Expand Up @@ -82,7 +82,6 @@ api_service_name: fworch-hasura-docker-api
api_container_name: "{{ product_name }}-api"
api_ip_address: "127.0.0.1"
api_web_port: 9443
#api_hasura_jwt_alg: "HS384"
api_hasura_jwt_alg: "RS256"
api_hasura_jwt_secret: "fake-jwt-secret-for-github-install"
api_uri: "https://{{ api_ip_address }}:{{ api_web_port }}/api/v1/graphql"
Expand Down
2 changes: 1 addition & 1 deletion inventory/group_vars/apiserver.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ api_hasura_admin_test_password: "not4production"
api_user_email: "{{ api_user }}@{{ api_ip_address }}"
api_home: "{{ fworch_home }}/api"
api_hasura_cli_bin: "/usr/local/bin/hasura"
api_hasura_version: "v1.3.3"
api_hasura_version: "v2.0.3"
api_project_name: api
api_no_metadata: false
# debug > info > warn > error
Expand Down
3 changes: 2 additions & 1 deletion inventory/group_vars/testservers.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
install_webhook: no
webhook_install_mode: reinstall
# webhook_install_mode: upgrade
# webhook_install_mode: upgrade
webhook_branch: develop
Loading