feat: add --hardening-enabled option to limit flux/pkger HTTP requests#27488
Open
devanbenz wants to merge 1 commit into
Open
feat: add --hardening-enabled option to limit flux/pkger HTTP requests#27488devanbenz wants to merge 1 commit into
devanbenz wants to merge 1 commit into
Conversation
davidby-influx
left a comment
Contributor
There was a problem hiding this comment.
Seem okay to me, but I'd like a review by @jdstrand as the gate
There was a problem hiding this comment.
Pull request overview
This PR adds a server-level “hardening” switch that tightens Flux’s outbound HTTP behavior by swapping in a stricter Flux URL validator, helping mitigate SSRF by preventing Flux HTTP requests to private address space while preserving existing behavior by default.
Changes:
- Introduces
FluxDepOption/WithURLValidatorand extendsNewDependencies(..., fluxOpts...)to allow overriding Flux URL validation + HTTP client together. - Wires
hardening-enabledintoinfluxdstartup so Flux dependencies useurl.PrivateIPValidator{}when enabled (otherwiseurl.PassValidator{}). - Adds configuration documentation (sample TOML) and unit tests covering the option plumbing.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| flux/stdlib/influxdata/influxdb/dependencies.go | Adds Flux dependency options and a WithURLValidator helper; applies options during dependency construction. |
| flux/stdlib/influxdata/influxdb/dependencies_test.go | Adds unit tests validating WithURLValidator behavior and NewDependencies option acceptance. |
| etc/config.sample.toml | Documents the new hardening-enabled config option and its effect on Flux HTTP requests. |
| cmd/influxd/run/server.go | Selects URL validator based on HardeningEnabled and passes it into Flux dependency construction. |
| cmd/influxd/run/config.go | Adds HardeningEnabled to the root config and includes it in diagnostics output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
(port of 2c930fd)