Skip to content

Broadcom Layer7 API Gateways

Broadcom's Layer7 API Gateways is a robust solution to control and secure organization's API traffic. With Wallarm, you can additionally secure APIs controlled by Layer7 API Gateways. This article explains how to integrate Layer7 API Gateways with Wallarm by deploying the Wallarm policy.

The Wallarm policy for Layer7 API Gateways supports the out-of-band mode. Diagram below shows the traffic flow for APIs on the Layer7 API Gateways with Wallarm policy applied.

Layer7 API Gateways with Wallarm image

Use cases

Among all supported Wallarm deployment options, this solution is the recommended one for the following use cases:

  • Managing your APIs with the Layer7 API Gateways.


The Layer7 API Gateways integration supports only the out-of-band traffic analysis, be aware that this method has certain limitations, which also apply to the policy. More details can be found at the provided link.


To proceed with the deployment, ensure that you meet the following requirements:

  • Understanding of the Layer7 API Gateways product.

  • Your application and API are linked and running on Layer7 API Gateways.


To secure APIs on the Layer7 API Gateways using Wallarm, follow these steps:

  1. Deploy a Wallarm node using one of the available deployment options.

  2. Retrieve certificate.

  3. Create Wallarm policy.

1. Deploy a Wallarm node

  1. Choose one of the supported Wallarm node deployment solutions or artifacts for the out-of-band deployment and follow the provided deployment instructions.

  2. Configure the deployed node using the following template:

    server {
        listen 443 ssl;
        ### SSL configuration here    
        wallarm_mode monitoring;
        real_ip_header $http_x_wallarm_real_ip;
        set_real_ip_from <gateway address>;
        proxy_set_header Host $http_x_wallarm_forwarded_host;
        location / {
            proxy_pass http://localhost:8080;
    server {
        listen 8080;
        location / {
            return 200;

    Please ensure to pay attention to the following configurations:

    • TLS/SSL certificates for HTTPS traffic: To enable the Wallarm node to handle secure HTTPS traffic, configure the TLS/SSL certificates accordingly. The specific configuration will depend on the chosen deployment method. For example, if you are using NGINX, you can refer to its article for guidance.
  3. Once the deployment is complete, make a note of the node instance IP as you will need it later to set the address for incoming request forwarding.

2. TLS configuration (if needed)

This step is only needed if the node is deployed externally (for example, Cloud node). If the node is deployed inside your own infrastructure, you may just use HTTP (depending on your own security policies).

  1. Access Layer7 API Gateways UI.

  2. Go to TasksCertificates, Keys and SecretsManage Certificates.

  3. To retrieve the certificate from the node, use the Retrieve via SSL option with the node URI.

  4. If you use a self-signed certificate, access the certificate options and select Certificate is a Trust Anchor.

3. Create Wallarm policy

  1. Access Layer7 API Gateways UI.

  2. For the corresponding server, select Create policy from the menu.

  3. Set Policy Type to Included Policy Fragment. Name it wallarm-mirror.

    Layer7 API Gateways Wallarm included policy fragment

  4. Create the following XML file and import its content into the included policy fragment using the Import Policy button:

    <?xml version="1.0" encoding="UTF-8"?>
    <exp:Export Version="3.0"
        xmlns:exp="" xmlns:wsp="">
        <wsp:Policy xmlns:L7p="" xmlns:wsp="">
            <wsp:All wsp:Usage="Required">
                    <L7p:Comment stringValue="Policy Fragment: wallarm-mirror"/>
                    <L7p:HeaderName stringValue="x-wallarm-forwarded-host"/>
                    <L7p:HeaderValue stringValue="${cluster.hostname}"/>
                    <L7p:RemoveExisting booleanValue="true"/>
                    <L7p:HeaderName stringValue="x-wallarm-real-ip"/>
                    <L7p:HeaderValue stringValue="${request.tcp.remoteAddress}"/>
                    <L7p:RemoveExisting booleanValue="true"/>
                    <L7p:HeaderName stringValue="x-wallarm-response-code"/>
                    <L7p:HeaderValue stringValue="${response.http.status}"/>
                    <L7p:RemoveExisting booleanValue="true"/>
                <wsp:OneOrMore wsp:Usage="Required">
                        <L7p:FailOnErrorStatus booleanValue="false"/>
                        <L7p:ForceIncludeRequestBody booleanValue="true"/>
                        <L7p:ProtectedServiceUrl stringValue="${wallarm_node_addr}/${request.url.path}?${request.url.query}"/>
                        <L7p:ProxyPassword stringValueNull="null"/>
                        <L7p:ProxyUsername stringValueNull="null"/>
                        <L7p:RequestHeaderRules httpPassthroughRuleSet="included">
                            <L7p:ForwardAll booleanValue="true"/>
                            <L7p:Rules httpPassthroughRules="included">
                                <L7p:item httpPassthroughRule="included">
                                    <L7p:Name stringValue="Cookie"/>
                                <L7p:item httpPassthroughRule="included">
                                    <L7p:Name stringValue="SOAPAction"/>
                        <L7p:RequestParamRules httpPassthroughRuleSet="included">
                            <L7p:ForwardAll booleanValue="true"/>
                            <L7p:Rules httpPassthroughRules="included"/>
                        <L7p:ResponseHeaderRules httpPassthroughRuleSet="included">
                            <L7p:ForwardAll booleanValue="true"/>
                            <L7p:Rules httpPassthroughRules="included">
                                <L7p:item httpPassthroughRule="included">
                                    <L7p:Name stringValue="Set-Cookie"/>
                        <L7p:ResponseMsgDest stringValue="wallarm_response"/>
                        <L7p:SamlAssertionVersion intValue="2"/>
  5. Select Create policy for your server once again.

  6. Set Policy Type to Global Policy Fragment.

  7. Set Policy Tag to message-completed.

    Using message-completed tag

    It is important to use the message-completed tag instead of the message-received to avoid putting the added headers into the actual user request. The message-completed is called after it was already processed, but the response was not sent to the client yet.

  8. Name global policy fragment message-completed.

    Layer7 API Gateways Wallarm global policy fragment

  9. For the created global policy fragment, use Set Context Variable, set Variable Name to wallarm_node_addr, and Expression to the URL of the Wallarm node.

  10. Use Include Policy Fragment to include the previously created wallarm-mirror included policy fragment into your global policy fragment.

    Layer7 API Gateways Wallarm policy

  11. Save and activate the policy.


To test the functionality of the deployed policy, follow these steps:

  1. Send the request with the test Path Traversal attack to your API:

    curl http://<YOUR_APP_IP_OR_DOMAIN>/etc/passwd
  2. Open Wallarm Console → Attacks section in the US Cloud or EU Cloud and make sure the attack is displayed in the list.

    Attacks in the interface

Need assistance?

If you encounter any issues or require assistance with the described deployment of Wallarm's policy in conjunction with Layer7 API Gateways, you can reach out to the Wallarm support team. They are available to provide guidance and help resolve any problems you may face during the implementation process.