SecRulesDisabled

The `SecRulesDisabled` directive disables the NAXSI rules engine, preventing any security rules from being applied to incoming requests.

SyntaxSecRulesDisabled;
Defaultoff
Contexthttp, server, location, limit_except
Argumentsnone

Description

The SecRulesDisabled directive is a configuration option provided by the NGINX Anti XSS & SQL Injection module (NAXSI). When this directive is enabled (set to 'on'), it effectively disables all enforcement of security rules by the NAXSI module for the context in which it is set. This can be useful in certain development scenarios where an administrator needs to temporarily turn off security checks to facilitate testing or debugging without the interference of rule validation.

By default, NAXSI operates as a security layer that scans HTTP requests against known patterns indicative of web vulnerabilities, like XSS and SQL Injection attacks. However, using SecRulesDisabled, the NAXSI rules engine is halted, thus bypassing all the filtering that would normally take place. It is crucial to ensure that this directive is only utilized in trusted environments or testing configurations to avoid exposing the application to potential threats.

The directive can be placed in various contexts, including http, server, location, and limit_except. This flexibility allows administrators to specify the scope of where rules should be disabled, which can be helpful for isolating configuration changes or testing specific parts of an application without the enforcement of security policies.

Config Example

http {
    SecRulesDisabled;
    server {
        location / {
            # Other configurations
        }
    }
}

Disabling rules can expose the application to vulnerabilities if not managed carefully.

Be sure to enable rules after testing since leaving this directive in place in production can lead to serious security risks.

← Back to all directives