fleet/tools
Lucas Manuel Rodriguez d67fd73611
New rate limit algorithm for Fleet Desktop endpoints (#33344)
Resolves #31890

This new approach allows up to 1000 consecutive failing requests per
minute.
If the threshold of 1000 consecutive failures is reached for an IP, then
we ban request (return 429) from such IP for a duration of 1 minute.
(Any successful request for an IP clears the count.)

This supports the scenario where all hosts are behind a NAT (same IP)
AND still provides protection against brute force attacks (attackers can
only probe 1k requests per minute).

This approach was discussed in Slack with @rfairburn:
https://fleetdm.slack.com/archives/C051QJU3D0V/p1755625131298319?thread_ts=1755101701.844249&cid=C051QJU3D0V.

- [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] 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

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

## Summary by CodeRabbit

- New Features
- Introduced IP-based rate limiting for Fleet Desktop endpoints to
better support many hosts behind a single public IP (NAT). Requests from
abusive IPs may be temporarily blocked, returning 429 Too Many Requests
with a retry-after hint.
- Documentation
- Added README for a new desktop rate-limit tester, describing usage and
expected behavior.
- Tests
- Added integration tests covering desktop endpoint rate limiting and
Redis-backed banning logic.
- Chores
- Added a command-line tool to stress-test desktop endpoints and verify
rate limiting behavior.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2025-09-26 15:03:50 -03:00
..
android Hook up Android fleetdm.com/proxy (#29645) 2025-06-12 19:42:15 -05:00
api Update small utility (#31026) 2025-07-23 12:07:43 -06:00
apm-elastic Organize contributor docs and establish ADR process and template (#29101) 2025-05-17 15:03:52 -05:00
app Remove unused FLEET_TEST_PAGE_PATH test code (#32962) 2025-09-14 12:32:24 -05:00
app-sso-platform Add app_sso_platform table to orbit and use table in Entra ID query ingestion (#30140) 2025-06-20 17:01:38 -03:00
backup_db Add script that backs up and restores DB when switching branches (#31197) 2025-08-06 13:34:51 -04:00
bomutils-docker Pin debian version to bookworm for fleetdm/fleetctl (#31828) 2025-08-13 12:52:27 -05:00
bump-migration Implement a tool to automate bumping a DB migration's timestamp (#30513) 2025-07-02 11:41:54 -04:00
calendar Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
ci Merge Android datastore into main Fleet datastore (#32233) 2025-08-25 11:41:28 -04:00
cis Script for comparing two CIS PDF files (#15307) 2023-12-06 09:21:12 -05:00
cloner-check Feature branch for Android config profiles (#32976) 2025-09-22 11:29:57 -04:00
custom-package-parser Improve .pkg metadata extraction for names and bundle IDs, let custom package metadata extraction tool check an entire directory at a time (#29249) 2025-05-19 10:32:36 -05:00
dbutils Merge Android datastore into main Fleet datastore (#32233) 2025-08-25 11:41:28 -04:00
desktop Move external dependency fleetdm/kolide-kit to monorepo (#15861) 2024-01-02 18:22:52 -03:00
desktop-rate-limit New rate limit algorithm for Fleet Desktop endpoints (#33344) 2025-09-26 15:03:50 -03:00
dialog Removed indicator for background LUKS validation (#28218) 2025-04-16 12:25:41 -04:00
fdm FDM updates: fdm serve, snapshot/restore improvements (#27890) 2025-04-07 09:10:15 -05:00
file-server Switching systray dependency to one without glibc requirements (#14197) 2023-11-02 14:40:21 -05:00
fleet-docker Update alpine to patch vulnerability with severity "HIGH" (#26593) 2025-02-25 18:33:24 -03:00
fleetctl-docker Pin debian version to bookworm for fleetdm/fleetctl (#31828) 2025-08-13 12:52:27 -05:00
fleetctl-npm Adding changes for Fleet v4.73.2 (#33118) 2025-09-24 08:02:17 -05:00
fleetd-linux Added fleetd docker images to test/develop linux fleetd features (#25027) 2024-12-27 16:16:39 -03:00
github-manage Adding direction to add views and workflows (#33177) 2025-09-25 14:05:39 -05:00
github-releases Iterate status.md for reporting vulnerability updates (#29062) 2025-05-15 21:15:37 -03:00
inspect-cert chore: remove refs to deprecated io/ioutil (#14485) 2023-10-27 15:28:54 -03:00
jira-integration Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
kubequery Move kubequery dependency to monorepo (#16027) 2024-01-11 08:30:26 -03:00
loadtest Prevent IT admins from deleting a secret variable in use (#32161) 2025-08-22 11:22:37 -03:00
luks add kdialog for kubuntu key escrow (#24405) 2024-12-05 08:44:16 -07:00
mailpit Fix SMTP e-mail send when SMTP server has credentials (#10758) 2023-03-28 15:23:15 -03:00
makefile-support Add help system to Makefile + FDM command (#25028) 2025-02-28 07:42:32 -06:00
mdm Update golangci-lint to v2.4.0 (#33251) 2025-09-22 13:17:11 -05:00
msal Microsoft Compliance Partner backend changes (#29540) 2025-06-11 14:22:46 -03:00
mysql-replica-testing MySQL 8.0 Migration (#20225) 2024-07-22 16:27:36 -04:00
mysql-tests/rds Feat 1817 add iam auth to mysql and redis (#32488) 2025-09-04 10:08:47 -05:00
nvd/nvdvuln Switch vulns cron false positive clear to clear vulns based on when the vulns run started, rather than based on periodicity (#31364) 2025-07-29 10:14:14 -05:00
oncall Updated oncall.sh to filter our draft PRs. (#28204) 2025-04-15 10:44:26 -05:00
osquery Remove unneeded exposed ports on osquery-in-a-box minio to avoid host-port conflicts (#30416) 2025-06-29 12:40:17 -05:00
osquery-agent-options Update golangci-lint to v2.4.0 (#33251) 2025-09-22 13:17:11 -05:00
osquery-testing 15135 remove atom package (#15410) 2023-12-04 14:26:26 -05:00
percona/test MySQL 8.0 Migration (#20225) 2024-07-22 16:27:36 -04:00
redis-stress Add redis stress (#3363) 2022-01-20 16:18:17 -03:00
redis-tests Feat 1817 add iam auth to mysql and redis (#32488) 2025-09-04 10:08:47 -05:00
release Add workflow to publish go modules (#33335) 2025-09-23 12:03:37 -03:00
run-scripts Implement script execution on the fleetd agent (disabled by default) (#13569) 2023-08-30 14:02:44 -04:00
saml Replace home-made SAML implementation with https://github.com/crewjam/saml (#28486) 2025-07-07 15:13:46 -03:00
seed_data/queries New tool: software package uploader (#30417) 2025-07-01 10:35:56 -06:00
sentry-self-hosted Fix stack trace of captured errors in Sentry, capture errors in more code paths (#16966) 2024-02-22 15:10:28 -03:00
sign-fleetctl Specify binary-identifier when signing fleetctl for macOS (#30374) 2025-07-01 10:38:15 -04:00
smtp4dev 14729 smtp settings validation for TLS (#15029) 2023-11-21 11:48:21 -07:00
snapshot Updated go to 1.25.1 (#32833) 2025-09-11 18:31:39 -05:00
software Support auto-install in package uploader tool (#31117) 2025-07-22 06:36:41 -06:00
team-builder Add team builder script (#10086) 2023-05-03 09:55:14 -07:00
telemetry Scope pending host profile rebuilds (#23772) 2024-11-15 11:55:30 -05:00
terraform Updated go to 1.25.1 (#32833) 2025-09-11 18:31:39 -05:00
test-certs Add fake certificates for testing TLS issues (#20390) 2024-07-16 13:21:39 -03:00
test-orbit-mtls Fixing SSL certificates to make them valid. (#16359) 2024-01-31 12:00:59 -06:00
test_extensions/hello_world Add arm64 support for fleetd extensions and fixes on test scripts (#31084) 2025-07-21 15:47:59 -03:00
testdata Add fixtures for software and vulnerabilities end-to-end tests (#6337) 2022-06-23 10:01:37 -05:00
tuf Add govet's nilness and golangci-lint nilnesserr (#33359) 2025-09-23 17:55:50 -03:00
vex-parser Iterate status.md for reporting vulnerability updates (#29062) 2025-05-15 21:15:37 -03:00
webhook Additional changes to happy path and cleanup cron job (#17757) 2024-03-26 13:39:37 -05:00
windows-mdm-enroll Implement Windows MDM programmatic unenrollment (notification + orbit trigger) (#12505) 2023-06-28 09:13:37 -04:00
wix-docker Pin debian version to bookworm for fleetdm/fleetctl (#31828) 2025-08-13 12:52:27 -05:00
zendesk-integration Updating golangci-lint to 1.61.0 (#22973) 2024-10-18 12:38:26 -05:00
branch_snapshot.sh Add script that backs up and restores DB when switching branches (#31197) 2025-08-06 13:34:51 -04:00