Skip to content

Cockpit: harden remote auth, sessions, CSRF, headers, and rate limits #134

Description

@smota

Background & Problem Statement

Epic: #119

Cockpit has MVP GitHub OAuth/session scaffolding, but it is not production-hardened for internet-facing remote use.

Proposed Solution

Harden the remote service security baseline before public/team exposure.

Requirements

  • Persistent session store or signed/encrypted stateless session strategy.
  • Full CSRF token plumbing for browser forms and guarded actions.
  • Security headers: CSP, frame-ancestors, X-Content-Type-Options, Referrer-Policy, Permissions-Policy.
  • Rate limiting for login, OAuth callback, and write/action endpoints.
  • Secure cookie settings for remote HTTPS deployment.
  • OAuth E2E tests against a test/dummy provider or mocked callback flow.
  • Audit log hardening and rotation/retention guidance.

Acceptance criteria

  • Remote mode fails closed when session secret/OAuth config invalid.
  • CSRF negative tests cover guarded action endpoint.
  • Security headers present on HTML responses.
  • Rate-limit tests cover repeated auth/action requests.
  • Session expiry/logout behavior tested.
  • Docs explain internet-facing hardening.

Test plan

  • Unit/integration tests for sessions, CSRF, headers, rate limits.
  • Manual remote-mode smoke with GitHub OAuth test app.

Workflow classification

High-assurance security hardening. Requires security review and human acceptance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting-releaseManaged by multi-agent-sdlc integration lifecycle automationdrafted-by:piIssue drafted by PifeatureUser-facing product capabilityintegrated:developmentManaged by multi-agent-sdlc integration lifecycle automationproduct:cockpitAgentFlow Cockpit optional Goal Command Centerproduct:harnessHarness adapters, plugins, skills, settings, execution targetsrelease:v1.0.0Assigned to AgentFlow SDLC v1 releasestatus:v1-readyImplemented on development and awaiting v1 releasetoolingCLI tooling and automation

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions