Skip to content

NGINX App Protect 5.7 / 4.15 Release #571

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 43 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
81fd8a2
feat: Add information about IP groups for NAP-WAF 5.7 (#562)
kudriavitsky May 20, 2025
fddf29b
Merge branch 'main' into nap-release-5.7
ADubhlaoich May 20, 2025
4f69882
chore: add IP intelligence (#616)
mouraddmeiri May 28, 2025
c898f90
feat: Improve NAP-WAF brute force and login-pages documentation (#609)
kudriavitsky May 28, 2025
dfc25ee
Merge branch 'main' into nap-release-5.7
ADubhlaoich May 28, 2025
f5de946
feat: add IP intelligence (new) (#622)
mouraddmeiri May 30, 2025
9db7a2c
Merge branch 'main' into nap-release-5.7
ADubhlaoich May 30, 2025
fe9f6e0
Update configuration.md
ohad-perets Jun 3, 2025
737cef1
add ipi to configuration table
ohad-perets Jun 3, 2025
027a26a
remove xff from ip groups example
ohad-perets Jun 3, 2025
11921cd
Merge branch 'main' into nap-release-5.7
ADubhlaoich Jun 4, 2025
f4660b8
feat: Remove redundant content
ADubhlaoich Jun 4, 2025
f8fedc0
feat: Update IP feature links
ADubhlaoich Jun 5, 2025
4c2691d
Update install.md (#650)
kudriavitsky Jun 9, 2025
44f4b7d
Merge branch 'main' into nap-release-5.7
ADubhlaoich Jun 16, 2025
1b319ce
feat: Add placeholder release pages
ADubhlaoich Jun 16, 2025
7d8f146
Update about-4.15.md
ohad-perets Jun 16, 2025
d7808ab
Update about-5.7.md
ohad-perets Jun 16, 2025
337d455
Update about-4.15.md
ohad-perets Jun 16, 2025
4d9b35c
Update about-5.7.md
ohad-perets Jun 16, 2025
3079aca
Update ip-groups-overview.md (#679)
kudriavitsky Jun 17, 2025
d0f58a2
Update ip-groups-override-rules.md (#680)
kudriavitsky Jun 17, 2025
08cd183
Update about-4.15.md
ohad-perets Jun 19, 2025
d449557
Update about-5.7.md
ohad-perets Jun 19, 2025
78fb5cb
feat: Update overview.md (#651)
kudriavitsky Jun 19, 2025
0dfb1c0
Update deploy-on-docker.md
ohad-perets Jun 19, 2025
a5ccc4c
Update deploy-with-helm.md
ohad-perets Jun 19, 2025
3499bbb
Update install.md
ohad-perets Jun 19, 2025
4b9f094
Update overview.md
ohad-perets Jun 19, 2025
85a17f4
Update troubleshooting.md
ohad-perets Jun 19, 2025
73d7f35
Update install.md
ohad-perets Jun 19, 2025
1b584c5
Update upgrade-nap-waf.md
ohad-perets Jun 19, 2025
039a688
Update deploy-with-manifests.md
ohad-perets Jun 19, 2025
df3dbc2
Update install.md
ohad-perets Jun 19, 2025
39360d8
Update about-5.7.md
ohad-perets Jun 19, 2025
50f2177
Update about-4.15.md
ohad-perets Jun 19, 2025
5aa316f
Update ip-groups-override-rules.md
ohad-perets Jun 19, 2025
893d1f7
Update ip-groups-overview.md
ohad-perets Jun 19, 2025
150f76e
Update configuration.md
ohad-perets Jun 19, 2025
1708b8a
Update configuration.md
ohad-perets Jun 19, 2025
b6d0c54
Update configuration.md
ohad-perets Jun 19, 2025
606b0f3
Update ip-groups-override-rules.md (#711)
kudriavitsky Jun 20, 2025
89e9b47
Merge branch 'main' into nap-release-5.7
ADubhlaoich Jun 20, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
#### IP-Address-Lists feature as part of Override Rules feature.

The Override Rules feature allows you to override original or parent policy settings.

Rules are defined using specific conditions, which can include an IP Address Lists based on the declarative policy JSON schema.

When triggered, the rule is applied to the _clientIp_ attribute using the _matches_ function.

'clientIp.matches(ipAddressLists["standalone"])'

Here is a policy example:

```json
{
"policy": {
"name": "ip_group_override_rule",
"template": {
"name": "POLICY_TEMPLATE_NGINX_BASE"
},
"applicationLanguage": "utf-8",
"caseInsensitive": false,
"enforcementMode": "blocking",
"ip-address-lists": [
{
"name": "standalone",
"ipAddresses": [
{
"ipAddress": "1.1.1.1/32"
}
]
}
],
"override-rules": [
{
"name": "myRule1",
"condition": "clientIp.matches(ipAddressLists['standalone'])",
"actionType": "extend-policy",
"override": {
"policy": {
"enforcementMode": "transparent"
}
}
}
]
}
}
```

The previous example policy contains an IP address lists with the name "standalone", used for the override rule condition "clientIp.matches(ipAddressLists['standalone'])".
The condition means that the rule enforcement is applied and override base policy enforcement when clientIp is matched to one of ipAddresses in ipAddressList with name "standalone".
The value used for the override condition must exist and exactly match the name in "ip-address-lists".

#### Possible errors

| Error text | Input | Explanation |
| -----------| ------------- | ------------ |
| _Invalid field invalidList_ | _clientIp.matches(invalidList['standalone']);_ | An incorrect keyword was used instead of _ipAddressLists_ |
| _Invalid value empty string_ | _clientIp.matches(ipAddressLists['']_ | An empty name was provided |
| _Failed to compile policy - 'ipGroupOverridePolicy'_ | _uri.matches(ipAddressLists['standalone']);_ | Used _ipAddressLists_ without the _clientIP_ attribute |



81 changes: 81 additions & 0 deletions content/includes/nap-waf/config/common/ip-groups-overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
IP address lists is a feature to organize lists of allowed and forbidden IP addresses across several lists with common attributes.

This allows you to control unique policy settings for incoming requests based on specific IP addresses.

Each IP address list contains a unique name, enforcement type (_always_, _never_ and _policy-default_), and list of IP addresses.


An example of a declarative policy using IP address lists configuration:

```json
{
"policy": {
"name": "IpGroups_policy",
"template": {
"name": "POLICY_TEMPLATE_NGINX_BASE"
},
"applicationLanguage": "utf-8",
"caseInsensitive": false,
"enforcementMode": "blocking",
"ip-address-lists": [
{
"name": "Standalone",
"description": "Optional Description",
"blockRequests": "policy-default",
"setGeolocation": "IN",
"ipAddresses": [
{
"ipAddress": "1.2.3.4/32"
},
{
"ipAddress": "1111:fc00:0:112::2"
}
]
}
]
}
}

```
The example with IP-Group definition in external file external_ip_groups.json:

```json
{
"policy": {
"name": "IpGroups_policy2",
"template": {
"name": "POLICY_TEMPLATE_NGINX_BASE"
},
"applicationLanguage": "utf-8",
"caseInsensitive": false,
"enforcementMode": "blocking",
"ip-address-lists": [
{
"name": "external_ip_groups",
"description": "Optional Description",
"blockRequests": "always",
"setGeolocation": "IL",
"$ref": "file:///tmp/policy/external_ip_groups.json"
}
]
}
}
```
Example of the file external_ip_groups.json

```json
{
"name": "External IP address lists",
"description": "Optional Description",
"blockRequests": "always",
"setGeolocation": "IR",
"ipAddresses": [
{
"ipAddress": "66.51.41.21"
},
{
"ipAddress": "66.52.42.22"
}
]
}
```
119 changes: 119 additions & 0 deletions content/includes/nap-waf/config/common/ip-intelligence-conf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@



As of NAP version 4.15.0 (for NAP V4 deployments), and NAP version 5.7.0 (for NAP V5 deployments), NGINX App Protect WAF includes a new feature named IP Intelligence. This features allows customizing the enforcement based on the source IP of the request to limit access from IP addresses with questionable reputation. Please note that:
- The IP intelligence feature is **disabled** by default and needs to be explicitly enabled and configured in the policy.
- The package `app-protect-ip-intelligence` must be installed (for NAP V4 deployments), or the IP Intelligence image deployed (for NAP V5 deployments), before configuring and using the feature. This package installs the client that downloads and updates the database required for enforcing IP Intelligence.

After installing the package or image, enable the feature in the following two places in the policy:
1. By enabling the corresponding violation in the violation list: `"name": "VIOL_MALICIOUS_IP"` and assigning the appropriate `block` and `alarm` values to the violation.

2. By enabling the featue in the corresponding IP Intelligence JSON section: `"ip-intelligence": {"enabled": true}` and define actions for the IP Intelligence categories listed below.

An example policy where both elements are enabled, and all the IP intelligence categories are configured to `block` and `alarm` can be found here:

```json
{
"policy": {
"name": "ip_intelligency_policy",
"template": {
"name": "POLICY_TEMPLATE_NGINX_BASE"
},
"applicationLanguage": "utf-8",
"caseInsensitive": false,
"enforcementMode": "blocking",
"blocking-settings": {
"violations": [
{
"name": "VIOL_MALICIOUS_IP",
"alarm": true,
"block": true
}
]
},
"ip-intelligence": {
"enabled": true,
"ipIntelligenceCategories": [
{
"category": "Anonymous Proxy",
"alarm": true,
"block": true
},
{
"category": "BotNets",
"alarm": true,
"block": true
},
{
"category": "Cloud-based Services",
"alarm": true,
"block": true
},
{
"category": "Denial of Service",
"alarm": true,
"block": true
},
{
"category": "Infected Sources",
"alarm": true,
"block": true
},
{
"category": "Mobile Threats",
"alarm": true,
"block": true
},
{
"category": "Phishing Proxies",
"alarm": true,
"block": true
},
{
"category": "Scanners",
"alarm": true,
"block": true
},
{
"category": "Spam Sources",
"alarm": true,
"block": true
},
{
"category": "Tor Proxies",
"alarm": true,
"block": true
},
{
"category": "Web Attacks",
"alarm": true,
"block": true
},
{
"category": "Windows Exploits",
"alarm": true,
"block": true
}
]
}
}
}
```

This policy will basically block `"block": true` all IP addresses that are part of any threat category and add a log entry `"alarm": true` for the transaction.

The IP address database is managed by an external provider and is constantly updated (every 1 minute by default). The database also categorizes IP addresses into one or more threat categories. These are the same categories that can be configured individually in the IP intelligence section:
- Anonymous Proxy
- BotNets
- Cloud-based Services
- Denial of Service
- Infected Sources
- Mobile Threats
- Phishing Proxies
- Scanners
- Spam Sources
- Tor Proxies
- Web Attacks
- Windows Exploits

Note that since the IP address database is constantly updated, IP address enforcement is also expected to change. IP Addresses may be added, removed, or moved from one category to another based on the reported activity of the IP address.
67 changes: 67 additions & 0 deletions content/includes/nap-waf/ip-intelligence.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
If the deployment intends to use the IP intelligence Feature (avaiable from version 5.7.0), then the IP intelligence container needs to be added to the deployment in the docker compose file.

Modify the original `docker-compose.yml` file to include the additional IP Intelligence container:

```yaml
services:
waf-enforcer:
container_name: waf-enforcer
image: private-registry.nginx.com/nap/waf-enforcer:5.7.0
environment:
- ENFORCER_PORT=50000
ports:
- "50000:50000"
volumes:
- /opt/app_protect/bd_config:/opt/app_protect/bd_config
- /var/IpRep:/var/IpRep
networks:
- waf_network
restart: always
user: "101:101"
depends_on:
- waf-ip-intelligence

waf-config-mgr:
container_name: waf-config-mgr
image: private-registry.nginx.com/nap/waf-config-mgr:5.7.0
volumes:
- /opt/app_protect/bd_config:/opt/app_protect/bd_config
- /opt/app_protect/config:/opt/app_protect/config
- /etc/app_protect/conf:/etc/app_protect/conf
restart: always
user: "101:101"
network_mode: none
depends_on:
waf-enforcer:
condition: service_started

waf-ip-intelligence:
container_name: waf-ip-intelligence
image: private-registry.nginx.com/nap/waf-ip-intelligence:5.7.0
volumes:
- /var/IpRep:/var/IpRep
networks:
- waf_network
restart: always
user: "101:101"

networks:
waf_network:
driver: bridge
```

Notes:
- Replace `waf-config-mgr`, `waf-enforcer` and `waf-ip-intelligence` tags with the actual release version tag you are deploying. We are using version 5.7.0 for this example deployment.
- By default, the containers `waf-config-mgr`, `waf-enforcer` and `waf-ip-intelligence` operate with the user and group IDs set to 101:101. Ensure that the folders and files are accessible to these IDs.

Before creating the deployment in docker compose, create the required directories:

```shell
sudo mkdir -p /opt/app_protect/config /opt/app_protect/bd_config /var/IpRep
```

Then set correct ownership:

```shell
sudo chown -R 101:101 /opt/app_protect/ /var/IpRep
```
Loading
Loading