fleet/server/platform/endpointer
Jordan Montgomery 076157c1a6
Add CSP to fleet(currently disabled - needs frontend work) (#41395)
<!-- Add the related story/sub-task/bug number, like Resolves #123, or
remove if NA -->
**Related issue:** Resolves #40538

This is the initial iteration of CSP functionality, currently gated
behind FLEET_SERVER_ENABLE_CSP. If disabled, no CSP is served. Nonces
are still injected into pages however a dummy nonce is used and has no
effect.

With this setting turned on things break and will be addressed by mainly
frontend changes in https://github.com/fleetdm/fleet/issues/41577

# Checklist for submitter

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

- [x] Input data is properly validated, `SELECT *` is avoided, SQL
injection is prevented (using placeholders for values in statements), JS
inline code is prevented especially for url redirects
- [x] If paths of existing endpoints are modified without backwards
compatibility, checked the frontend/CLI for any necessary changes

## Testing

- [x] Added/updated automated tests
- [x] Where appropriate, [automated tests simulate multiple hosts and
test for host
isolation](https://github.com/fleetdm/fleet/blob/main/docs/Contributing/reference/patterns-backend.md#unit-testing)
(updates to one hosts's records do not affect another)

- [x] QA'd all new/changed functionality manually

---------

Co-authored-by: Gabriel Hernandez <ghernandez345@gmail.com>
2026-03-12 18:06:54 -04:00
..
clientip.go Implement trusted proxies config (#38471) 2026-01-19 22:13:37 -06:00
clientip_test.go Implement trusted proxies config (#38471) 2026-01-19 22:13:37 -06:00
endpoint_utils.go Add CSP to fleet(currently disabled - needs frontend work) (#41395) 2026-03-12 18:06:54 -04:00
endpoint_utils_test.go Increase body size limits for osquerylog and osquery/dist/write endpoints (#40946) 2026-03-09 13:49:07 -04:00
extract_alias_rules_test.go Deprecate "team" and "query" API params (#39873) 2026-02-19 13:53:32 -06:00
json_key_duplicator.go Deprecate "team" and "query" API params (#39873) 2026-02-19 13:53:32 -06:00
json_key_duplicator_test.go Deprecate "team" and "query" API params (#39873) 2026-02-19 13:53:32 -06:00
json_key_rewriter.go Add more deprecation logs and mute by default (#40305) 2026-02-23 23:09:08 -06:00
json_key_rewriter_test.go Deprecate "team" and "query" API params (#39873) 2026-02-19 13:53:32 -06:00
transport_error.go Fixed client-side errors being incorrectly reported as server errors in OTEL telemetry (#40051) 2026-02-19 16:06:00 -06:00
transport_error_test.go Fixed client-side errors being incorrectly reported as server errors in OTEL telemetry (#40051) 2026-02-19 16:06:00 -06:00