open-appsec
WebsiteManagement PortalPlaygroundGitHub
  • open-appsec Documentation
  • What is open-appsec?
  • open-appsec Video Tutorials
  • Release Notes
  • Getting started
    • Getting Started
    • Start With Kubernetes
      • Install Using Interactive CLI Tool (Ingress NGINX)
      • Configuration Using Interactive CLI Tool
      • Install Using Helm
      • Install Using Helm - new flow (beta)
      • Configuration Using CRDs
      • Configuration Using CRDs - v1beta2
      • Configuration using CRDs - special options for Large Scale Deployments
        • Using appsec class for assigning separate custom resources to specific deployments
        • Using namespace-scoped custom resources
      • Monitor Events
    • Start With Linux
      • Install open-appsec for Linux
      • Using the open-appsec-ctl Tool
      • Configuration Using Local Policy File (Linux)
      • Local Policy File (Advanced)
      • Local Policy File v1beta2 (beta)
      • Monitor Events
    • Start with Docker
      • Install With Docker (Centrally Managed)
      • Install With Docker (Locally Managed)
      • Deploy With Docker-Compose (Beta)
      • Configuration Using Local Policy File (Docker)
      • Local Policy File (Advanced)
    • Using the Web UI (SaaS)
      • Sign-Up and Login to Portal
      • Agents Deployment
      • Connect Deployed Agents to SaaS Management Using Tool (K8s & Linux)
      • Connect Deployed Agents to SaaS Management Using Helm (K8s)
      • Connect Deployed Agents to SaaS Management (Docker)
      • Create a Profile
      • Protect Additional Assets
      • Monitor Events
    • Using the Advanced Machine Learning Model
  • Concepts
    • Agents
    • Management & Automation
    • Security Practices
    • Contextual Machine Learning
  • SETUP INSTRUCTIONS
    • Setup Web Application Settings
    • Setup Custom Rules and Exceptions
    • Setup Web User Response Pages
    • Setup Log Triggers
    • Setup Behavior Upon Failure
    • Setup Agent Upgrade Schedule
  • Additional Security Engines
    • Anti-Bot
    • API Schema Enforcement
    • Data Loss Prevention (DLP) Rules
    • File Security
    • Intrusion Prevention System (IPS)
    • Rate Limit
  • Snort Rules
    • Import Snort Rules
    • Write Snort Signatures
  • HOW TO
    • Configuration and Learning
      • Track Learning and Move From Learn/Detect to Prevent
      • Configure Contextual Machine Learning for Best Accuracy
      • Track Learning and Local Tuning in Standalone Deployments
      • Move From Detect to Prevent in K8s With Many Ingress Rules
  • Deployment and Upgrade
    • Load the Attachment in Proxy Configuration
    • Upgrade Your Reverse Proxy/API Gateway When an Agent is Installed
    • Integration in GitOps CD (K8s)
    • Build open-appsec Based on Source Code
  • Management Web UI
    • Track Agent Status
    • Delete or Reset Management Tenant (SaaS)
    • Disconnect an open-appsec agent from Central Management
  • Integrations
    • About Integrations With 3rd Party Solutions
    • CrowdSec
      • CrowdSec Bouncer Support
      • CrowdSec Intelligence Sharing Using open-appsec Parser/Scenario
    • NGINX Proxy Manager
      • Install NGINX Proxy Manager with open-appsec managed from NPM WebUI
      • Install NGINX Proxy Manager with open-appsec managed from central WebUI (SaaS)
      • Frequently Asked Questions
      • How to Migrate from an Existing NGINX Proxy Manager Deployment and Keep Configuration
    • NPMplus
    • Docker SWAG
      • Install Docker SWAG with open-appsec (locally managed)
      • How to connect locally managed Docker SWAG with open-appsec to WebUI
      • Install Docker SWAG with open-appsec (centrally managed)
      • Deploy Docker SWAG with docker-compose (beta)
      • Frequently Asked Questions
  • Troubleshooting
    • Troubleshooting
    • Troubleshooting Guides
      • Configuration contains ingress/asset with URL which already has asset attached to it in your tenant
      • HTTP Request to Port 80 Not Returning as Expected
      • Agent Fails to Recognize HTTP Transactions with NGINX
      • Agent Not Recognizing Initial HTTP Requests
      • Handling Large Requests (413 Responses)
      • open-appsec on Docker HTTP Transaction Handler Is Set To Ready
      • Traffic Recognition Issue on Single-Core Machine/Connection Timed Out
      • Installing open-appsec on CentOS 7
      • SELinux: checking status and disabling
      • Deploy open-appsec directly on the web server hosting the application to protect
      • object is locked or remote, and therefore cannot be modified
      • Failed to Register to Fog
  • references
    • Agent CLI
    • Event Query Language
    • Events/Logs Schema
    • WAF Comparison Project
Powered by GitBook
On this page
  • Prerequisites
  • Installation

Was this helpful?

  1. Getting started
  2. Start with Docker

Install With Docker (Centrally Managed)

PreviousStart with DockerNextInstall With Docker (Locally Managed)

Last updated 3 months ago

Was this helpful?

Prerequisites

  • Access to a SaaS tenant on my.openappsec.io (WebUI for SaaS management) Follow the instructions available here:

  • Agent profile created for open-appsec Docker deployment in SaaS tenant Follow the instructions available here, and make sure to choose the "This management" management mode. Once done, don't forget to copy the profile token after policy installation as this is needed in the installation steps further below:

  • Linux machine with:

    • Docker software installed (or similar compatible Container runtime)

    • Root Permissions

Installation

Make sure to meet the prerequisites on top of this page and to have the profile token available. Make sure you enforce the policy after profile creation.

Follow these steps to deploy open-appsec and NGINX reverse proxy (including open-appsec attachment) with separate containers (e.g. on Docker) or implement this using your deployment CI pipeline: (This is the standard deployment, an alternative option to deploy with a single, unified container is available as well, see "NGINX - Unified" tab.)

Step 1: Pull the open-appsec agent image or add/use it as part of the deployment CI’s container management system:

docker pull ghcr.io/openappsec/agent:latest

Step 2: Create the following empty directories to be used later for volume mounts in the docker run command for the agent.

<path-to-persistent-location-for-agent-config>
<path-to-persistent-location-for-agent-data-files>
<path-to-persistent-location-for-agent-debugs-and-logs>

Creation of the folders above and the volume mounts shown in the next step with -v is optional but strongly recommended for having persistence of the important agent information (data, config, logs).

Step 3: Run the open-appsec agent container with this command:

docker run --name=open-appsec-agent \
--ipc=host \
-v <path-to-persistent-location-for-agent-config>:/etc/cp/conf \
-v <path-to-persistent-location-for-agent-data-files>:/etc/cp/data \
-v <path-to-persistent-location-for-agent-debugs-and-logs>:/var/log/nano_agent \
-it \
-e registered_server='NGINX' \
-e user_email=<your-email-address> \
-e AGENT_TOKEN=<token> \
-e https_proxy=<user:password@proxy address:port> \
-d ghcr.io/openappsec/agent:latest /cp-nano-agent

Replace the <token> parameter with the token you copied from the profile in the WebUI before (see Prerequisites section above).

The https_proxy environment variable allows you to configure an HTTP(S) proxy server to be used by the agent. It is optional and can be removed if not needed.

The optional no-upgrade flag to the cp-nano-agent command will start the agent without an initial upgrade.

The optional user_email environment variable allows you to associate your email address with your specific deployment by replacing <your-email-address> with your own email address.

This allows the open-appsec team to provide you easy assistance in case of any issues you might have with your specific deployment in the future and also to provide you information proactively regarding open-appsec in general or regarding your specific deployment. This is an optional parameter and can be removed. If we send automatic emails there will also be an opt-out option included for receiving similar communication in the future.

Step 3: Create (or replace) the NGINX container by first pulling the open-appsec NGINX container, which already contains the open-appsec attachment. Alternatively, add/use it as part of the deployment CI’s container management system:

docker pull ghcr.io/openappsec/nginx-attachment:latest

Step 4: Run the open-appsec NGINX container, make sure to add the --ipc=host parameter, here’s an example command:

docker run --name open-appsec-nginx \
--ipc=host \
-p 80:80 \
-d ghcr.io/openappsec/nginx-attachment:latest

Step 5: Make sure both containers are running, use docker ps to verify.

Step 6: Navigate to the Agents tab and ensure the new Agent is successfully connected.

Step 7: Create one or more assets defining the specific resources that open-appsec should protect and don't forget to install the policy afterward. All required steps are explained here:

This feature is currently in beta and may be subject to changes.

Make sure to meet the prerequisites on top of this page and to have the profile token available. Make sure you enforce the policy after profile creation.

Follow these steps to deploy open-appsec combined with NGINX reverse proxy (including open-appsec attachment) with a single, unified container (e.g. on Docker) or implement this using your deployment CI pipeline:

Step 1: Pull the open-appsec agent unified with NGINX image or add/use it as part of the deployment CI’s container management system:

docker pull ghcr.io/openappsec/agent-unified:latest

Step 2: Create the following empty directories to be used later for volume mounts in the docker run command for the agent.

<path-to-persistent-location-for-agent-config>
<path-to-persistent-location-for-agent-data-files>
<path-to-persistent-location-for-agent-debugs-and-logs>

Creation of the folders above and the volume mounts shown in the next step with -v is optional but strongly recommended for having persistence of the important agent information (data, config, logs).

Step 3: Run the open-appsec agent container with this command:

docker run -d \
  --name open-appsec-agent-unified \
  --restart unless-stopped \
  -p 80:80 \
  -p 443:443 \
  -v <path-to-persistent-location-for-agent-config>:/etc/cp/conf \
  -v <path-to-persistent-location-for-agent-data-files>:/etc/cp/data \
  -v <path-to-persistent-location-for-agent-debugs-and-logs>:/var/log/nano_agent \
  -v <host-nginx-conf-path>:/etc/nginx/conf.d \
  -e user_email=<your-email-address> \
  -e AGENT_TOKEN=<token> \
  -e https_proxy=<user:password@proxy address:port> \
  ghcr.io/openappsec/agent-unified:latest /cp-nano-agent

Replace the <token> parameter with the token you previously copied from the profile in the WebUI (see Prerequisites section above).

The https_proxy environment variable allows you to configure an HTTP(S) proxy server to be used by the agent. It is optional and can be removed if not needed.

The optional no-upgrade flag to the cp-nano-agent command will start the agent without an initial upgrade.

The optional user_email environment variable allows you to associate your email address with your specific deployment by replacing <your-email-address> with your own email address.

This allows the open-appsec team to provide you easy assistance in case of any issues you might have with your specific deployment in the future and also to provide you information proactively regarding open-appsec in general or regarding your specific deployment. This is an optional parameter and can be removed. If we send automatic emails there will also be an opt-out option included for receiving similar communication in the future.

Step 3: Make sure both containers are running, use docker ps to verify.

Step 4: Navigate to the Agents tab and ensure the new Agent is successfully connected.

Step 5: Create one or more assets defining the specific resources that open-appsec should protect and don't forget to install the policy afterward. All required steps are explained here:

Make sure to meet the prerequisites on top of this page and to have the profile token available. Make sure you enforced the policy after profile creation.

Follow these steps to install Kong with open-appsec using containers (e.g. on Docker) or using your deployment CI:

Step 1: Pull the open-appsec agent image or add/use it as part of the deployment CI’s container management system:

docker pull ghcr.io/openappsec/agent:latest

Step 2: The volume mounts set in the next step with-v are optional but recommended for the persistence of the agent information (data, config, logs). If you want to use those parameters create the following empty directories to be used later for volume mounts in the docker run command for the agent.

<path-to-persistent-location-for-agent-config>
<path-to-persistent-location-for-agent-data-files>
<path-to-persistent-location-for-agent-debugs-and-logs>

Step 3: Run the open-appsec agent container with this command:

docker run --name=open-appsec-agent \
--ipc=host \
-v <path-to-persistent-location-for-agent-config>:/etc/cp/conf \
-v <path-to-persistent-location-for-agent-data-files>:/etc/cp/data \
-v <path-to-persistent-location-for-agent-debugs-and-logs>:/var/log/nano_agent \
-it \
-e registered_server='Kong' \
-e user_email=<your-email-address> \
-e AGENT_TOKEN=<token> \
-e https_proxy=<user:password@proxy address:port> \
-d ghcr.io/openappsec/agent:latest /cp-nano-agent

Replace the <token> parameter with the token you copied from the profile in the WebUI before (see Prerequisites section above).

The https_proxy environment variable allows you to configure an HTTP(S) proxy server to be used by the agent. It is optional and can be removed if not needed.

The optional no-upgrade flag to the cp-nano-agent command will start the agent without an initial upgrade.

The volume mounts set with-v are optional but recommended for the persistence of the agent information (data, config, logs). If you use those parameters create the following empty directories to be used later for volume mounts in the docker run command for the agent.

<path-to-persistent-location-for-agent-config>
<path-to-persistent-location-for-agent-data-files>
<path-to-persistent-location-for-agent-debugs-and-logs>

The optional user_email environment variable allows you to associate your email address with your specific deployment by replacing <your-email-address> with your own email address.

This allows us to provide you easy assistance in case of any issues you might have with your specific deployment in the future and also to provide you information proactively regarding open-appsec in general or regarding your specific deployment. This is an optional parameter and can be removed. If we send automatic emails there will also be an opt-out option included for receiving similar communication in the future.

Step 3: Create (or replace) the Kong container by pulling the enhanced open-appsec Kong container, which already contains the open-appsec attachment. Alternatively, add/use it as part of the deployment CI’s container management system:

For Kong (open-source version):

docker pull ghcr.io/openappsec/kong-attachment:latest

For Kong Gateway (enterprise version):

docker pull ghcr.io/openappsec/kong-gateway-attachment:latest

Step 4: Run the open-appsec Kong container, make sure to add the --ipc=host parameter, here’s an example command:

For Kong (open-source version):

docker run \
--name kong \
--ipc=host \
-e KONG_DATABASE=off \
-p 8000:8000 -p 8443:8443 -p 127.0.0.1:8001:8001 -p 127.0.0.1:8444:8444 \
-d ghcr.io/openappsec/kong-attachment:latest

For Kong Gateway (enterprise version):

docker run \
--name kong-gateway \
--ipc=host \
-e KONG_DATABASE=off \
-p 8000:8000 -p 8443:8443 -p 127.0.0.1:8001:8001 -p 127.0.0.1:8444:8444 \
-d ghcr.io/openappsec/kong-gateway-attachment:latest

Step 5: Make sure both containers are running, use docker ps to verify.

Step 6: Navigate to the Agents tab and ensure the new Agent is successfully connected.

Step 7: Create one or more assets defining the specific resources that open-appsec should protect and don't forget to enforce the policy afterward. All required steps are explained here:

A new, enhanced version of the docker compose for APISIX is available here: Deploy With Docker-Compose (Beta) (Currently in Early Availability)

Make sure to meet the prerequisites on top of this page and to have the profile token available. Make sure you enforced the policy after profile creation.

Follow these steps to install APISIX with open-appsec using containers (e.g. on Docker) or using your deployment CI:

Step 1: Download the docker-compose.yaml file, see content bellow:

wget https://raw.githubusercontent.com/openappsec/openappsec/main/deployment/apisix/docker-compose.yaml
version: "3"

services:
  apisix:
    container_name: apisix
    image: "ghcr.io/openappsec/apisix-attachment:latest"
    ipc: host
    restart: always
    volumes:
      - .<apisix-conf-path>:/usr/local/apisix/conf/apisix.yaml:ro
    environment:
      - APISIX_STAND_ALONE=true
    ports:
      - "9180:9180/tcp"
      - "9080:9080/tcp"
      - "9091:9091/tcp"
      - "9443:9443/tcp"

  appsec-agent:
    container_name: appsec-agent
    image: 'ghcr.io/openappsec/agent:latest'
    ipc: host
    restart: unless-stopped
    environment:
      # adjust with your own email below
      - user_email=user@email.com
      - registered_server="APISIX"
      - AGENT_TOKEN=<TOKEN>
    volumes:
      - ./appsec-config:/etc/cp/conf
      - ./appsec-data:/etc/cp/data
      - ./appsec-logs:/var/log/nano_agent
      - ./appsec-localconfig:/ext/appsec
    command: /cp-nano-agent 

Step 2: Replace the following:

  • Replace the <TOKEN> parameter with the token you copied from the profile in the WebUI before (see Prerequisites section above),

  • The volume mounts are optional but recommended for the persistence of the agent information (data, config, logs).

  • The optional user_email environment variable allows you to associate your email address with your specific deployment by replacing <your-email-address> with your own email address. This allows us to provide you easy assistance in case of any issues you might have with your specific deployment in the future and also to provide you information proactively regarding open-appsec in general or regarding your specific deployment. This is an optional parameter and can be removed. If we send automatic emails there will also be an opt-out option included for receiving similar communication in the future.

Step 3: Run the Docker Compose

docker-compose up -d

Step 4: Make sure both containers are running, use docker ps to verify.

Step 5: Navigate to the Agents tab and ensure the new Agent is successfully connected.

Step 6: Create one or more assets defining the specific resources that open-appsec should protect and don't forget to enforce the policy afterward. All required steps are explained here:

For Envoy deployment on Docker please follow the docs for docker-compose-based installation provided here:

Now your open-appsec installation on Docker is completed and your configured web app or API assets are protected!

For general NGINX configuration please check the relevant

For general NGINX configuration please check the relevant

For general Kong configuration details please check the

Replace <apisix-conf-path> with the path for declarative configuration file for APISIX, an example file can be found , for general APISIX configuration details please check the .

Sign-Up and Login to Portal
Create a Profile
NGINX documentation
Protect Additional Assets
NGINX documentation
Protect Additional Assets
Kong documentation
Protect Additional Assets
here
APISIX Documentation
Protect Additional Assets
Deploy With Docker-Compose (Beta)