getWafSettings — Retrieving the Firewall & CDN rules policy

The getWafSettings method retrieves the Firewall & CDN rules policy for a site.

The API endpoint is:

https://api.sitelock.com/v1/partner

Request format

  • SiteLockOnlineRequest: This element is used to delineate the full API request.

    • authentication: The partner’s username, password, and branding

      • username: The partner’s API username

      • password: The partner’s API password

      • partner: (Optional) The brand name to use in messaging

    • getWafSettings: The method name

      • site_id: The ID of the site for which to retrieve the Firewall & CDN rules policy

Example request

<SiteLockOnlineRequest>
    <authentication>
        <user>Username</user>
        <password>Password</password>
    </authentication>
    <getWafSettings>
        <site_id>12</site_id>
    </getWafSettings>
</SiteLockOnlineRequest>

Response format

  • SiteLockOnlineResponse: This element is used to delineate the full API response.

    • getWafSettings: The method name

      • backdoor: Protection policy against backdoor access attempts

        • options: A list of available options for backdoor access protection

          • option:(Repeatable) A backdoor protection rule. The value can be one of the following:

            • alert: Alert the user about a backdoor access attempt

            • disabled: Disable backdoor access protection

            • quarantine_url: Send the requested URL to quarantine

        • setting: The currently selected option for backdoor access protection

        • status: Either ok or error

      • bot_access_control: Protection policy against access attempts by web bots

        • options: A list of available options for protection against access attempts by web bots

          • option: (Repeatable) A web bot protection rule. The value can be one of the following:

            • block_challenge: Block a bad bot, and challenge a suspected bot, for example, with a captcha

            • challenge: Challenge a suspected web bot, for example, with a captcha

            • block: Block access attempts by web bots

            • disabled: Disable web bot protection

        • setting: The currently selected option for web bot protection

        • status: Either ok or error

      • ddos: Protection policy against DDoS attacks

        • options: A list of available options for DDoS protection

          • option: (Repeatable) A DDoS protection rule. The value can be one of the following:

            • on: Enable DDoS protection

            • auto: DDoS mitigation rules are activated automatically when SiteLock detects that your site is under a DDoS attack

            • off: Disable DDoS protection

        • setting: The currently selected option for DDoS protection

        • status: Either ok or error

      • illegal_resource: Protection policy against illegal resource access attempts

        • options: A list of available options for protection against illegal resource access attempts

          • option: (Repeatable) A protection rule for illegal resource access attempts. The value can be one of the following:

            • alert: Alert the user about an illegal resource access attempt

            • disable: Disable protection against illegal resource access attempts

            • block_ip: Block the IP address from which an illegal resource access attempt was made

            • block_user: Block the visitor that made an illegal resource access attempt

            • block_request: Block illegal resource access requests

        • setting: The currently selected option for protection against illegal resource access attempts

        • status: Either ok or error

      • remote_file_inclusion: Protection policy against remote file inclusion attacks

        • options: A list of available options for protection against remote file inclusion attacks

          • option: (Repeatable) A protection rule for remote file inclusion. The value can be one of the following:

            • alert: Alert the user about a remote file inclusion attack

            • disable: Disable protection against remote file inclusion attacks

            • block_ip: Block the IP address from which a remote file inclusion attack was made

            • block_user: Block the visitor that made a remote file inclusion attack

            • block_request: Block remote file inclusion requests

        • setting: The currently selected option for protection against remote file inclusion attacks

        • status: Either ok or error

      • sql_injection: Protection policy against SQL injection attacks

        • options: A list of available options for protection against SQL injection attacks

          • option: (Repeatable) A protection rule for SQL injection. The value can be one of the following:

            • alert: Alert the user about a SQL injection attack

            • disable: Disable protection against SQL injection attacks

            • block_ip: Block the IP address from which a SQL injection attack was made

            • block_user: Block the visitor that made a SQL injection attack

            • block_request: Blocks requests if they appear to contain malicious SQL code

        • setting: The currently selected option for protection against SQL injection attacks

        • status: Either ok or error

      • xss: Protection policy against cross-site scripting (XSS) attacks

        • options: A list of available options for protection against XSS attacks

          • option: (Repeatable) A protection rule for XSS attacks. The value can be one of the following:

            • alert: Alert the user about an XSS attack

            • disable: Disable protection against XSS attacks

            • block_ip: Block the IP address from which an XSS attack was made

            • block_user: Block the visitor that made an XSS attack

            • block_request: Blocks requests if they resemble XSS attacks

        • setting: The currently selected option for protection against XSS attacks

        • status: Either ok or error

Example response

<SiteLockOnlineResponse>
    <getWafSettings>
        <backdoor>
            <options>
                <option>alert</option>
                <option>disabled</option>
                <option>quarantine_url</option>
            </options>
            <setting>quarantine_url</setting>
            <status>ok</status>
        </backdoor>
        <bot_access_control>
            <options>
                <option>block_challenge</option>
                <option>challenge</option>
                <option>block</option>
                <option>disabled</option>
            </options>
            <setting>block_challenge</setting>
            <status>ok</status>
        </bot_access_control>
        <ddos>
            <options>
                <option>on</option>
                <option>auto</option>
                <option>off</option>
            </options>
            <setting>auto</setting>
            <status>ok</status>
        </ddos>
        <illegal_resource>
            <options>
                <option>alert</option>
                <option>disabled</option>
                <option>block_ip</option>
                <option>block_user</option>
                <option>block_request</option>
            </options>
            <setting>alert</setting>
            <status>ok</status>
        </illegal_resource>
        <remote_file_inclusion>
            <options>
                <option>alert</option>
                <option>disabled</option>
                <option>block_ip</option>
                <option>block_user</option>
                <option>block_request</option>
            </options>
            <setting>alert</setting>
            <status>ok</status>
        </remote_file_inclusion>
        <sql_injection>
            <options>
                <option>alert</option>
                <option>disabled</option>
                <option>block_ip</option>
                <option>block_user</option>
                <option>block_request</option>
            </options>
            <setting>alert</setting>
            <status>ok</status>
        </sql_injection>
        <status>ok</status>
        <xss>
            <options>
                <option>alert</option>
                <option>disabled</option>
                <option>block_ip</option>
                <option>block_user</option>
                <option>block_request</option>
            </options>
            <setting>alert</setting>
            <status>ok</status>
        </xss>
    </getWafSettings>
</SiteLockOnlineResponse>