Repository navigation
fix: harden SFTP (API transfer re-check, chart transport and metrics) - #1093
Merged
Merged
Conversation
RevalidateStreams ran only on PostgreSQL panels, so on SQLite an SFTP upload or download kept running after its session was revoked or expired. Wrap SFTP session streams on every driver (browser streams on SQLite are unchanged), and slide the SFTP session on each successful re-check so a long transfer is not cut at the 15-minute lifetime. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
- Local mode sets GAMEPLANE_SFTP_ALLOW_INSECURE_API (pod network only); remote mode refuses an sftp.apiURL that is not https://. - /metrics is off by default; with serviceMonitors.enabled it binds :9102 behind a separate in-cluster gameplane-sftp-metrics Service, a ServiceMonitor and a NetworkPolicy rule for the scrape namespace. - New sftp.maxPreAuthPerIP (default 8). - Docs, threat model and changelog. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 36 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Claude <noreply@anthropic.com>
CI Report - e671f35run 45297307292 - attempt 2 0 failed - 25 passed - 8 skipped - unknown elapsed Test selection: partial - per-suite table Coverageno coverage/* commit statuses found on e671f35 Changed
Slowest jobsno job duration data available e2e buckets run
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gameplane side of the SFTP security review fixes (spec 040). The SFTP server changes are in GameplanePanel/sftp#4. This PR bumps the
sftpsubmodule once that PR merges.API
RevalidateStreamswas mounted only whenstore.Driver == "postgres"(api/cmd/main.go), so on the default SQLite install an SFTP upload or download kept going after its session was revoked or expired. SFTP session streams are now re-checked every 5 s on every driver. New helperauth.SFTPSessionStream; browser streams on SQLite are unchanged.streamRecheck.Chart (
templates/sftp.yaml)GAMEPLANE_SFTP_ALLOW_INSECURE_API=true. The hop ishttp://gameplane-api.<ns>.svcover the pod network, and the API has no in-cluster TLS listener. Remote mode now fails to render unlesssftp.apiURLstarts withhttps://./metrics(no auth) is off unlessserviceMonitors.enabledis set. With it on, the pod binds:9102behind a separate ClusterIPgameplane-sftp-metricsService, a ServiceMonitor, and a NetworkPolicy ingress rule forserviceMonitors.scrapeNamespaceSelector. The publicgameplane-sftpService still carries onlyssh.sftp.maxPreAuthPerIP(default 8).Docs
docs/security.md(threat model),docs/sftp.md,api/specs.md,changelog/unreleased/1093-sftp-security-hardening.md. Not breaking: SFTP has not been released yet (it landed after v0.4.3).Tests
New
api/internal/auth/sftp_stream_hardening_test.go, plus new assertions incharts/gameplane/tests/sftp.sh(case 7 and an http remote-mode render that must fail). No existing assertion was changed. A fresh reviewer that saw only the test diff found no weakened or deleted changes.🤖 Generated with Claude Code