Due to the termination of support for docker containers nwaf-web
/nwaf-web-pg
, it is necessary to migrate components to new containers Nemesida WAF API and Nemesida WAF Cabinet.
To do this, follow these steps:
1. Deploy the PostgreSQL DBMS on a different server and create the waf
and cabinet
databases, as well as users to connect to them (required if the nwaf-web
container was previously used):
For waf
DB:
# su - postgres -c "psql -c \"CREATE DATABASE waf;\"" # su - postgres -c "psql -c \"CREATE ROLE nw_api PASSWORD 'YOUR_PASSWORD';\"" # su - postgres -c "psql -c \"GRANT ALL ON DATABASE waf TO nw_api;\"" # su - postgres -c "psql -c \"ALTER ROLE nw_api WITH LOGIN;\"" # su - postgres -c "psql waf -c \"GRANT ALL ON ALL TABLES IN SCHEMA public TO nw_api;\"" # su - postgres -c "psql waf -c \"GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO nw_api;\"" # su - postgres -c "psql waf -c \"GRANT CREATE ON SCHEMA public TO nw_api;\""
For cabinet
DB:
# su - postgres -c "psql -c \"CREATE DATABASE cabinet;\"" # su - postgres -c "psql -c \"CREATE ROLE nw_cabinet PASSWORD 'YOUR_PASSWORD';\"" # su - postgres -c "psql -c \"GRANT ALL ON DATABASE cabinet TO nw_cabinet;\"" # su - postgres -c "psql -c \"ALTER ROLE nw_cabinet WITH LOGIN;\"" # su - postgres -c "psql cabinet -c \"GRANT ALL ON ALL TABLES IN SCHEMA public TO nw_cabinet;\"" # su - postgres -c "psql cabinet -c \"GRANT ALL ON ALL SEQUENCES IN SCHEMA public TO nw_cabinet;\"" # su - postgres -c "psql cabinet -c \"GRANT CREATE ON SCHEMA public TO nw_cabinet;\""
2. Create a dump of the corresponding databases using the commands (required if the nwaf-web
container was previously used):
# pg_dump -h <HOST> -p <PORT> -U nw_api -d waf | bzip2 -9 > /tmp/waf.sql.bz2 # pg_dump -h <HOST> -p <PORT> -U nw_cabinet -d cabinet | bzip2 -9 > /tmp/cabinet.sql.bz2
3. Stop the container nwaf-web
/nwaf-web-pg
:
# docker stop /container ID/
View the container ID using the command (CONTAINER ID column):
# docker ps -a
4. Unzip and export previously created database dumps in the new PostgreSQL database management system (required if the nwaf-web
container was previously used):
# su postgres $ cat /tmp/waf.sql.bz2 | bunzip2 | psql waf $ cat /tmp/cabinet.sql.bz2 | bunzip2 | psql cabinet
5. deploy the containers Nemesida WAF API and Nemesida WAF Cabinet and make their settings;
6. Make changes (if necessary) to the container configuration files according to the instructions from the manual Nemesida WAF, Nemesida AI MLC and Nemesida WAF Scanner for the interaction of components with the Nemesida WAF API and Nemesida WAF Cabinet:
- The URL for accessing the Nemesida WAF API;
- Details of connecting to the
waf
andcabinet
database.