Layr-Labs / Layr-Labs/d-inference
Low: TLS certificate verification disabled for internal MDM/SCEP/ACME loopback connections
- Dominant language
- Go
- Stars
- 522
- Forks
- 113
- Avg merge
- 17h 26m
- Merged PRs (30d)
- 111
Description
## Summary
The coordinator's Caddyfile disables TLS certificate verification (`tls_insecure_skip_verify`) for three internal reverse proxy routes: ACME (port 9000), SCEP (port 9002), and MDM (port 9002). While these are localhost connections within the same container, disabling verification removes a layer of protection against certificate misconfiguration.
## Evidence
**File:** `coordinator/Caddyfile`
```caddyfile
handle /acme/* {
reverse_proxy https://127.0.0.1:9000 {
transport http {
tls_insecure_skip_verify
}
}
}
handle /scep {
reverse_proxy https://127.0.0.1:9002 {
transport http {
tls_insecure_skip_verify
}
}
}
handle /mdm/* {
reverse_proxy https://127.0.0.1:9002 {
transport http {
tls_insecure_skip_verify
}
}
}
```
The same pattern appears in `coordinator/internal/mdm/mdm.go` where the MDM client skips TLS verification for localhost URLs.
## Impact
- Low practical risk for loopback connections within a single container
- If the container is ever restructured to run services on separate hosts or pods, `tls_insecure_skip_verify` could be carried forward inappropriately
- Masks any certificate misconfiguration in the internal services (step-ca, MicroMDM) that would otherwise surface as errors
## Suggested Fix
1. Use `step-ca`'s root certificate (already present at `EIGENINFERENCE_STEP_CA_ROOT`) to validate internal TLS rather than skipping verification:
```caddyfile
transport http {
tls_trusted_ca_certs /data/step-ca/certs/root_ca.crt
}
```
2. Remove `tls_insecure_skip_verify` from all routes where a known CA cert can be used instead
Contributor guide
Research direction
Read coordinator/Caddyfile and coordinator/internal/mdm/mdm.go to trace the three internal TLS connections and how the step-ca root certificate at EIGENINFERENCE_STEP_CA_ROOT is exposed. Confirm the known CA can be used for these routes and the MDM client, then verify that certificate verification remains enabled without breaking the ACME, SCEP, or MDM connections.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- backend, security
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100