nesquena-hermes
1a2cf2812c
test(conftest): block AWS IMDS probing + expand credential-strip allowlist
...
Two test-infrastructure fixes surfaced while running the full suite on
this branch. Both prevent accidental outbound network calls from the
pytest process — a class of bug that doesn't show up as test failures
but corrupts timing, leaks credentials, and was responsible for a recent
10× slowdown observation.
## 1. AWS_EC2_METADATA_DISABLED for the whole pytest session
When hermes-agent's bedrock_adapter / botocore credential chain is
imported during tests (e.g. via api/config.py provider-catalog imports),
botocore probes the EC2 Instance Metadata Service at 169.254.169.254
looking for an instance role. On VPS hosts where IMDS is reachable but
rate-limited (HTTP 429) or non-responsive, those probes dominate wall
time — a 161s test run was observed extending to 600+s.
Set `AWS_EC2_METADATA_DISABLED=true` at module load (before any test-file
imports trigger botocore initialisation). This is the documented AWS-
supported way to silence the probe and matches the guard the agent's own
`hermes_cli/doctor.py` already uses inside its parallel-probe block.
Also explicitly re-set the var on the spawned test-server env so it
can't be accidentally cleared by a later `env.update(...)`.
## 2. Expanded credential-strip allowlist
The original strip list covered 6 providers (OpenRouter, OpenAI,
Anthropic, Google, DeepSeek, Xiaomi). Several others leaked through
into the test server subprocess:
- `MEM0_API_KEY`, `XAI_API_KEY`, `MISTRAL_API_KEY`, `OLLAMA_API_KEY`,
`GROQ_API_KEY`, `TOGETHER_API_KEY`, …
- AWS credentials (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`,
`AWS_SESSION_TOKEN`, `AWS_PROFILE`, `AWS_BEARER_TOKEN_BEDROCK`)
- Messaging bot tokens (`TELEGRAM_BOT_TOKEN`, `DISCORD_BOT_TOKEN`,
`SLACK_BOT_TOKEN`, `SIGNAL_API_TOKEN`, `WHATSAPP_API_TOKEN`)
- Memory providers (`HONCHO_API_KEY`, `SUPERMEMORY_API_KEY`)
- Search / browser / image-gen (`FIRECRAWL_API_KEY`, `FAL_KEY`,
`TAVILY_API_KEY`, `SERPER_API_KEY`, `BRAVE_API_KEY`)
- GitHub tokens (`GH_TOKEN`, `GITHUB_TOKEN`)
- Azure OpenAI (`AZURE_OPENAI_API_KEY`, `AZURE_OPENAI_ENDPOINT`)
A real outbound TLS connection to a provider's IPv6 endpoint was
observed during a test run on this host before the strip was expanded.
The test server uses a mock config and has no business making real API
calls.
## Test status
5,151 passed / 11 skipped / 1 xfailed / 2 xpassed / 0 regressions in
139s on Python 3.11. Down from 147s before the fixes (and from
intermittent 10×-slowdowns on IMDS-rate-limited hosts). All API/feature
contracts unchanged.
## Security audit of remaining test-suite host references
Every IP / URL / hostname referenced in `tests/**.py` was classified:
- Loopback (127.0.0.1, localhost, ::1, 0.0.0.0)
- RFC1918 private (10.*, 172.16-31.*, 192.168.*)
- RFC 5737 TEST-NET-3 documentation (203.0.113.*)
- RFC 2606 reserved docs domains (*.example.com, *.example.local,
*.example.test)
- Security-attack input strings used only as parser/validator input
(evil.com, attacker, evil.example.com — never resolved or contacted)
- Real provider/CDN endpoints used only as `base_url` config strings
or CSP-allowlist assertions — never actually fetched
- 8.8.8.8 used only as a "non-loopback example" in `_is_local_from_handler()`
unit tests
No suspicious egress destinations.
2026-05-11 04:49:46 +00:00
..
2026-03-30 20:40:19 -07:00
2026-04-21 02:25:14 +00:00
2026-05-11 04:49:46 +00:00
2026-05-10 18:03:21 +02:00
2026-05-01 17:14:51 +00:00
2026-05-05 02:26:55 +00:00
2026-05-04 18:11:58 +00:00
2026-04-25 21:06:31 -07:00
2026-04-23 12:15:56 -07:00
2026-04-29 19:54:07 -07:00
2026-05-04 21:26:43 +00:00
2026-05-04 00:06:58 -07:00
2026-04-25 15:47:44 -07:00
2026-05-03 01:53:01 +08:00
2026-05-05 12:51:13 +02:00
2026-04-25 17:50:58 -07:00
2026-05-10 10:15:16 -07:00
2026-05-02 02:50:40 +00:00
2026-05-05 08:36:17 -07:00
2026-05-02 00:52:41 +00:00
2026-05-03 01:53:01 +08:00
2026-05-07 01:39:52 +00:00
2026-05-03 20:59:32 +00:00
2026-05-04 10:48:36 -04:00
2026-05-07 16:58:40 +00:00
2026-05-06 14:53:40 +00:00
2026-05-07 05:56:17 +08:00
2026-05-05 22:14:07 +00:00
2026-05-05 16:13:58 +00:00
2026-05-05 16:41:30 +00:00
2026-05-07 01:39:52 +00:00
2026-05-08 15:37:08 +00:00
2026-04-27 11:43:32 -07:00
2026-04-29 04:37:31 +00:00
2026-05-07 16:58:40 +00:00
2026-05-04 00:06:58 -07:00
2026-04-14 19:04:48 +00:00
2026-04-25 17:50:58 -07:00
2026-05-09 18:33:28 +00:00
2026-05-10 18:07:50 +00:00
2026-04-24 01:32:47 +00:00
2026-04-29 19:54:07 -07:00
2026-04-25 23:08:59 -07:00
2026-05-07 17:07:48 +00:00
2026-04-20 20:55:53 -07:00
2026-05-02 19:35:42 +00:00
2026-05-07 18:35:00 +02:00
2026-04-25 14:33:41 -07:00
2026-04-23 09:58:15 -07:00
2026-04-29 19:54:07 -07:00
2026-04-20 23:54:40 +00:00
2026-05-10 17:13:52 +00:00
2026-05-04 00:06:58 -07:00
2026-04-29 04:32:40 +00:00
2026-05-05 01:18:34 +00:00
2026-05-01 04:46:30 +00:00
2026-05-07 02:47:19 +00:00
2026-04-21 22:55:09 -07:00
2026-04-25 21:35:51 -07:00
2026-04-19 05:37:44 +00:00
2026-05-06 19:54:04 +00:00
2026-04-22 20:18:02 +00:00
2026-05-07 01:39:51 +00:00
2026-04-26 21:04:38 -07:00
2026-05-08 13:18:29 +08:00
2026-05-07 04:00:40 +00:00
2026-05-06 18:11:14 +00:00
2026-05-05 01:52:42 +00:00
2026-05-07 06:25:18 +00:00
2026-05-02 02:50:40 +00:00
2026-05-05 01:12:08 +00:00
2026-05-01 18:30:41 +00:00
2026-04-29 04:31:16 +00:00
2026-05-05 01:23:55 +00:00
2026-05-08 16:40:16 +00:00
2026-04-26 21:04:38 -07:00
2026-05-09 19:17:34 +00:00
2026-04-29 16:45:26 +08:00
2026-04-27 16:44:07 -07:00
2026-05-02 02:50:40 +00:00
2026-05-04 00:06:58 -07:00
2026-04-21 23:39:39 -07:00
2026-05-06 22:01:36 +00:00
2026-05-05 01:52:42 +00:00
2026-05-10 15:21:24 +08:00
2026-05-07 18:41:13 +00:00
2026-05-02 04:19:28 +00:00
2026-05-05 22:32:19 +02:00
2026-05-02 22:29:14 +08:00
2026-05-05 01:12:08 +00:00
2026-04-18 06:37:09 +00:00
2026-04-29 04:39:50 +00:00
2026-05-07 14:03:04 -07:00
2026-05-08 20:48:39 +00:00
2026-04-24 11:41:17 -07:00
2026-04-27 22:56:12 -07:00
2026-04-14 21:14:00 +00:00
2026-04-14 21:14:33 +00:00
2026-05-02 02:50:40 +00:00
2026-04-29 04:34:26 +00:00
2026-04-14 21:52:34 +00:00
2026-04-16 00:00:22 +00:00
2026-04-29 04:33:24 +00:00
2026-05-10 18:00:10 +02:00
2026-05-05 01:12:07 +00:00
2026-05-05 01:18:34 +00:00
2026-05-08 20:48:39 +00:00
2026-04-16 20:16:07 -07:00
2026-04-25 15:47:44 -07:00
2026-04-25 14:33:41 -07:00
2026-05-03 22:04:58 +00:00
2026-04-18 06:45:39 +00:00
2026-04-16 18:09:16 -07:00
2026-04-24 09:05:25 -07:00
2026-05-06 18:11:14 +00:00
2026-04-21 15:26:52 -07:00
2026-04-25 13:07:35 -07:00
2026-05-06 06:26:44 +00:00
2026-04-18 06:46:43 +00:00
2026-04-20 23:04:09 +00:00
2026-05-05 02:26:55 +00:00
2026-05-09 02:15:35 +02:00
2026-05-05 17:30:56 +00:00
2026-05-05 01:18:34 +00:00
2026-05-05 01:20:32 +00:00
2026-05-08 16:07:48 +00:00
2026-05-09 02:15:35 +02:00
2026-04-20 22:48:19 +00:00
2026-04-19 23:11:49 -07:00
2026-04-30 16:20:05 +00:00
2026-04-21 00:58:02 +00:00
2026-04-27 16:27:03 -07:00
2026-05-05 00:00:29 -07:00
2026-05-06 22:01:20 +00:00
2026-04-21 23:08:24 -07:00
2026-04-22 20:21:42 +00:00
2026-04-23 09:58:15 -07:00
2026-04-29 04:31:14 +00:00
2026-05-07 05:56:17 +08:00
2026-05-05 19:17:27 -07:00
2026-05-03 01:44:38 +08:00
2026-04-23 11:16:59 -07:00
2026-04-23 10:44:10 -07:00
2026-04-26 18:47:38 -07:00
2026-05-03 16:35:50 +00:00
2026-04-25 13:07:35 -07:00
2026-05-11 07:33:52 +08:00
2026-04-29 17:42:32 -07:00
2026-04-30 15:24:32 +00:00
2026-04-26 15:29:02 -07:00
2026-04-26 14:24:20 -07:00
2026-05-01 19:52:05 +08:00
2026-04-26 10:36:59 -07:00
2026-05-01 18:30:41 +00:00
2026-04-26 15:29:02 -07:00
2026-04-26 15:29:02 -07:00
2026-05-04 00:06:58 -07:00
2026-04-29 19:54:07 -07:00
2026-04-27 13:34:59 -07:00
2026-05-06 08:10:08 +00:00
2026-05-05 08:36:17 -07:00
2026-04-27 15:28:19 -07:00
2026-04-27 18:40:13 -07:00
2026-04-27 18:40:13 -07:00
2026-05-01 05:35:24 +00:00
2026-04-27 22:56:12 -07:00
2026-05-08 15:37:10 +00:00
2026-04-30 15:24:35 +00:00
2026-05-11 07:33:52 +08:00
2026-05-05 01:48:32 +00:00
2026-05-06 06:30:32 +00:00
2026-05-01 04:46:12 +00:00
2026-05-07 23:57:01 +02:00
2026-05-11 02:55:50 +00:00
2026-05-01 05:29:42 +00:00
2026-05-01 17:57:34 +00:00
2026-05-11 07:33:52 +08:00
2026-05-07 01:39:51 +00:00
2026-05-02 00:21:15 +00:00
2026-05-02 01:43:00 +00:00
2026-05-05 08:36:17 -07:00
2026-05-02 04:19:28 +00:00
2026-05-05 08:36:17 -07:00
2026-05-02 04:19:28 +00:00
2026-05-04 15:30:37 -07:00
2026-05-04 04:51:30 +00:00
2026-05-07 04:30:02 +00:00
2026-05-03 01:15:26 +00:00
2026-05-03 03:07:07 +00:00
2026-05-03 03:21:22 +00:00
2026-05-03 02:46:24 +00:00
2026-05-03 06:47:52 +00:00
2026-05-03 17:04:46 +00:00
2026-05-11 07:33:52 +08:00
2026-05-03 18:12:01 +00:00
2026-05-08 16:40:16 +00:00
2026-05-11 07:33:52 +08:00
2026-05-11 07:33:52 +08:00
2026-05-07 02:04:36 +00:00
2026-05-04 05:26:19 +00:00
2026-05-04 16:17:26 +00:00
2026-05-04 16:17:26 +00:00
2026-05-04 16:03:05 +00:00
2026-05-10 10:31:14 -06:00
2026-05-05 08:36:17 -07:00
2026-05-04 16:49:43 +00:00
2026-05-04 16:49:43 +00:00
2026-05-08 15:16:18 +00:00
2026-05-05 08:33:44 -07:00
2026-05-05 02:02:54 +00:00
2026-05-06 18:01:11 +00:00
2026-05-09 02:15:35 +02:00
2026-05-05 08:45:14 -07:00
2026-05-05 08:38:29 -07:00
2026-05-06 16:11:46 +00:00
2026-05-08 20:48:43 +00:00
2026-05-06 09:34:23 -07:00
2026-05-07 01:39:52 +00:00
2026-05-07 03:10:43 +00:00
2026-05-07 06:25:17 +00:00
2026-05-08 13:32:05 +08:00
2026-05-09 10:36:30 -07:00
2026-05-07 16:59:00 +00:00
2026-05-11 02:55:50 +00:00
2026-05-07 21:40:23 +08:00
2026-05-07 18:09:40 +00:00
2026-05-08 15:01:49 +00:00
2026-05-10 20:44:34 +08:00
2026-05-07 21:14:16 +00:00
2026-05-08 15:37:08 +00:00
2026-05-08 19:58:21 +00:00
2026-05-08 15:16:19 +00:00
2026-05-09 14:53:42 +08:00
2026-05-08 16:07:49 +00:00
2026-05-08 15:15:49 +00:00
2026-05-08 16:08:42 +00:00
2026-05-08 16:08:18 +00:00
2026-05-08 20:48:39 +00:00
2026-05-08 20:48:41 +00:00
2026-05-08 16:40:17 +00:00
2026-05-08 21:14:22 -07:00
2026-05-09 20:08:16 +00:00
2026-05-10 14:25:08 +08:00
2026-05-10 15:51:49 -07:00
2026-05-11 07:33:52 +08:00
2026-05-11 07:03:17 +08:00
2026-05-03 22:43:11 -07:00
2026-05-09 15:08:13 +08:00
2026-04-27 17:43:36 -07:00
2026-04-20 22:48:19 +00:00
2026-04-26 21:04:38 -07:00
2026-04-23 14:41:06 -07:00
2026-05-02 02:44:59 +00:00
2026-05-07 17:57:09 +00:00
2026-05-11 04:49:18 +00:00
2026-05-01 22:55:46 +08:00
2026-04-14 17:14:01 +00:00
2026-05-01 04:46:15 +00:00
2026-05-02 04:19:28 +00:00
2026-04-19 06:47:24 +00:00
2026-05-05 01:51:05 +00:00
2026-05-05 01:51:05 +00:00
2026-05-08 20:26:11 +00:00
2026-05-11 02:45:46 +00:00
2026-05-11 02:03:37 +02:00
2026-05-03 19:18:44 +00:00
2026-05-07 04:00:40 +00:00
2026-05-10 19:12:20 +10:00
2026-05-04 17:03:02 +00:00
2026-04-30 23:45:46 -06:00
2026-05-10 10:49:12 -07:00
2026-04-29 04:33:29 +00:00
2026-04-29 17:01:01 +08:00
2026-05-02 17:03:25 +00:00
2026-04-22 22:56:21 -07:00
2026-05-08 21:16:17 +00:00
2026-05-08 20:48:44 +00:00
2026-05-06 09:34:23 -07:00
2026-04-26 21:04:38 -07:00
2026-04-14 19:04:48 +00:00
2026-04-14 19:04:48 +00:00
2026-04-30 16:18:01 +00:00
2026-04-29 17:42:32 -07:00
2026-04-15 16:57:31 +00:00
2026-05-08 21:16:21 +00:00
2026-04-29 17:42:32 -07:00
2026-05-05 01:18:33 +00:00
2026-04-30 10:27:56 -07:00
2026-04-30 16:20:05 +00:00
2026-05-08 16:08:42 +00:00
2026-04-30 18:34:37 +00:00
2026-04-30 18:45:15 +00:00
2026-04-30 14:39:37 -07:00
2026-04-30 22:27:40 +00:00
2026-05-02 12:09:36 +08:00
2026-04-30 23:43:23 +00:00
2026-05-02 02:56:48 +00:00
2026-05-02 03:49:40 +00:00
2026-05-09 18:15:50 +00:00
2026-04-21 19:14:31 -07:00
2026-04-23 02:09:37 +00:00
2026-04-23 02:09:37 +00:00
2026-05-06 06:27:00 +00:00
2026-04-27 22:56:12 -07:00
2026-04-29 17:42:32 -07:00
2026-04-25 23:28:29 -07:00
2026-05-07 17:58:52 +00:00
2026-05-07 02:52:01 +00:00
2026-05-10 12:18:02 -07:00
2026-04-24 10:44:46 -07:00
2026-05-08 23:51:24 +02:00
2026-05-03 22:47:55 -07:00
2026-04-26 21:04:38 -07:00
2026-04-21 16:26:51 +00:00
2026-04-25 19:21:00 -07:00
2026-04-25 21:06:31 -07:00
2026-04-25 21:06:31 -07:00
2026-04-21 15:26:52 -07:00
2026-05-11 02:03:37 +02:00
2026-04-25 21:06:31 -07:00
2026-05-05 08:36:17 -07:00
2026-05-07 16:56:49 +00:00
2026-05-09 16:16:32 +08:00
2026-05-11 02:15:00 +02:00
2026-04-25 17:50:58 -07:00
2026-05-06 18:11:14 +00:00
2026-05-02 02:11:41 +08:00
2026-05-03 18:18:27 -07:00
2026-05-02 23:05:55 +08:00
2026-05-06 14:53:40 +00:00
2026-05-11 02:44:38 +00:00
2026-05-02 17:54:58 +00:00
2026-05-08 21:16:21 +00:00
2026-05-05 22:32:19 +02:00
2026-05-03 16:35:50 +00:00
2026-04-25 13:07:35 -07:00
2026-05-09 10:03:27 +08:00
2026-05-10 17:04:33 +02:00
2026-05-11 08:14:50 +08:00
2026-05-07 16:58:39 +00:00
2026-05-10 23:28:14 +08:00
2026-05-07 02:52:01 +00:00
2026-05-01 04:46:37 +00:00
2026-05-11 02:43:00 +00:00
2026-05-11 02:06:43 +02:00
2026-04-27 13:34:59 -07:00
2026-05-02 10:35:40 +08:00
2026-05-07 05:56:17 +08:00
2026-05-08 01:36:10 +02:00
2026-04-21 22:11:32 -07:00
2026-04-25 17:50:58 -07:00
2026-05-03 20:00:56 +02:00
2026-05-03 05:20:19 +00:00
2026-04-14 19:04:48 +00:00
2026-04-24 09:05:25 -07:00
2026-05-11 04:49:18 +00:00
2026-05-07 16:58:39 +00:00
2026-05-03 07:08:08 +00:00
2026-04-29 21:34:27 -07:00
2026-04-29 17:42:32 -07:00
2026-04-29 17:42:32 -07:00
2026-04-11 20:06:37 -07:00
2026-04-14 19:04:48 +00:00
2026-04-14 19:04:48 +00:00
2026-05-06 08:10:08 +00:00
2026-04-14 19:04:48 +00:00
2026-04-23 02:35:58 +00:00
2026-04-24 09:05:25 -07:00
2026-04-14 19:04:48 +00:00
2026-04-14 19:04:48 +00:00
2026-04-30 16:18:01 +00:00
2026-04-29 21:06:30 -07:00
2026-04-18 06:46:43 +00:00
2026-04-23 10:44:10 -07:00
2026-04-14 19:04:48 +00:00
2026-04-14 19:04:48 +00:00
2026-04-14 19:04:48 +00:00
2026-05-05 08:36:17 -07:00
2026-04-14 19:04:48 +00:00
2026-05-03 18:18:27 -07:00
2026-05-07 04:30:02 +00:00
2026-05-07 04:30:02 +00:00
2026-04-14 19:04:48 +00:00
2026-04-18 06:37:09 +00:00
2026-04-14 19:04:48 +00:00
2026-04-14 19:04:48 +00:00
2026-05-03 20:28:21 +00:00
2026-05-07 16:58:40 +00:00
2026-04-29 04:31:12 +00:00
2026-04-22 20:49:28 +00:00
2026-04-11 12:19:12 -07:00
2026-04-24 09:05:25 -07:00
2026-04-12 10:51:48 -07:00
2026-05-06 22:20:17 +00:00
2026-05-03 06:09:47 +00:00
2026-04-18 06:45:39 +00:00
2026-04-16 10:19:10 -07:00
2026-04-22 16:27:01 +00:00
2026-04-12 14:28:16 -07:00
2026-05-05 12:51:13 +02:00
2026-05-10 16:05:50 +08:00
2026-04-13 11:11:56 -07:00
2026-04-13 23:25:26 -07:00
2026-04-14 19:04:48 +00:00
2026-05-10 16:45:16 +08:00
2026-04-19 05:37:44 +00:00
2026-04-24 11:04:16 -07:00
2026-05-03 20:20:17 -07:00
2026-04-19 23:17:00 -07:00
2026-04-20 23:54:40 +00:00
2026-05-02 17:54:58 +00:00
2026-05-05 02:15:25 +00:00
2026-05-06 08:10:08 +00:00
2026-05-09 18:36:01 +00:00
2026-05-09 18:36:01 +00:00
2026-04-29 21:34:27 -07:00
2026-05-03 21:37:38 +01:00
2026-05-03 20:00:56 +02:00
2026-05-05 01:12:07 +00:00
2026-05-08 16:40:16 +00:00
2026-05-03 11:46:42 +02:00
2026-04-21 18:47:40 -07:00
2026-04-30 15:24:33 +00:00
2026-05-08 20:48:43 +00:00
2026-05-07 20:42:55 +00:00
2026-05-02 02:50:40 +00:00
2026-04-27 13:34:59 -07:00
2026-05-09 02:15:35 +02:00
2026-05-08 23:51:24 +02:00
2026-04-29 04:31:36 +00:00
2026-04-23 09:45:34 -07:00
2026-04-09 18:08:29 -07:00
2026-05-05 13:46:54 -07:00
2026-04-21 00:33:03 +00:00
2026-05-05 13:42:47 -07:00
2026-04-29 17:42:32 -07:00
2026-05-06 06:30:32 +00:00
2026-05-05 03:13:55 -07:00
2026-05-05 08:29:00 -07:00
2026-04-10 10:02:28 -07:00
2026-04-12 00:19:33 -07:00
2026-05-01 06:53:32 +00:00
2026-05-01 16:25:04 +00:00
2026-05-01 17:19:53 +00:00
2026-05-01 18:36:24 +00:00
2026-05-04 00:06:58 -07:00
2026-05-01 22:45:18 +00:00
2026-05-01 23:10:52 +00:00
2026-05-04 23:57:56 +08:00
2026-04-13 22:11:45 -07:00
2026-04-24 11:03:42 -07:00
2026-05-06 17:38:11 +00:00
2026-04-27 17:43:36 -07:00
2026-04-27 21:39:30 -07:00
2026-05-07 06:25:18 +00:00
2026-05-08 16:55:20 +00:00
2026-04-27 18:40:13 -07:00
2026-05-07 16:56:48 +00:00
2026-04-27 17:43:36 -07:00
2026-05-09 09:53:38 +08:00
2026-05-05 16:13:58 +00:00