Connect Deployed Agents to SaaS Management (Docker)
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 bellow, 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
Existing open-appsec WAF deployment on Docker which is:
locally managed
not connected to the central WebUI yet
Instructions:
If you deployed open-appsec using docker-compose command with .env file):
Step 1: Add the deployment profile's token to your .env file:
Locate the
APPSEC_AGENT_TOKEN=key in your.envfile.Copy the Token from your WebUI Docker Profile (as described in the prerequisites) and paste it as the value for the
APPSEC_AGENT_TOKENkey.
Example .env file snippet, make sure to do the above change in your own .env file and provide your own deployment profile token copied from the Web UI for <your-agent-token>:
## To connect your deployment to central open-appsec WebUI provide the token for a profile
## which you created in open-appsec WebUI at https://my.openappsec.io
## Example: APPSEC_AGENT_TOKEN=111-22222-111
APPSEC_AGENT_TOKEN=<your-agent-token>Step 2: Apply the adjusted Docker Compose configuration provided in the .env file:
Run the following commands to recreate the agent container based on the adjusted Docker Compose file which now includes the AGENT_TOKEN specification for connecting to Management WebUI (SaaS):
docker-compose up -dStep 3: Verify the connection:
Log in to the Web UI and check if your agent is connected.
If you deployed open-appsec using docker-compose command (without using a .env file):
Step 1: Add the deployment profile's token to your docker-compose.yaml file:
Locate the
AGENT_TOKENkey in yourdocker-compose.yamlfile.Copy the Token from your WebUI Docker Profile (as described in the prerequisites) and paste it as the value for the
AGENT_TOKENkey.
Example docker-compose.yaml snippet, make sure to do the above change in your own docker-compose.yaml file providing your own deployment profile token copied from the Web UI for <your-agent-token>:
version: '3'
services:
openappsec-agent:
image: ghcr.io/openappsec/agent:latest
container_name: open-appsec-agent
environment:
- registered_server=NGINX Server
- user_email=<add-your-email-here>
- https_proxy=<user:password@proxy-address:port>
- autoPolicyLoad=false
- AGENT_TOKEN=<your-agent-token>
volumes:
- <path-to-persistent-location-for-agent-config>:/etc/cp/conf
- <path-to-persistent-location-for-agent-data-files>:/etc/cp/data
- <path-to-persistent-location-for-agent-debugs-and-logs>:/var/log/nano_agent
- <path-to-persistent-location-for-local-configuration-file>:/ext/appsec
ipc: hostStep 2: Apply the adjusted Docker Compose configuration:
Run the following commands to recreate the agent container based on the adjusted Docker Compose file which now includes the AGENT_TOKEN specification for connecting to Management WebUI (SaaS):
docker-compose up -dStep 3: Verify the connection:
Log in to the Web UI and check if your agent is connected.
If you chose “This management” management mode, and didn't upload the policy:
Step 4: Create one or more assets in the Web UI, make sure to connect the asset to the profile you have created in the Prerequisites:
Protect Additional AssetsLast updated
Was this helpful?