Skip to content

Commit cb81520

Browse files
authored
Merge branch 'develop' into main
2 parents 6af9031 + 791e7c0 commit cb81520

Some content is hidden

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

44 files changed

+1362
-604
lines changed

documentation/SBOM/readme.md

Lines changed: 81 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,90 @@
11
# creating SBOM
2-
32
we are using cycloneDx
43

54
## standard script
6-
75
wget https://github.com/CycloneDX/cyclonedx-cli/releases/download/v0.27.2/cyclonedx-linux-x64
86
sudo mv cyclonedx-linux-x64 /usr/local/bin/cyclonedx
97
sudo chmod 755 /usr/local/bin/cyclonedx
10-
118
## script for C#
12-
139
dotnet tool install --global CycloneDX
1410
cd fwo-cactus
1511
git pull
1612
dotnet-CycloneDX -j roles/FWO.sln
1713

14+
## list of deb packages
15+
acl
16+
ansible
17+
apache2
18+
apt-transport-https
19+
ca-certificates
20+
curl
21+
docker-ce
22+
docker-ce-cli
23+
containerd.io
24+
dotnet-runtime
25+
dotnet-sdk
26+
fonts-liberation
27+
glibc-langpack-en
28+
gnupg2
29+
ldap-utils
30+
libapache2-mod-wsgi-py3
31+
libasound2
32+
libldap2-dev
33+
libpangoft2
34+
libpq-dev
35+
libpq5
36+
libpython3-dev
37+
libappindicator3-1
38+
libatk-bridge2.0-0
39+
libatk1.0-0
40+
libcups2
41+
libdbus-1-3
42+
libdrm2
43+
libgbm1
44+
libnspr4
45+
libnss3
46+
libssl-dev
47+
libx11-xcb1
48+
libxcomposite1
49+
libxdamage1
50+
libxrandr2
51+
logrotate
52+
openssh-client
53+
openssh-server
54+
openssl
55+
perl
56+
postgresql
57+
postgresql-client
58+
python3-cryptography
59+
python3-docker
60+
python3-pip
61+
python3-psycopg2
62+
python3-openssl
63+
python3-dev
64+
libldap2-dev
65+
python3-pyldap
66+
python3-setuptools
67+
python3-venv
68+
rsync
69+
rsyslog
70+
slapd
71+
xdg-utils
72+
73+
1874
## list of perl packages
1975

2076
libdbi-perl
77+
78+
79+
80+
81+
82+
83+
84+
Expand All
85+
86+
@@ -31,9 +91,13 @@ we are using cycloneDx
87+
2188
libdbd-pg-perl
2289
libdate-calc-perl
2390
psmisc
@@ -31,9 +98,13 @@ we are using cycloneDx
3198
python3-pydantic
3299

33100

34-
## list of python packages
35-
36-
python3-netaddr
37-
python3-jsonpickle
38-
python3-gnupg
39-
python3-pydantic
101+
## list of python packages with venv (importer module)
102+
pydantic>=2.0,<3.0
103+
jsonpickle>=3.0
104+
gnupg>=0.5
105+
pytest>=7.0
106+
graphql-core>=3.0
107+
requests>=2.0
108+
cryptography>=40.0
109+
netaddr>=1.0
110+
urllib3>=2.0

documentation/installer/install-advanced.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,8 @@ Note that the following domains must be reachable through the proxy:
9191
nuget.org
9292
googlechromelabs.github.io
9393
storage.googleapis.com
94-
95-
Only for the initial setup of python venv
96-
9794
pypi.org
98-
pythonhosted.org
95+
pythonhosted.org (and sub-domains)
9996
snapcraft.io
10097
snapcraftcontent.com (and sub-domains)
10198

documentation/revision-history-develop.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,3 +280,7 @@ bugfix release:
280280

281281
# 8.8.6 - 08.07.2025 DEVELOP
282282
- hotfix CP importer new stm_track: "extended log" and "detailed log"
283+
284+
# 8.8.8 - 21.08.2025 DEVELOP
285+
- add read-only db user fwo_ro
286+
- also reducing db listener to localhost

inventory/group_vars/all.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
### general settings
2-
product_version: "8.8.7"
2+
product_version: "8.8.8"
33
ansible_user: "{{ lookup('env', 'USER') }}"
44
ansible_become_method: sudo
55
ansible_python_interpreter: /usr/bin/python3
@@ -68,6 +68,7 @@ fworch_db_port: 5432
6868
fworch_db_name: fworchdb
6969
fworch_dbadmin_name: dbadmin
7070
dbadmin_password_file: "{{ fworch_secrets_dir }}/dbadmin_pwd"
71+
fwo_db_ro_user_password_file: "{{ fworch_secrets_dir }}/fwo_db_ro_pwd"
7172
fworch_db_password_file: "{{ fworch_secrets_dir }}/fworch_db_pwd"
7273

7374
###############################################################
@@ -161,3 +162,20 @@ csharp_test_start_dir: "{{ fworch_home }}/test/csharp/FWO.Test"
161162
# make sure lib role is only run once per host to save time
162163
# set initially to false
163164
lib_role_has_run: false
165+
166+
#### apache settings
167+
168+
apache2_required_modules:
169+
- headers
170+
- rewrite
171+
- proxy
172+
- proxy_http
173+
- ssl
174+
- proxy_wstunnel
175+
176+
apache_security_headers:
177+
- 'Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"'
178+
- 'Header always set X-Frame-Options "SAMEORIGIN"'
179+
- 'Header always set X-Content-Type-Options "nosniff"'
180+
181+
apache_global_settings_file: /etc/apache2/conf-available/security.conf

inventory/group_vars/databaseserver.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,18 @@ postgresql_test_package: pgtap
44
postgresql_c_client_library_header_files: libpq-dev
55
postgresql_dev_package_prefix: postgresql-server-dev
66
database_install_dir: "{{ fworch_home }}/database"
7+
fwo_db_ro_user: fwo_ro
78

89
# table_space variable can be used to create database in another place where there is enough space
910
# table_space: /var/db/fworch_tablespace
1011
# table_space_name: fworch
1112

13+
db_schemata:
14+
- compliance
15+
- modelling
16+
- public
17+
- request
18+
1219
database_users:
1320
- dbbackup
1421
- fworchimporter

roles/api/tasks/api-apache-install-and-setup.yml

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,9 @@
77
- "{{ wsgi_package_name }}"
88
environment: "{{ proxy_env }}"
99

10-
- name: enable apache modules proxy proxy_http ssl
10+
- name: enable apache2 required modules
1111
apache2_module: state=present name={{ item }}
12-
loop:
13-
- rewrite
14-
- proxy
15-
- proxy_http
16-
- ssl
17-
- proxy_wstunnel
12+
loop: "{{ apache2_required_modules }}"
1813

1914
- set_fact: api_server_name="{{ ansible_hostname }}" # this only works for importer = backend
2015

@@ -43,12 +38,7 @@
4338

4439
- name: enable apache modules proxy proxy_http ssl rewrite proxy_wstunnel
4540
apache2_module: state=present name={{ item }}
46-
loop:
47-
- rewrite
48-
- proxy
49-
- proxy_http
50-
- ssl
51-
- proxy_wstunnel
41+
loop: "{{ apache2_required_modules }}"
5242

5343
- name: copy api httpd config file to api target
5444
template:
@@ -57,15 +47,9 @@
5747
owner: root
5848
group: root
5949

60-
6150
- name: enable {{ product_name }} web site
6251
command: "a2ensite {{ product_name }}-api"
6352

64-
# - name: increase apache timeout to {{ apache_timeout }} seconds (while importing we hit the old 15 min limit)
65-
# lineinfile:
66-
# path: /etc/apache2/apache2.conf
67-
# line: "Timeout {{ apache_timeout }}"
68-
6953
- name: add port to apache
7054
lineinfile:
7155
path: "/etc/apache2/ports.conf"

roles/api/tasks/hasura-install.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@
9292
HASURA_GRAPHQL_ENABLE_CONSOLE: "true"
9393
HASURA_GRAPHQL_ENABLE_TELEMETRY: "false"
9494
HASURA_GRAPHQL_ADMIN_SECRET: "{{ api_hasura_admin_secret }}"
95+
HASURA_GRAPHQL_SERVER_HOST: "127.0.0.1"
96+
HASURA_GRAPHQL_SERVER_PORT: "8080"
9597
HASURA_GRAPHQL_LOG_LEVEL: "{{ api_log_level }}"
9698
HASURA_GRAPHQL_ENABLED_LOG_TYPES: '{{ api_HASURA_GRAPHQL_ENABLED_LOG_TYPES }}'
9799
HASURA_GRAPHQL_CONSOLE_ASSETS_DIR: "/srv/console-assets"
@@ -136,6 +138,7 @@
136138
env:
137139
"{{ hasura_env }}"
138140
container_default_behavior: no_defaults
141+
user: "1001:1001" # hasura user and group id
139142
register: docker_return
140143
become: true
141144
become_user: "{{ fworch_user }}"

roles/api/templates/httpd.conf.j2

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,12 @@
2525
SSLCipherSuite RSA:!EXP:!NULL:+HIGH:+MEDIUM:-LOW
2626
SSLCertificateFile /etc/{{ webserver_package_name }}/ssl/server.crt
2727
SSLCertificateKeyFile /etc/{{ webserver_package_name }}/ssl/server.key
28+
29+
# --- Security Headers ---
30+
<IfModule mod_headers.c>
31+
{% for header in apache_security_headers %}
32+
{{ header }}
33+
{% endfor %}
34+
</IfModule>
35+
2836
</VirtualHost>
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
- name: install apache and make all global configs (non-server dependent)
2+
block:
3+
- name: Install apache2
4+
package:
5+
name: "{{ webserver_package_name }}"
6+
state: present
7+
update_cache: yes
8+
9+
- name: Install wsgi module
10+
package:
11+
name: "{{ wsgi_package_name }}"
12+
state: present
13+
update_cache: yes
14+
15+
- name: edit conf file for global security settings - ServerTokens
16+
lineinfile:
17+
path: "{{ apache_global_settings_file }}"
18+
line: ServerTokens Prod
19+
regexp: '^\s*ServerTokens'
20+
create: true
21+
mode: "0644"
22+
23+
- name: edit conf file for global security settings - ServerSignature
24+
lineinfile:
25+
path: "{{ apache_global_settings_file }}"
26+
line: ServerSignature Off
27+
regexp: '^\s*ServerSignature'
28+
create: true
29+
mode: "0644"
30+
31+
- name: edit conf file for global security settings - TraceEnable
32+
lineinfile:
33+
path: "{{ apache_global_settings_file }}"
34+
line: TraceEnable Off
35+
regexp: '^\s*TraceEnable'
36+
create: true
37+
mode: "0644"
38+
39+
- name: enable global security settings
40+
command: "a2enconf security"
41+
42+
- name: restart apache
43+
service:
44+
name: "{{ webserver_package_name }}"
45+
state: restarted
46+
47+
become: true

roles/common/tasks/main.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,15 @@
1818

1919
- set_fact:
2020
already_installed: "{{ already_installed.stat.exists }}"
21+
22+
- set_fact:
23+
wsgi_package_name: "{{ wsgi_package_name }}-py3"
24+
when: |
25+
(ansible_facts['distribution_release']|lower == debian_testing_release_name)
26+
or
27+
(ansible_facts['distribution']|lower == 'debian' and ansible_facts['distribution_major_version']|int is version('10', '>'))
28+
or
29+
(ansible_facts['distribution']|lower == 'ubuntu' and ansible_facts['distribution_major_version']|int is version('20', '>'))
2130
2231
- debug:
2332
msg: "installation_mode={{ installation_mode }}, already_installed={{ already_installed }}"
@@ -83,6 +92,19 @@
8392
ssh_key_file: .ssh/id_rsa
8493
become: true
8594

95+
- name: global apache config
96+
include_tasks: global-apache2-config.yml
97+
# vars:
98+
# apache2_required_modules: "{{ apache2_required_modules | default([]) }}"
99+
# webserver_package_name: "{{ webserver_package_name | default('apache2') }}"
100+
# http_conf_dir: "{{ http_conf_dir | default('/etc/apache2/sites-available') }}"
101+
# product_name: "{{ product_name }}"
102+
# product_version: "{{ product_version }}"
103+
# api_web_port: "{{ api_web_port | default(8080) }}"
104+
# server_admin: "{{ server_admin | default('webmaster@localhost') }}"
105+
# apache_global_settings_file: "{{ apache_global_settings_file | default('/etc/apache2/conf-available/security.conf') }}"
106+
when: "inventory_hostname in groups['frontends'] or inventory_hostname in groups['middlewareserver'] or inventory_hostname in groups['apiserver']"
107+
86108
- name: replace fwo web sites with maintenance site
87109
include_tasks: maintenance-site.yml
88110
when: "installation_mode == 'upgrade' and inventory_hostname in groups['frontends']"
@@ -249,15 +271,6 @@
249271
become: true
250272
when: not stat_result.stat.exists
251273

252-
- set_fact:
253-
wsgi_package_name: "{{ wsgi_package_name }}-py3"
254-
when: |
255-
(ansible_facts['distribution_release']|lower == debian_testing_release_name)
256-
or
257-
(ansible_facts['distribution']|lower == 'debian' and ansible_facts['distribution_major_version']|int is version('10', '>'))
258-
or
259-
(ansible_facts['distribution']|lower == 'ubuntu' and ansible_facts['distribution_major_version']|int is version('20', '>'))
260-
261274
- name: copy iso.conf to target for legacy importer support only
262275
template:
263276
src: iso.conf.j2

0 commit comments

Comments
 (0)