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
  • How do I get the attachment for my proxy?
  • Linux embedded deployments
  • Docker and Kubernetes deployments
  • Compiling the attachment yourself
  • How to load the open-appsec attachment in the proxy configuration

Was this helpful?

  1. Deployment and Upgrade

Load the Attachment in Proxy Configuration

PreviousDeployment and UpgradeNextUpgrade Your Reverse Proxy/API Gateway When an Agent is Installed

Last updated 3 months ago

Was this helpful?

open-appsec Agents receive the HTTP data from open-appsec Attachments integrating with the Proxy server. This allows the Agents to inspect traffic, once inspection is done, the resulting decision (e.g. to allow traffic or to block it) is returned back to the Attachment for the actual enforcement. When you are providing your own proxy configuration it is therefor critical to make sure that it contains the relevant settings for the proxy to load the attachment.

How do I get the attachment for my proxy?

Linux embedded deployments

The attachment module is automatically downloaded specifically matching your proxy type and version and operating system when you run the open-appsec-install tool to install open-appsec.

Here you find lists of all supported/pre-compiled attachments per supported OS versions for each available integration: , ,

Docker and Kubernetes deployments

We provide "enhanced" versions of the containers for all supported proxies that open-appsec can integrate with. These containers already include the open-appsec attachment.

Compiling the attachment yourself

You can also compile the attachment yourself, this allows you to deploy on currently unsupported versions of the supported proxies or on unsupported operating systems. You can also build your own customized proxy containers. Source code and instructions are available here:

How to load the open-appsec attachment in the proxy configuration

Please follow the instructions provided below for your specific deployment type explaining what needs to be included in your local proxy configuration in order to load the open-appsec attachment module.

When installing open-appsec on Linux embedded the open-appsec-install command will automatically patch the existing nginx.conf file to add the line for loading the module.

In the nginx-attachment container provided by open-appsec for containerized deployments this is already included in the file /etc/nginx/nginx.conf.

In the NGINX configuration file nginx.conf make sure to have the open-appsec attachment loaded as an NGINX module.

The open-appsec attachment module is usually located in this path: /usr/lib/nginx/modules/

Make sure the following line exists as the first line in the nginx.conf file in order to load the open-appsec attachment module:

load_module /usr/lib/nginx/modules/ngx_cp_attachment_module.so;

In the open-appsec-agent-unified container provided by open-appsec for Docker deployments the line to load the attachment module is already included in the file /etc/nginx/nginx.conf.

In the NGINX configuration file nginx.conf make sure to have the open-appsec attachment loaded as an NGINX module.

The open-appsec attachment module is usually located in this path: /usr/lib/nginx/modules/

Make sure the following line exists as the first line in the nginx.conf file in order to load the open-appsec attachment module:

load_module /usr/lib/nginx/modules/ngx_cp_attachment_module.so;

When installing open-appsec on Linux embedded the open-appsec-install command will automatically patch the existing nginx.conf file to add this line.

In the kong-attachment container provided by open-appsec for containerized deployments this is already included in the file /usr/local/kong/nginx.conf.

Kong is based on OpenResty, in OpenResty's NGINX configuration file nginx.conf make sure to have the open-appsec attachment loaded as an NGINX module.

The open-appsec attachment module is usually located in this path: /usr/lib64/nginx/modules/

Make sure the following line exists as the first line in the nginx.conf file in order to load the open-appsec attachment module:

load_module /usr/lib64/nginx/modules/ngx_cp_attachment_module.so;

When installing open-appsec on Linux embedded the open-appsec-install command will automatically patch the existing nginx.conf file to add this line.

In the apisix-attachment container provided by open-appsec for containerized deployments this is already included in the file /usr/local/apisix/conf/nginx.conf.

APISIX is build on OpenResty. In OpenResty's NGINX configuration file nginx.conf make sure to have the open-appsec attachment loaded as an NGINX module.

The open-appsec attachment module is usually located in this path: /usr/lib/nginx/modules/

Make sure the following line exists as the first line in the nginx.conf file in order to load the open-appsec attachment module: (Note that in APISIX the nginx.conf file is automatically generated, so you cannot adjust its contents directly)

load_module /usr/lib/nginx/modules/ngx_cp_attachment_module.so;

When installing Envoy on Docker: As an envoy.yaml configuration file is not included in the Envoy container make sure to have the above configuration added yourself to that file!

In the Envoy configuration file, which is typically called envoy.yaml make sure to have the open-appsec attachment loaded as a filter for HTTP traffic.

The open-appsec attachment is usually located here: /usr/lib/libenvoy_attachment.so

In the configuration example below you can see the relevant lines 16 to 25 which must be added for loading the open-appsec attachment filter for Envoy:

static_resources:
  listeners:
  - name: listener_0
    address:
      socket_address:
        address: 0.0.0.0
        port_value: 80
    filter_chains:
    - filters:
      - name: envoy.filters.network.http_connection_manager
        typed_config:
          "@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
          stat_prefix: ingress_http
          http_filters:
          ## The following 10 lines are required to load the envoy attachment filter for open-appsec
          - name: envoy.filters.http.golang
            typed_config:
              "@type": type.googleapis.com/envoy.extensions.filters.http.golang.v3alpha.Config
              library_id: cp_nano_filter
              library_path: "/usr/lib/libenvoy_attachment.so"
              plugin_name: cp_nano_filter
              plugin_config:
                "@type": type.googleapis.com/xds.type.v3.TypedStruct
                value:
                  prefix_localreply_body: "Configured local reply from go"
          ## 
          - name: envoy.filters.http.router
            typed_config:
              "@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router          

NGINX
Kong
APISIX
GitHub - openappsec/attachment: Attachments connect between processes that provide HTTP data and the open-appsec Agent security logic.GitHub
Logo