fleet/server
Scott Gress 393531b624
Implement trusted proxies config (#38471)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #

# Details

Adds a new `FLEET_SERVER_TRUSTED_PROXIES` config, allowing more
fine-grained control over how the client IP is determined for requests.
Uses the
[realclientip-go](https://github.com/realclientip/realclientip-go)
library as the engine for parsing headers and using rules to determine
the IP.

# Checklist for submitter

If some of the following don't apply, delete the relevant line.

- [X] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
See [Changes
files](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/guides/committing-changes.md#changes-files)
for more information.

## Testing

- [X] Added/updated automated tests
- [X] QA'd all new/changed functionality manually



<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **New Features**
* Introduced FLEET_SERVER_TRUSTED_PROXIES configuration option to
specify trusted proxy IPs and hosts. The server now supports flexible
client IP detection strategies that respect your proxy configuration,
with support for multiple formats including single IP header names, hop
counts, and IP address ranges, adapting to various infrastructure setups
and deployment scenarios.

<sub>✏️ Tip: You can customize this high-level summary in your review
settings.</sub>

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-01-19 22:13:37 -06:00
..
acl/activityacl Activity bounded context: /api/latest/fleet/activities (1 of 2) (#38115) 2026-01-19 09:07:14 -05:00
activity Activity bounded context: /api/latest/fleet/activities (1 of 2) (#38115) 2026-01-19 09:07:14 -05:00
archtest Refactor endpoint_utils for modularization (#36484) 2025-12-31 09:12:00 -06:00
authz Activity bounded context: /api/latest/fleet/activities (1 of 2) (#38115) 2026-01-19 09:07:14 -05:00
aws_common Feat 1817 add iam auth to mysql and redis (#32488) 2025-09-04 10:08:47 -05:00
bindata
config Implement trusted proxies config (#38471) 2026-01-19 22:13:37 -06:00
contexts Bump installer max size, make configurable (#38122) 2026-01-19 13:36:01 -06:00
cron Add SCEP endpoint for host identity. (#30589) 2025-07-11 11:44:07 -03:00
datastore Ability to set fleet desktop alternative browser host in org settings (#38409) 2026-01-19 16:25:22 -04:00
errorstore Fixed potential panic in error handler when Redis is down. (#31643) 2025-08-06 17:14:31 +02:00
fleet Ability to set fleet desktop alternative browser host in org settings (#38409) 2026-01-19 16:25:22 -04:00
goose Use UTC timestamps for DB migrations (#36228) 2025-11-24 15:49:10 -06:00
health 🧹 friday cleanup party: substitute deprecated import of go-kit (#19774) 2024-06-17 10:27:31 -03:00
launcher Add missing platform_like during orbit enrollment (#32671) 2025-09-05 16:05:19 -03:00
live_query Fix lingering live queries keys in Redis (#33928) 2025-10-08 06:36:38 -03:00
logging Fix nats_test.go flaky tests (#37976) 2026-01-07 14:08:42 -03:00
mail [Bug fix] Unclear error message: Update users email via API (#36579) 2025-12-02 10:52:31 -06:00
mdm handle non atomic windows profiles when sending and receiving (#38332) 2026-01-19 11:16:28 -05:00
mock Delete Fleet users when deleted from IdP: Server changes for SCIM handling of deletion (#38321) 2026-01-19 11:35:42 -03:00
platform Implement trusted proxies config (#38471) 2026-01-19 22:13:37 -06:00
policies Use lighter Team call when it's obviously safe to do so, comment potential areas for further improvement (#35587) 2025-11-17 17:25:45 -06:00
ptr Clean up android app config data layer, fix no-team persist bug (#37740) 2025-12-30 09:35:41 -06:00
pubsub Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
service Implement trusted proxies config (#38471) 2026-01-19 22:13:37 -06:00
shellquote Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
sso End-user authentication for Window/Linux setup experience: backend (#34835) 2025-10-31 11:16:42 -05:00
test Automatic retry of failed policy automations of scripts and software installs (#38018) 2026-01-12 17:30:51 -06:00
variables DCSW: Support all IDP variables in Windows config profiles (#34707) 2025-10-24 10:10:58 -03:00
version
vulnerabilities Fix CI: extend grace periods for MSRC feeds and expand test coverage for file validation. (#37991) 2026-01-07 10:28:20 -06:00
webhooks Use lighter Team call when it's obviously safe to do so, comment potential areas for further improvement (#35587) 2025-11-17 17:25:45 -06:00
websocket
worker Point to com.fleetdm.agent Android agent by default. (#37770) 2026-01-06 18:11:23 -06:00
utils.go Fix CleanupExpiredHosts to prevent deletion of DEP-assigned hosts (#28313) 2025-04-18 12:49:03 -05:00
utils_test.go