Nemesida WAF, Nemesida WAF API, Nemesida WAF Cabinet and Nemesida WAF Signtest docker container deployment guide.

If you previously used an image that was not downloaded from the Docker repository, it is recommended to delete it.

Removing an image not downloaded from the Docker repository
1. If the container is running, stop it using the command:

# docker stop /container ID/

You can view the container ID using the command (CONTAINER ID column):

# docker ps -a

2. With the container stopped, delete the image:

Nemesida WAFNemesida WAF FreeNemesida WAF API+CabinetNemesida WAF Signtest
# docker image rm nwaf-dyn/1.18
# docker image rm nwaf-dyn-free/1.18
# docker image rm nwaf-api-cabinet
# docker image rm nwaf-st

Deploying a Nemesida WAF Docker container

To deploy the Nemesida WAF Container one has to do the following:

Nemesida WAFNemesida WAF Free

1. Load an image containing the dynamic module Nemesida WAF and Nemesida AI:

# docker pull nemesida/nwaf-dyn-1.18

2. Create a directory for Nemesida WAF configuration files:

# mkdir /opt/nwaf/waf-config

3. Create file first-launch in the configuration files directory:

# touch /opt/nwaf/waf-config/first-launch

4. Run the container with Nemesida WAF image using the command:

# iptables -t filter -N DOCKER
# docker run --rm -d -v /opt/nwaf/waf-config:/nginx.configs -p 80:80 nemesida/nwaf-dyn-1.18

The container will terminate by creating a basic set of configuration files in the configuration files directory.

5. Edit the configuration files according to the instructions on page Nemesida WAF and Nemesida AI.

6. Run the container with Nemesida WAF image using the command:

# iptables -t filter -N DOCKER
# docker run --rm -d -v /opt/nwaf/waf-config:/nginx.configs -p 80:80 nemesida/nwaf-dyn-1.18

where:

  • --rm – container removal after closedown;
  • -d – container running in background mode;
  • -v /opt/nwaf/waf-config:/nginx.configs – mounting the directory with configuration files inside the container.

1. Load an image containing the dynamic module Nemesida WAF:

# docker pull nemesida/nwaf-dyn-free-1.18

2. Create a directory for Nemesida WAF configuration files:

# mkdir /opt/nwaf/waf-config

3. Create file first-launch in the configuration files directory:

# touch /opt/nwaf/waf-config/first-launch

4. Run the container with Nemesida WAF image using the command:

# iptables -t filter -N DOCKER
# docker run --rm -d -v /opt/nwaf/waf-config:/nginx.configs -p 80:80 nemesida/nwaf-dyn-free-1.18

The container will terminate by creating a basic set of configuration files in the configuration files directory.

5. Edit the configuration files according to the instructions on page Nemesida WAF.

6. Run the container with Nemesida WAF image using the command:

# iptables -t filter -N DOCKER
# docker run --rm -d -v /opt/nwaf/waf-config:/nginx.configs -p 80:80 nemesida/nwaf-dyn-free-1.18

where:

  • --rm – container removal after closedown;
  • -d – container running in background mode;
  • -v /opt/nwaf/waf-config:/nginx.configs – mounting the directory with configuration files inside the container.

Nemesida WAF image update
Nemesida WAFNemesida WAF Free

1. Before updating Nemesida WAF image, verify if the container is running. To do this, view the container ID (CONTAINER ID column) using the command:

# docker ps -a

2. If the container is running, stop it using the command:

# docker stop /container ID/

3. With the container stopped, delete the image:

# docker image rm nemesida/nwaf-dyn-1.18

4. Load an image containing the dynamic module Nemesida WAF and Nemesida AI:

# docker pull nemesida/nwaf-dyn-1.18

5. Run the container with Nemesida WAF image using the command:

# iptables -t filter -N DOCKER
# docker run --rm -d -v /opt/nwaf/waf-config:/nginx.configs -p 80:80 nemesida/nwaf-dyn-1.18

After the update, previous versions of the configuration files will be placed in old subdirectory.

1. Before updating Nemesida WAF image, verify if the container is running. To do this, view the container ID (CONTAINER ID column) using the command:

# docker ps -a

2. If the container is running, stop it using the command:

# docker stop /container ID/

3. With the container stopped, delete the image:

# docker image rm nemesida/nwaf-dyn-free-1.18

4. Load an image containing the dynamic module Nemesida WAF:

# docker pull nemesida/nwaf-dyn-free-1.18

5. Run the container with Nemesida WAF image using the command:

# iptables -t filter -N DOCKER
# docker run --rm -d -v /opt/nwaf/waf-config:/nginx.configs -p 80:80 nemesida/nwaf-dyn-free-1.18

After the update, previous versions of the configuration files will be placed in old subdirectory.

Nemesida WAF API and Nemesida WAF Cabinet Docker container deployment
To deploy Nemesida WAF API and Nemesida WAF Cabinet Docker container one has to do the following:

1. Load the image containing the Nemesida WAF API modules and the Nemesida WAF Cabinet:

# docker pull nemesida/nwaf-api-cabinet

2. Create two directories:

  • For configuration files (for example, api-cab-config):
    # mkdir /opt/nwaf/api-cab-config
  • For database (for example, api-cab-base):
    # mkdir /opt/nwaf/api-cab-base

3. Create file first-launch in the configuration files directory:

# touch /opt/nwaf/api-cab-config/first-launch

4. Run the container with Nemesida WAF API image + Nemesida WAF Cabinet, using commands:

# iptables -t filter -N DOCKER
# docker run --rm -d -v /opt/nwaf/api-cab-config:/nwaf-api -v /opt/nwaf/api-cab-base:/var/lib/postgresql -p 8080:8080 -p 8090:80 nemesida/nwaf-api-cabinet

where:

  • --rm – container removal after closedown;
  • -d – container running in background mode;
  • -v /opt/nwaf/api-cab-config:/nwaf-api – mounting the directory with configuration files inside the container;
  • -v /opt/nwaf/api-cab-base:/var/lib/postgresql – mounting the directory with database inside the container;
  • -p 8080:8080 – container port 8080 forwarding to the external port 8080;
  • -p 8090:80 – container port 80 forwarding to the external port 8090.

One can view the container ID using the command (CONTAINER ID column):

# docker ps -a

5. Allow access to reading for all for the directory api-cab-config:

# chmod -R 0555 /opt/nwaf/api-cab-config

6. Run the migration and account creation command and follow the script instructions:

# docker exec -ti /container ID/ bash -with "bash /opt/migrate.sh"

One can stop the container using the command:

# docker stop /container ID/

7. Make changes to the configuration files according to the instructions on the documentation pages Nemesida WAF API and Nemesida WAF Cabinet.

8. To run the container, fulfill the following commands:

# iptables -t filter -N DOCKER
# docker run --rm -d -v /opt/nwaf/api-cab-config:/nwaf-api -v /opt/nwaf/api-cab-base:/var/lib/postgresql -p 8080:8080 -p 8090:80 nemesida/nwaf-api-cabinet

where:

  • --rm – container removal after closedown;
  • -d – container running in background mode;
  • -v /opt/nwaf/api-cab-config:/nwaf-api – mounting the directory with configuration files inside the container;
  • -v /opt/nwaf/api-cab-base:/var/lib/postgresql – mounting the directory with database inside the container;
  • p 8080:8080 – container port 8080 forwarding to the external port 8080;
  • -p 8090:80 – container port 80 forwarding to the external port 8090.

Nemesida WAF API and Nemesida WAF Cabinet image update
1. Before updating Nemesida WAF API and Nemesida WAF Cabinet image, verify if the container is runnung. To do this, view the container ID (CONTAINER ID column) using the command:

# docker ps -a

2. If the container is running, stop it using the command:

# docker stop /container ID/

3. With the container stopped, delete the image:

# docker image rm nemesida/nwaf-api-cabinet

4. Load the image containing the Nemesida WAF API modules and the Nemesida WAF Cabinet:

# docker pull nemesida/nwaf-api-cabinet

5. Run the container with Nemesida WAF API image + Nemesida WAF Cabinet, using command:

# iptables -t filter -N DOCKER
# docker run --rm -d -v /opt/nwaf/api-cab-config:/nwaf-api -v /opt/nwaf/api-cab-base:/var/lib/postgresql -p 8080:8080 -p 8090:80 nemesida/nwaf-api-cabinet

Nemesida WAF Signtest Docker container deployment
To deploy Nemesida WAF Signtest Docker container one has to do the following:

1. Load the image containing the Nemesida WAF Signtest:

# docker pull nemesida/nwaf-st

2. Create two directories:

  • For configuration files (for example, nwaf-signtest-config):
    # mkdir /opt/nwaf/nwaf-signtest-config
  • For database (for example, nwaf-signtest-base):
    # mkdir /opt/nwaf/nwaf-signtest-base

3. Create file first-launch in the configuration files directory:

# touch /opt/nwaf/nwaf-signtest-config/first-launch

4. Run the container with Nemesida WAF Signtest, using commands:

# iptables -t filter -N DOCKER
# docker run --rm -d -v /opt/nwaf/nwaf-signtest-config:/nwaf-signtest -v /opt/nwaf/nwaf-signtest-base:/var/lib/postgresql -p 8081:8088 -p 82:80 nemesida/nwaf-st

where:

  • --rm – container removal after closedown;
  • -d – container running in background mode;
  • -v /opt/nwaf/nwaf-signtest-config:/nwaf-signtest – mounting the directory with configuration files inside the container;
  • -v /opt/nwaf/nwaf-signtest-base:/var/lib/postgresql – mounting the directory with database inside the container;
  • -p 8081:8088 – container port 8088 forwarding to the external port 8081;
  • -p 82:80 – container port 80 forwarding to the external port 82.

One can view the container ID using the command (CONTAINER ID column):

# docker ps -a

5. Allow access to reading for all for the directory nwaf-signtest-config:

# chmod -R 0555 /opt/nwaf/nwaf-signtest-config

6. Run the migration and account creation command and follow the script instructions:

# docker exec -ti /container ID/ bash -with "bash /opt/migrate.sh"

One can stop the container using the command:

# docker stop /container ID/

7. Make changes to the configuration files according to the instructions on the documentation pages Nemesida WAF Signtest.

8. To run the container, fulfill the following commands:

# iptables -t filter -N DOCKER
# docker run --rm -d -v /opt/nwaf/nwaf-signtest-config:/nwaf-signtest -v /opt/nwaf/nwaf-signtest-base:/var/lib/postgresql -p 8081:8088 -p 82:80 nemesida/nwaf-st

where:

  • --rm – container removal after closedown;
  • -d – container running in background mode;
  • -v /opt/nwaf/nwaf-signtest-config:/nwaf-signtest – mounting the directory with configuration files inside the container;
  • -v /opt/nwaf/nwaf-signtest-base:/var/lib/postgresql – mounting the directory with database inside the container;
  • -p 8081:8088 – container port 8088 forwarding to the external port 8081;
  • -p 82:80 – container port 80 forwarding to the external port 82.

Nemesida WAF API and Nemesida WAF Cabinet image update
1. Before updating Nemesida WAF Signtest image, verify if the container is runnung. To do this, view the container ID (CONTAINER ID column) using the command:

# docker ps -a

2. If the container is running, stop it using the command:

# docker stop /container ID/

3. With the container stopped, delete the image:

# docker image rm nemesida/nwaf-st

4. Load the image containing the Nemesida WAF Signtest:

# docker pull nemesida/nwaf-st

5. Run the container with Nemesida WAF Signtest, using command:

# iptables -t filter -N DOCKER
# docker run --rm -d -v /opt/nwaf/nwaf-signtest-config:/nwaf-signtest -v /opt/nwaf/nwaf-signtest-base:/var/lib/postgresql -p 8081:8088 -p 82:80 nemesida/nwaf-st