Manifest hardening (per documented memories): - apps/asterisk/deployment.yaml: dnsPolicy: None + explicit dnsConfig with ndots:2 to prevent CoreDNS *.iamworkin.lan template from hijacking external egress (downloads.asterisk.org). - apps/fc-llm-bridge/fc-llm-bridge.yaml: same dnsConfig pattern for api.anthropic.com egress. - apps/fc-ttsreader/fc-ttsreader.yaml: same dnsConfig pattern for huggingface.co model seeding. - apps/fc-messageboard/fc-messageboard.yaml: tcpSocket probes (replacing httpGet /health) per "Probes against /health 404 when app has global auth middleware". - apps/fc-signalcontrol/fc-signalcontrol.yaml: same tcpSocket probe fix. New lint project: - tests/bluejay-infra-lint/BluejayInfraLint.Tests.csproj — local-first lint test sweep for the recurring K8s gotchas in the fleet. - tests/bluejay-infra-lint/FleetManifestLintTests.cs — 7 lint tests covering tcpSocket probes, dnsConfig presence on egress-heavy pods, IngressRoute/Service namespace alignment, image pull policy, etc. - tests/bluejay-infra-lint/conftest.dev/ — matching conftest policies for environments with conftest/opa. - .gitignore — adds bin/ + obj/ + DS_Store/swp. README.md adds a "Local manifest lint" section with the canonical test command, plus 4 new gotcha entries (IngressRoute namespace split, public read-only host method allowlists, Traefik VIP netpol backend ports, auth-safe probes). Tests: 7 / 7 lint tests passed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
24 lines
868 B
Rego
24 lines
868 B
Rego
package bluejayinfra.public_method_allowlist
|
|
|
|
public_hosts := {"dist.flowercore.io", "dns.iamworkin.lan"}
|
|
|
|
deny[msg] {
|
|
input.kind == "IngressRoute"
|
|
route := input.spec.routes[_]
|
|
match := object.get(route, "match", "")
|
|
host := public_hosts[_]
|
|
contains(match, sprintf("Host(`%s`)", [host]))
|
|
not contains(match, "Method(`GET`)")
|
|
msg := sprintf("IngressRoute %s/%s is missing Method(GET) for public read-only host %s", [input.metadata.namespace, input.metadata.name, host])
|
|
}
|
|
|
|
deny[msg] {
|
|
input.kind == "IngressRoute"
|
|
route := input.spec.routes[_]
|
|
match := object.get(route, "match", "")
|
|
host := public_hosts[_]
|
|
contains(match, sprintf("Host(`%s`)", [host]))
|
|
not contains(match, "Method(`HEAD`)")
|
|
msg := sprintf("IngressRoute %s/%s is missing Method(HEAD) for public read-only host %s", [input.metadata.namespace, input.metadata.name, host])
|
|
}
|