Skip to content

feat(geoblocking): geo ip management in threat shield ip#1714

Merged
Tbaile merged 4 commits into
mainfrom
banip_geoblocking
Jun 12, 2026
Merged

feat(geoblocking): geo ip management in threat shield ip#1714
Tbaile merged 4 commits into
mainfrom
banip_geoblocking

Conversation

@m-dilorenzi

Copy link
Copy Markdown
Collaborator

This PR contains the implementation of the Geo IP blocking feature in the Threat Shield IP firewall section.
Using this feature allows users to block inbound and outbound connections from specific countries.
Two new APIs, geoblocking-configuration and set-geoblocking-configuration, have been implemented to allow the UI to retrieve and update the current BanIP configuration for blocked countries.
Each country is categorized using a JSON map that assigns it to the corresponding region (Africa, Oceania, Europe, etc.), which is then shown in the UI.
The geoblocking-configuration API returns the state of the Geo IP service (enabled/disabled) and the list of selectable countries, divided by region and indicating whether each one is blocked.
The set-geoblocking-configuration API receives the Geo IP service state (enabled/disabled) and the list of blocked countries.
When the service configuration is modified, the backup files /tmp/banIP-backup/banIP.countryv4.gz and /tmp/banIP-backup/banIP.countryv6.gz are deleted if present. This is necessary because, when the list of blocked countries is changed, banIP uses the IP lists stored in these two backup files, which may contain more or fewer IP addresses than desired.

Closes: #1586

@m-dilorenzi m-dilorenzi requested a review from Tbaile June 5, 2026 15:18
@m-dilorenzi m-dilorenzi self-assigned this Jun 5, 2026
Comment thread packages/ns-api/files/ns.threatshield Outdated
Comment thread packages/ns-api/files/ns.threatshield Outdated
Comment thread packages/ns-api/files/ns.threatshield Outdated
Comment thread packages/ns-api/files/ns.threatshield Outdated
Base automatically changed from nethsecurity-8.8 to main June 8, 2026 13:29
@m-dilorenzi m-dilorenzi requested a review from Tbaile June 9, 2026 09:58

@Tbaile Tbaile left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor leftover, otherwise we good for the backend

Comment thread packages/ns-api/files/ns.threatshield Outdated
@m-dilorenzi m-dilorenzi requested a review from Tbaile June 11, 2026 10:57
@Tbaile Tbaile merged commit d697100 into main Jun 12, 2026
3 checks passed
@Tbaile Tbaile deleted the banip_geoblocking branch June 12, 2026 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

UI support for Geo IP management in Threat Shield IP

2 participants