Security: DNS pin, Replicate redirects/budget, secret lint, and CI scanning #10
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Close the High/Medium/Low findings in gap analysis §5 (Security). Live collectors, Replicate, Telegram, and the posts API depend on these controls.
Source:
gaps/GAP_1788152435.md§5.Current codebase
Strengths: HTTPS-only indexer helper, exact host match, private/link-local/metadata blocked, punycode rejected, userinfo rejected, explicit ports rejected, open-redirect query keys rejected, no redirects on indexer GET, parameterized SQL, secret-marker fail on artifacts, injection fixtures in
tests/issue_plan.rs.allowlist.rs,fetch_allowlisted_jsonHttpPredictorfollows redirects; indexer client does not.replicate.rsvscollect.rscreate_countincrement before POST; failure may have no prediction id.HttpPredictor::create_oncepollreturns on first HTTP 200 even if status isstarting/processing.HttpPredictor::pollfd,fe80:), not a real IP parser.is_blocked_ip_hostredactunused (fail-closed).secrets.rsis_teamis fixture-attacker-controlled; live must use member API.telegram.rsINDEXER_HOSTSincludesindexer.bridge.cl8y.comwhile docs say that API does not exist.invariants.rscargo-audit/cargo denyin CI..gitlab-ci.ymltracingunused; errors viaeprintln.main.rs0600documented, not implemented (Bot API preferred).SSRF fixture covers
http://169.254.169.254/viassrf_url. No mock live HTTP SSRF after DNS.Why this is needed
Turning on
--live-sources/--livewithout DNS pin and redirect policy is a cloud-metadata SSRF. Budget-before-create and poll-on-starting waste money and emit empty posts. CI has no advisory audit.Constraints / guardrails
.gitleaks.tomlallowlist only for fixtures that are fake.is_teamfix may land in the Telegram issue; this issue should add the test contract and/or shared helper if that issue is separate — do not duplicate conflicting implementations. Prefer one helper used by both.indexer.bridge.cl8y.comfrom allowlist until a real documented API exists (docs/bridge-indexer-gap.md).Relevant files
src/allowlist.rs,src/collect.rs,src/replicate.rs,src/secrets.rs,src/telegram.rs,src/invariants.rs,src/main.rs,.gitlab-ci.yml,README.md,tests/issue_plan.rsRecommended direction
std::net::IpAddr).redirect(Policy::none()); charge after id; poll until terminal (overlap with Replicate issue — implement once, test here as security cases).sk-/ bearer-shaped strings in artifacts; useredactonly for logs, not to wash MDX into publish.gitleaks+cargo audit(and/orcargo denyadvisories).Authorization.Acceptance criteria
127.0.0.1/169.254.169.254→ fetch error, no request body to that IP (or documented connect fail).IpAddr, notstarts_with("fd")only.indexer.bridge.cl8y.comnot inINDEXER_HOSTSuntil gap doc is updated with a real API.cargo audit(network allowed in that job only).AuthorizationorTELEGRAM_BOT_TOKEN.0600either implemented or removed in favor of Bot API.Test plan — functional paths
Test plan — attack, hack, and abuse
::ffff:127.0.0.1).REPLICATE_prefix still fails publish if detector is in scope; if deferred, document leftover risk.AKIA…style string in a test file that is not allowlisted should fail the job (use a CI-only fixture path that is expected to fail in a unit of the gitleaks config test, or a dry-run doc). Prefer: gitleaks on normal fixtures stays green (no real secrets).Verification criteria
marked as related to #4
marked as related to #5
marked as related to #3
mentioned in issue #12