Skip to content

Conversation

@Wikid82
Copy link
Owner

@Wikid82 Wikid82 commented Dec 21, 2025

Summary

Implements additional security enhancements as outlined in Issue #365.

Note: This PR targets main for direct release. A parallel PR exists targeting development for staged rollout.

Security Threats Addressed

High Priority

  • Supply Chain Attacks - SBOM generation, enhanced Trivy scanning
  • Timing Attacks - Constant-time comparison for tokens
  • Session Hijacking - CSP headers implementation

Medium Priority

  • Privilege Escalation - Container hardening documentation
  • DNS Hijacking - DoH/DoT deployment guide

Documentation Updates

  • TLS minimum version documentation in security.md
  • Least-privilege container execution guide
  • Security Incident Response Plan (SIRP)

Future Considerations (Out of Scope)

  • CT log monitoring (separate issue)
  • MFA via Authentik integration (separate issue)
  • SSO for Charon admin (separate issue)
  • Audit logging for compliance (separate issue)

Related Issues

Closes #365

Checklist

  • Backend tests pass with 85%+ coverage
  • Frontend tests pass with 85%+ coverage
  • Pre-commit hooks pass
  • Security scans pass (CodeQL, Trivy)
  • Documentation updated

Wikid82 and others added 12 commits December 21, 2025 10:21
feat: add API-Friendly security header preset for mobile apps
- Add constant-time token comparison utility (crypto/subtle)
- Add SBOM generation and attestation to CI/CD pipeline
- Document TLS enforcement, DNS security (DoH/DoT), and container hardening
- Create Security Incident Response Plan (SIRP)
- Add security update notification documentation

Security enhancements:
- Mitigates timing attacks on invite token validation
- Provides supply chain transparency with CycloneDX SBOM
- Documents production container hardening (read_only, cap_drop)

Closes #365
…urity

docs: add planning document for Issue #365 Additional Security
@Wikid82 Wikid82 marked this pull request as ready for review December 23, 2025 06:04
Copilot AI review requested due to automatic review settings December 23, 2025 06:04
@Wikid82 Wikid82 marked this pull request as draft December 23, 2025 06:07
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements additional security enhancements for Issue #365, addressing timing attacks, supply chain security, and improving security documentation. The changes focus on defense-in-depth measures including constant-time token comparison, SBOM generation for supply chain transparency, and comprehensive security documentation covering TLS, DNS, container hardening, and incident response procedures.

Key Changes

  • Timing Attack Mitigation: Added constant-time comparison utility for sensitive token validation
  • Supply Chain Security: Implemented SBOM generation and attestation in CI/CD pipeline
  • Documentation: Added TLS/DNS security sections, container hardening guide, and complete Security Incident Response Plan

Reviewed changes

Copilot reviewed 20 out of 23 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
frontend/package.json Minor dependency updates (react-hook-form 7.68.0→7.69.0, knip 5.75.1→5.76.2)
frontend/package-lock.json Lockfile updates corresponding to package.json changes
backend/internal/util/crypto.go New constant-time comparison utilities using crypto/subtle
backend/internal/util/crypto_test.go Comprehensive tests and benchmarks for crypto utilities
backend/internal/api/handlers/user_handler.go Applied constant-time token comparison in AcceptInvite endpoint
docs/security.md Added TLS enforcement, DNS security, and container hardening sections
docs/security-incident-response.md New comprehensive SIRP document with incident classification and procedures
docs/getting-started.md Added security update notification guidance (Watchtower, Diun, GitHub Watch)
docs/reports/qa_report.md Updated QA report for Issue #365 with test results and coverage metrics
docs/plans/issue-365-additional-security.md Planning document outlining security enhancement phases
docs/plans/current_spec.md Implementation specification with detailed analysis
docs/issues/issue-365-manual-test-plan.md Manual testing procedures for security enhancements
.github/workflows/docker-build.yml Added SBOM generation and attestation steps with required permissions
.github/workflows/waf-integration.yml Updated docker/setup-buildx-action to v3.12.0
.github/workflows/security-weekly-rebuild.yml Updated docker/setup-buildx-action to v3.12.0
.github/workflows/docs-to-issues.yml Changed dry_run default from string 'false' to boolean false
.github/agents/QA_Security.agent.md Updated testing instructions and severity requirements
.github/agents/Manegment.agent.md Added manual testing plan creation to closure phase
.gitignore Added sbom*.json to ignored files
.dockerignore Added sbom*.json to ignored files
Files not reviewed (1)
  • frontend/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI commented Dec 23, 2025

@Wikid82 I've opened a new pull request, #448, to work on those changes. Once the pull request is ready, I'll request review from you.

@Wikid82 Wikid82 marked this pull request as ready for review December 23, 2025 06:57
@Wikid82 Wikid82 marked this pull request as draft December 23, 2025 06:57
@Wikid82 Wikid82 marked this pull request as ready for review December 23, 2025 07:36
@Wikid82 Wikid82 marked this pull request as draft December 23, 2025 07:36
@Wikid82 Wikid82 added this to Charon Dec 24, 2025
@github-project-automation github-project-automation bot moved this to Backlog in Charon Dec 24, 2025
@Wikid82 Wikid82 added the security Security-related label Dec 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security Security-related

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Additional_Security

3 participants