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:
Optional: Perform One-Time Upload of Your Existing Local Configuration to Central WebUI If You Want to Maintain It (relevant for Central Management Mode Only)
If you want to maintain your existing local, declarative configuration after connecting to central WebUI, so that it will become the initial starting point for the central management configuration (requires WebUI deployment profile set to "This management"), follow these optional steps to perform a one time upload of your existing local, declarative configuration to the central management (SaaS).
This option is not relevant when you want to connect to a deployment profile in central management WebUI set to "Declarative configuration", as in that case WebUI will continuously show the current, declarative configuration, which you will still manage locally.
If you do not perform this step and have the deployment profile set to "This management" you will start with a new clean (empty) central configuration for your existing deployment.
Step 1: Download the mgmt-connect-linux tool
mgmt-connect-linux toolRun the following command to download and prepare the mgmt-connect-linux tool inside the existing, running agent container:
docker exec -it open-appsec-agent bash -c "wget https://downloads.openappsec.io/scripts/mgmt-connect-linux && chmod +x mgmt-connect-linux"Step 2: Perform one-time upload of the existing local configuration
Use the token generated in your deployment profile during the prerequisites to upload the policy. Replace <TOKEN> with your actual deployment profile token:
docker exec -it open-appsec-agent bash -c "./mgmt-connect-linux --token <TOKEN> --config-upload-only"Notes:
The container name for the agent container in your environment could have been changed based on your original deployment, in that case adjust
open-appsec-agentin the commands above with your own agent container name.
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>:
If you chose "“Declarative configuration” management make sure to keep the agent local configuration file volume mount which gets mounted to /ext/appsec inside the agent container.
If you chose "This Management" then the above mentioned volume mount is no longer needed, and can be removed.
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):
Step 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>:
If you chose "“Declarative configuration” management make sure to keep the agent local configuration file volume mount which gets mounted to /ext/appsec inside the agent container.
If you chose "This Management" then the above mentioned volume mount is no longer needed, and can be removed.
Step 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):
Step 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?