Repository navigation
Conversation
877674b to
0404132
Compare
maximthomas
left a comment
There was a problem hiding this comment.
praise: The feature has regression coverage at the decoder, Grizzly transport, and server integration layers.
ProxyProtocolDecoderTestCase: 13 tests passed at HEAD.GrizzlyProxyProtocolTestCase: 6 passed;LDAPProxyProtocolTestCase: 24 passed. All three XML reports show zero failures, errors, and skips on Java 26.
suggestion (non-blocking): The callback-disconnect test does not ensure that the request is coalesced with the PROXY header.
opendj-grizzly/src/test/java/org/forgerock/opendj/grizzly/GrizzlyProxyProtocolTestCase.java:174-178
The header and BIND are sent in separate socket writes. If the server reads only the header, the callback closes the connection and input.hasRemaining() is false, so the assertions can pass even with the post-callback active guard removed from ProxyProtocolFilter.handleRead. This is a static scheduling gap; no mutation survival rate was measured.
Pin: In a follow-up Grizzly filter test, supply one input buffer containing both the header and BIND, make the header callback set the active supplier to false, and assert that the downstream filter is never invoked. Removing the active guard must make that test fail. No change is required in this PR.
issue (non-blocking): send-proxy-v2-ssl alone does not forward the cipher used for SSF evaluation.
opendj-doc-generated-ref/src/main/asciidoc/admin-guide/chap-connection-handlers.adoc:158
HAProxy enables its cipher TLV separately through proxy-v2-options ssl-cipher; see the HAProxy configuration manual and versioned parser. Without that TLV, LDAPServerFilter.getProxySecurityStrengthFactor() returns zero, so SSF requirements can reject the connection when backend TLS/SASL supplies no independent strength. The missing-cipher fallback is correct; the documentation omits the setting needed for its claim.
Document the option pair explicitly:
send-proxy-v2-ssl proxy-v2-options ssl-cipher
Keep the guidance to protect the backend connection. The option pair was checked against upstream documentation/source; no live HAProxy run was performed.
|
@maximthomas Addressed both non-blocking points in 9c4f4ce19e.
Validation on Java 27: all 1,071 Grizzly test invocations and 13 decoder tests passed, with zero failures, errors, or skips. An isolated mutation removing the post-callback |
maximthomas
left a comment
There was a problem hiding this comment.
praise: The new direct-buffer regression test pins callback-triggered suppression of buffered LDAP traffic.
headerCallbackControlsDeliveryOfCoalescedRequestsupplies the header and BIND in one buffer and checks both inactive and active states.- Reviewer execution on Java 26 passed all eight class invocations; removing only the post-callback
activeguard failed the inactive row while the active control passed.
maximthomas
left a comment
There was a problem hiding this comment.
praise: The coalesced-header test checks that the callback stops delivery after a disconnect and still delivers the request on an active connection.
issue (blocking): Return PROXY header buffers to the Grizzly pool.
ProxyProtocolFilter.java:51–74
On a pooled receive buffer, input.duplicate() adds a reference, and the filter drops that reference after copying the prefix. Disposing the original downstream therefore leaves the buffer unavailable for reuse. A header-only read also stops the chain without releasing its original buffer. Copy the prefix without duplicating the Grizzly buffer, and release the input on terminal paths that do not hand it downstream or retain it for the next read.
issue (non-blocking): Run post-connect plugins outside the connection monitor.
LDAPConnectionHandler2.java:1231–1265
finishProxyAdmission() invokes plugins while holding the connection monitor. If the first-request timer expires during a slow callback, the handler's only timer thread enters connectionClosed() and waits for that same monitor. Other first-request deadlines on the handler then wait for the callback to return. Keep the address-slot bookkeeping under the monitor and release it before invoking plugins.
issue (non-blocking): Recheck the TCP peer when completing admission in lockdown mode.
LDAPConnectionHandler2.java:1231–1240
The TCP peer is checked on accept. If lockdown starts while a connection is waiting for its header, the final admission check sees only the forwarded address and can admit a non-loopback TCP peer when the forwarded address is loopback. Recheck both addresses at final admission to enforce the documented loopback requirement. Administration guide
9c4f4ce to
207f6d3
Compare
|
@maximthomas I addressed the three findings in 207f6d31d3. The branch is rebased onto
On Java 27, all 1,073 Grizzly invocations passed with the transport changes. The final revision passed 13 decoder tests, 10 focused Grizzly tests and 70 server integration tests, including two with nginx 1.31.4, with zero failures, errors or skips. |
maximthomas
left a comment
There was a problem hiding this comment.
praise: The pooled-buffer regression checks disposal on terminal reads and verifies the full BIND payload on the active path.
issue (non-blocking): Release pending PROXY read buffers when the connection closes.
ProxyProtocolFilter.java:55–57
An incomplete header transfers its pooled receive buffer to Grizzly’s READ state. A peer close or the first-request timeout runs the separate CLOSE operation and leaves the READ buffer checked out. This forfeits pool reuse and can trigger additional direct-buffer allocations before the original memory is reclaimed. Give pending header data an explicit owner that releases pooled buffers on both completion and close. Grizzly 3.0.1 filter-chain state
suggestion (non-blocking): Require a successful bind in both address-slot reuse checks.
LDAPProxyProtocolTestCase.java:551 and LDAPProxyProtocolTestCase.java:697
Both fixtures enable rejection notices. If cleanup retains the reservation, the next connection hits the per-address limit and receives a Notice of Disconnection, which also starts with BER 0x30. The address assertion can still use the value recorded by the first callback. Use the existing assertSuccessfulBind(next) helper at both sites.
Pin: A replacement with the previous slot still reserved must fail the assertion because the helper requires a successful BindResponse.
issue (non-blocking): Use a reachable local interface for the deferred lockdown test.
LDAPProxyProtocolTestCase.java:137–144
The test uses the first up non-loopback IPv4 interface as both endpoints. On macOS this selected the point-to-point utun4 interface, and the test timed out before enabling lockdown. A standalone local TCP check also timed out in accept() on that interface after connect() returned. The ordinary non-loopback interface passed the same check. Select a non-loopback address with a working local TCP path and skip the case when none is available.
Require successful binds when checking address-slot reuse and select a reachable non-loopback address for the deferred lockdown test.
|
@maximthomas I addressed the three follow-up findings in 625a057f8f.
On Java 27, 13 decoder tests, all 1,074 Grizzly test invocations and 70 server integration tests passed. The server total includes both nginx 1.31.4 tests, which passed separately with Docker API 1.44. |
maximthomas
left a comment
There was a problem hiding this comment.
praise: Both address-slot reuse tests now require a successful LDAP BindResponse.
suggestion (non-blocking): Assert that an incomplete read returns its receive buffer before close.
GrizzlyProxyProtocolTestCase.java:270–272
The probe is read after both READ and CLOSED. A filter that copies an incomplete fragment and holds its receive buffer until close would pass this check while keeping the buffer checked out between reads. Check the count immediately after the synchronous READ and keep the existing check after CLOSED.
Pin: The count is one when the incomplete read returns and remains one after close. An explicit split inside the v2 prefix can also verify one header callback and exact delivery of the trailing BindRequest.
suggestion (non-blocking): Check that close frees the address slot while the plugin is still blocked.
LDAPProxyProtocolTestCase.java:703–707
The test waits for close to finish while the plugin is blocked, then releases the plugin before opening the replacement connection. A change that lets close return and defers slot cleanup to callback completion could still pass the subsequent bind. Assert that the address has no reservation immediately after close.get(...) and before release.countDown(), then keep the successful replacement bind. The existing limit test already reads the handler’s reservation count. LDAPConnectionLimitsTestCase.java:761–771
Pin: The slot count for the forwarded address is zero while the original callback is still blocked.
suggestion (non-blocking): State which OpenDJ image the walkthrough requires.
nginx-proxy-protocol.adoc:28–33
The documentation can publish from master before the release workflow advances the Docker Hub latest tag. At review time that tag points to 5.2.0, whose dsconfig does not have the new PROXY properties, so the handler creation step would fail before the first supporting release. As a documentation follow-up, require an image with LDAP PROXY support and point readers to a branch build until the release image is available. Docker Hub tags, deploy.yml:325–340, release.yml:239–263
suggestion (non-blocking): Refresh the pinned nginx image in a dependency follow-up.
nginx-proxy-protocol.adoc:76, LDAPProxyProtocolNginxTestCase.java:82, LDAPProxyProtocolNginxTestCase.java:202
The walkthrough and integration fixture pin nginx:1.31.4. The official nginx:1.31.9 image retains outbound PROXY v2 support and includes upstream security fixes. Update both pins and the fixture’s version assertion together. NGINX directive documentation, NGINX security advisories, official image manifest
|
@maximthomas I addressed the test and nginx image follow-ups in c01e0afd44.
All 75 focused tests passed on Java 27 with zero failures, errors or skips. This includes both nginx scenarios with |
maximthomas
left a comment
There was a problem hiding this comment.
praise: The Grizzly test now checks the pool count immediately after the incomplete read and again after close.
LDAP clients behind an nginx or HAProxy load balancer currently appear to OpenDJ as the balancer, so address-based access rules, logs and monitoring cannot identify the client. Support PROXY protocol v1 and v2 on LDAP connection handlers to carry the client address and port before LDAP or TLS traffic.
proxy-protocol-allowed-clientlist rejects every connection. Changes to the list apply to new connections.LOCAL,UNKNOWNandUNSPECaddresses. Missing or unrecognized ciphers contribute zero proxy SSF.openidentityplatform/opendj:latestandnginx:latestrelease images. Documentsend-proxy-v2-ssl proxy-v2-options ssl-cipherfor HAProxy TLS termination while retaining backend-connection protection guidance. PingDS-style&{...}configuration expressions are not implemented.CONNECTlogging ordered with disconnect cleanup.Validation
nginx:latest(1.31.9 at validation time) and Docker API 1.44, covering PROXY v1/v2, LDAPS and StartTLS. The preceding revision also passed the full Grizzly suite (1,074 invocations) and 70 server integration tests.git diff --checkpassed.bash -n, and rannginx -ton the example configuration withnginx:latest.Fixes #1126