Skip to content

fix: improve security for SP's XHR proxy default configuration#489

Merged
pmauduit merged 1 commit intomasterfrom
improve-default-configuration-for-xhr-sp
Mar 31, 2026
Merged

fix: improve security for SP's XHR proxy default configuration#489
pmauduit merged 1 commit intomasterfrom
improve-default-configuration-for-xhr-sp

Conversation

@pmauduit
Copy link
Copy Markdown
Member

Deny requests via the XHR proxy by default.

Tests:

The XHR proxy is already tested in several ways via the testsuite, see: https://github.com/georchestra/security-proxy/blob/main/src/test/java/org/georchestra/security/PermissionsTest.java

But the new configuration suggested in the PR has been tested with the following test case:

    @Test
    public void testDefaultDatadirConfig() throws IOException {
        Permissions perm = this.load("test-permissions-default-datadir.xml");

        assertTrue(perm.isDenied(new URL("http://www.google.fr/test.html")));
        assertTrue(perm.isDenied(new URL("http://127.0.0.1:8080/console/private/internal/users.json")));
        assertTrue(perm.isDenied(new URL("http://console-svc:8080/console/")));
        assertTrue(perm.isDenied(new URL("https://sdi.georchestra.org/console/")));
        assertTrue(perm.isDenied(new URL("https://demo.georchestra.org/geoserver/wms")));
    }

e.g. with a mix of internal IP addresses, internal host names, and external resources.

Deny requests via the XHR proxy by default.

Tests:

The XHR proxy is already tested in several ways via the testsuite, see:
https://github.com/georchestra/security-proxy/blob/main/src/test/java/org/georchestra/security/PermissionsTest.java

But the new configuration suggested in the PR has been tested with the
following test case:

```
    @test
    public void testDefaultDatadirConfig() throws IOException {
        Permissions perm = this.load("test-permissions-default-datadir.xml");

        assertTrue(perm.isDenied(new URL("http://www.google.fr/test.html")));
        assertTrue(perm.isDenied(new URL("http://127.0.0.1:8080/console/private/internal/users.json")));
        assertTrue(perm.isDenied(new URL("http://console-svc:8080/console/")));
        assertTrue(perm.isDenied(new URL("https://sdi.georchestra.org/console/")));
        assertTrue(perm.isDenied(new URL("https://demo.georchestra.org/geoserver/wms")));
    }
```

e.g. with a mix of internal IP addresses, internal host names, and
external resources.
@pmauduit pmauduit requested a review from landryb March 31, 2026 08:07
@pmauduit pmauduit merged commit 9ced0c3 into master Mar 31, 2026
@pmauduit pmauduit deleted the improve-default-configuration-for-xhr-sp branch March 31, 2026 09:01
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.

2 participants