Commit Graph

136 Commits

Author SHA1 Message Date
GitHub Actions
8f7b4b9aaa refactor: Update QA report to reflect Optional Features implementation
docs: Modify security documentation to indicate Cerberus is enabled by default

test: Adjust frontend feature flag tests to align with new Cerberus flag

feat: Integrate feature flags into Layout component for conditional rendering

test: Enhance Layout component tests for feature flag visibility

feat: Implement Optional Features section in System Settings page

test: Add tests for Optional Features toggles in System Settings

fix: Remove unused Cerberus state from System Settings component
2025-12-07 03:35:28 +00:00
GitHub Actions
2c1cf5f0ac feat: Implement SSL Provider selection feature with tests and documentation
- Added functionality to select SSL Provider (Auto, Let's Encrypt, ZeroSSL) in the Caddy Manager.
- Updated the ApplyConfig method to handle different SSL provider settings and staging flags.
- Created unit tests for various SSL provider scenarios, ensuring correct behavior and backward compatibility.
- Enhanced frontend System Settings page to include SSL Provider dropdown with appropriate options and descriptions.
- Updated documentation to reflect new SSL Provider feature and its usage.
- Added QA report detailing testing outcomes and security verification for the SSL Provider implementation.
2025-12-06 20:59:34 +00:00
GitHub Actions
7624f6fad8 Add QA testing reports for certificate page authentication fixes
- Created detailed QA testing report documenting the authentication issues with certificate endpoints, including test results and root cause analysis.
- Added final QA report confirming successful resolution of the authentication issue, with all tests passing and security verifications completed.
- Included test output logs before and after the fix to illustrate the changes in endpoint behavior.
- Documented the necessary code changes made to the route registration in `routes.go` to ensure proper application of authentication middleware.
2025-12-06 19:34:51 +00:00
GitHub Actions
8e2ba14ae5 feat: add certificate management security and cleanup dialog
- Documented certificate management security features in security.md, including backup and recovery processes.
- Implemented CertificateCleanupDialog component for confirming deletion of orphaned certificates when deleting proxy hosts.
- Enhanced ProxyHosts page to check for orphaned certificates and prompt users accordingly during deletion.
- Added tests for certificate cleanup prompts and behaviors in ProxyHosts, ensuring correct handling of unique, shared, and production certificates.
2025-12-06 01:43:46 +00:00
GitHub Actions
09320a74ed feat: implement bulk ACL application feature for efficient access list management across multiple proxy hosts
feat: add modular Security Dashboard implementation plan with environment-driven security service activation
fix: update go.mod and go.sum for dependency version upgrades and optimizations
feat: enable gzip compression for API responses to reduce payload size
fix: optimize SQLite connection settings for better performance and concurrency
refactor: enhance RequireAuth component with consistent loading overlay
feat: configure global query client with optimized defaults for performance in main.tsx
refactor: replace health check useEffect with React Query for improved caching and auto-refresh
build: add code splitting in vite.config.ts for better caching and parallel loading
2025-12-05 18:45:18 +00:00
GitHub Actions
72ff6313de Implement CrowdSec integration with API endpoints for managing IP bans and decisions
- Added unit tests for CrowdSec handler, including listing, banning, and unbanning IPs.
- Implemented mock command executor for testing command execution.
- Created tests for various scenarios including successful operations, error handling, and invalid inputs.
- Developed CrowdSec configuration tests to ensure proper handler setup and JSON output.
- Documented security features and identified gaps in CrowdSec, WAF, and Rate Limiting implementations.
- Established acceptance criteria for feature completeness and outlined implementation phases for future work.
2025-12-05 17:23:26 +00:00
GitHub Actions
11357a1a15 feat: implement uptime monitor synchronization for proxy host updates and enhance related tests 2025-12-05 16:29:51 +00:00
GitHub Actions
fc263e7afb fix(tests): eliminate race condition in TestCertificateHandler_Delete_NoBackupService
The test was failing intermittently when run with -race flag due to a race
condition between:
1. CertificateService constructor spawning a background goroutine that
   immediately queries the database
2. The test's HTTP request handler also querying the database

On CI runners, the timing window is wider than on local machines, causing
frequent failures. Solution: Add a 200ms sleep to allow the background
goroutine to complete its initial sync before the test proceeds.

This is acceptable in test code as it mirrors real-world usage where the
service initializes before receiving HTTP requests.

Fixes intermittent failure:
  Error: Not equal: expected: 200, actual: 500
  no such table: ssl_certificates
2025-12-05 05:35:24 +00:00
GitHub Actions
1143a372fa fix: restore /setup API routes removed in user management commit
The commit c06c282 (feat: add SMTP settings page and user management
features) removed userHandler.RegisterRoutes(api) and manually
registered only some of the routes, missing the critical /setup
endpoints.

This restores GET /api/v1/setup and POST /api/v1/setup which are
required for initial admin setup flow.
2025-12-05 04:27:43 +00:00
GitHub Actions
0453924fe7 fix: resolve CI test failures
- Remove SQLite cache=shared from certificate handler tests to prevent
  database locking issues in parallel test runs
- Add JSON validation before jq parsing in integration-test.sh to
  provide clear error messages when setup endpoint returns invalid response
- Remove unused fmt import from certificate_handler_coverage_test.go
2025-12-05 04:08:08 +00:00
GitHub Actions
562bb012fb feat: Enhance Dockerfile for Caddy with security patches and automate dependency management
- Added custom manager in renovate.json to track Go dependencies patched in Dockerfile for Caddy CVE fixes.
- Updated Dockerfile to pre-fetch and override vulnerable module versions for dependencies (expr, quic-go, smallstep/certificates) during the build process.
- Improved build resilience by implementing a fallback mechanism for Caddy versioning.
- Introduced tests for user SMTP audit, covering invite token security, input validation, authorization, and SMTP config security.
- Enhanced user invite functionality with duplicate email protection and case-insensitive checks.
- Updated go.work.sum to include new dependencies and ensure compatibility.
2025-12-05 02:15:43 +00:00
GitHub Actions
c06c2829a6 feat: add SMTP settings page and user management features
- Added a new SMTP settings page with functionality to configure SMTP settings, test connections, and send test emails.
- Implemented user management page to list users, invite new users, and manage user permissions.
- Created modals for inviting users and editing user permissions.
- Added tests for the new SMTP settings and user management functionalities.
- Updated navigation to include links to the new SMTP settings and user management pages.
2025-12-05 00:47:57 +00:00
GitHub Actions
cecf0ef9d6 ci: run perf asserts in CI (backend quality & benchmark jobs) 2025-12-04 20:58:18 +00:00
GitHub Actions
fa41fda360 feat: add comprehensive security audit tests for SQL injection, input validation, and settings persistence 2025-12-04 20:27:13 +00:00
GitHub Actions
4b056c1133 feat: implement runtime overrides for security settings and add comprehensive tests 2025-12-04 19:52:57 +00:00
GitHub Actions
197e2bf672 Add comprehensive tests for security and user handlers, enhancing coverage
- Introduced tests for the security handler, covering UpdateConfig, GetConfig, ListDecisions, CreateDecision, UpsertRuleSet, DeleteRuleSet, Enable, and Disable functionalities.
- Added tests for user handler methods including GetSetupStatus, Setup, RegenerateAPIKey, GetProfile, and UpdateProfile, ensuring robust error handling and validation.
- Implemented path traversal and injection tests in the WAF configuration to prevent security vulnerabilities.
- Updated the manager to sanitize ruleset names by stripping potentially harmful characters and patterns.
2025-12-04 17:54:17 +00:00
GitHub Actions
80934670e1 fix: trigger Caddy reload when security config changes
- Add ApplyConfig call in UpdateConfig handler after saving to DB
- This ensures WAF mode changes (block/monitor) regenerate rulesets
- Add nil guard for caddyManager in tests
2025-12-03 23:49:58 +00:00
GitHub Actions
58d570ee1d fix: update WAF handler tests for directives format and fix hash calculation
- Change test assertions from checking 'include' array to 'directives' string
- Fix advanced_config array case to use 'directives' instead of 'include'
- Calculate ruleset hash from final content (after SecRuleEngine prepend)
- Update filename pattern matching in tests for hashed filenames
- Ensures WAF mode changes result in different ruleset filenames
2025-12-03 23:05:09 +00:00
GitHub Actions
85a15f8299 fix: resolve CI failures (WAF integration, Trivy vulnerabilities) 2025-12-03 20:16:42 +00:00
GitHub Actions
673a496bfa feat(tests): add new tests for certificate upload, proxy host creation, and uptime monitoring 2025-12-03 12:54:05 +00:00
GitHub Actions
336000ca5b feat: Add validation and error handling for notification templates and uptime handlers
- Implement tests for invalid JSON input in notification template creation, update, and preview endpoints.
- Enhance uptime handler tests to cover sync success and error scenarios for delete and list operations.
- Update routes to include backup service in certificate handler initialization.
- Introduce certificate usage check before deletion in the certificate service, preventing deletion of certificates in use.
- Update certificate service tests to validate new behavior regarding certificate deletion.
- Add new tests for security service to verify break glass token generation and validation.
- Enhance frontend certificate list component to prevent deletion of certificates in use and ensure proper backup creation.
- Create unit tests for the CertificateList component to validate deletion logic and error handling.
2025-12-03 04:55:29 +00:00
GitHub Actions
8ea50e37e0 feat: Remove deprecated security handler test file to streamline test suite 2025-12-03 02:23:22 +00:00
GitHub Actions
078b5803e6 feat: Add CheckMonitor functionality to trigger immediate health checks for uptime monitors 2025-12-02 22:08:58 +00:00
GitHub Actions
bb7b6a7f9e feat: Implement partial update for ProxyHostHandler
- Added a new test case to ensure that partial updates do not wipe existing fields in the ProxyHost model.
- Modified the Update method in ProxyHostHandler to handle partial updates by only mutating fields present in the JSON payload.
- Enhanced the handling of nullable foreign keys and locations during updates.
- Removed the requirement for 100% coverage checks for critical backend modules in the CI pipeline.
2025-12-02 21:06:15 +00:00
GitHub Actions
62ae91d0c3 fix(tests): add Notification model migrations to all handler tests using NotificationService 2025-12-02 04:34:37 +00:00
GitHub Actions
d285014358 fix(tests): add missing Notification models to handler test migrations 2025-12-02 04:19:25 +00:00
GitHub Actions
33dc664425 feat(waf): update WAF middleware to evaluate and log suspicious payloads without blocking in monitor mode 2025-12-02 03:53:12 +00:00
GitHub Actions
8d26a631d4 feat(tests): add integration test for WAF middleware behavior and metrics exposure 2025-12-02 03:36:58 +00:00
GitHub Actions
34347b1ff5 Refactor uptime service and tests; add WAF configuration UI and e2e tests
- Refactored `SyncMonitors` method in `uptime_service.go` for better readability.
- Updated unit tests for `UptimeService` to ensure proper functionality.
- Introduced Playwright configuration for end-to-end testing.
- Added e2e tests for WAF blocking and monitoring functionality.
- Enhanced the Security page to include WAF mode and rule set selection.
- Implemented tests for WAF configuration changes and validation.
- Created a `.last-run.json` file to store test results.
2025-12-02 02:51:50 +00:00
GitHub Actions
14859adf87 Enhance GenerateConfig function to accept ruleset paths and update related tests
- Modified the GenerateConfig function to include an additional parameter for ruleset paths.
- Updated multiple test cases across various files to accommodate the new parameter.
- Enhanced the manager's ApplyConfig method to handle ruleset file creation and error handling.
- Added integration tests for Coraza WAF to validate runtime behavior and ruleset application.
- Updated documentation to include instructions for testing Coraza WAF integration locally.
2025-12-01 21:11:17 +00:00
GitHub Actions
76ab163e69 feat(security): integrate Caddy Manager into SecurityHandler and update related tests 2025-12-01 20:16:08 +00:00
GitHub Actions
f5fb460cc6 feat(security): add DeleteRuleSet endpoint and implement related service logic 2025-12-01 19:56:15 +00:00
GitHub Actions
b0a4d75a2a Refactor security configuration: Remove external CrowdSec mode support
- Updated SecurityConfig model to only support 'local' or 'disabled' modes for CrowdSec.
- Modified related logic in the manager and services to reject external mode.
- Adjusted tests to validate the new restrictions on CrowdSec modes.
- Updated frontend components to remove references to external mode and provide appropriate user feedback.
- Enhanced documentation to reflect the removal of external CrowdSec mode support.
2025-12-01 19:43:45 +00:00
GitHub Actions
570d904019 feat(security): implement decision and ruleset management with logging and retrieval 2025-12-01 18:23:15 +00:00
GitHub Actions
53765afd35 feat(security): implement self-lockout protection and admin whitelist
- Added SecurityConfig model to manage Cerberus settings including admin whitelist and break-glass token.
- Introduced SecurityService for handling security configurations and token generation.
- Updated Manager to check for admin whitelist before applying configurations to prevent accidental lockouts.
- Enhanced frontend with hooks and API calls for managing security settings and generating break-glass tokens.
- Updated documentation to include self-lockout protection measures and best practices for using Cerberus.
2025-12-01 18:10:58 +00:00
GitHub Actions
c83928f628 Refactor Caddy configuration management to include security settings
- Updated `GenerateConfig` function calls in tests to include additional security parameters.
- Enhanced `Manager` struct to hold a `SecurityConfig` instance for managing security-related settings.
- Implemented `computeEffectiveFlags` method to determine the effective state of security features based on both static configuration and runtime database settings.
- Added comprehensive tests for the new security configuration handling, ensuring correct behavior for various scenarios including ACL and CrowdSec settings.
- Adjusted existing tests to accommodate the new structure and ensure compatibility with the updated configuration management.
2025-12-01 16:22:21 +00:00
GitHub Actions
581229e454 feat: ensure ACL is disabled when Cerberus is off in security status response 2025-12-01 16:22:21 +00:00
GitHub Actions
5717941d45 feat: add runtime override for ACL enabled flag in security handler 2025-12-01 16:22:21 +00:00
GitHub Actions
b45ac58f10 feat: add ACL_DBOverride test to validate ACL configuration in security handler 2025-12-01 16:22:21 +00:00
GitHub Actions
4d639698bb Enhance logging security by sanitizing sensitive data
- Implemented filename sanitization in backup, import, and certificate handlers to prevent log injection attacks.
- Added tests to ensure filenames are sanitized correctly in backup and import handlers.
- Updated notification and domain handlers to sanitize domain names before logging.
- Introduced middleware functions for sanitizing request paths and headers to redact sensitive information in logs.
- Enhanced recovery middleware to sanitize logged paths and headers during panic situations.
- Updated various services to log sanitized values for sensitive fields.
2025-12-01 16:22:21 +00:00
GitHub Actions
22a29955c8 feat: update request ID handling to use trace package constants 2025-12-01 16:22:21 +00:00
GitHub Actions
f1955711dc feat: enhance error handling for gzip and tar writer closures in ExportConfig 2025-12-01 16:22:21 +00:00
GitHub Actions
d27f28e20c feat: propagate request context in notification service and related handlers 2025-12-01 16:22:21 +00:00
GitHub Actions
fe1e62a360 feat: add request ID propagation to context in middleware 2025-12-01 16:22:21 +00:00
GitHub Actions
9494231f86 feat: replace fmt logging with structured logging using logger package 2025-12-01 16:22:21 +00:00
GitHub Actions
6ae05d159d feat: enhance logging in backup, import, and proxy host handlers with structured logging 2025-12-01 16:22:21 +00:00
GitHub Actions
9397943f99 feat: implement request ID middleware and enhance recovery logging with structured logging 2025-12-01 16:22:21 +00:00
GitHub Actions
48fbca2eee feat: add Recovery middleware for panic handling with verbose logging 2025-12-01 16:22:21 +00:00
GitHub Actions
d789ee85e5 feat: Add CrowdSec configuration management and export functionality
- Implemented CrowdSec configuration page with import/export capabilities.
- Added API endpoints for exporting, importing, listing, reading, and writing CrowdSec configuration files.
- Enhanced security handler to support runtime overrides for CrowdSec mode and API URL.
- Updated frontend components to include CrowdSec settings in the UI.
- Added tests for CrowdSec configuration management and security handler behavior.
- Improved user experience with toast notifications for successful operations and error handling.
2025-12-01 16:22:21 +00:00
GitHub Actions
224a53975d feat(tests): add comprehensive tests for ProxyHosts and Uptime components
- Introduced isolated coverage tests for ProxyHosts with various scenarios including rendering, bulk apply, and link behavior.
- Enhanced existing ProxyHosts coverage tests to include additional assertions and error handling.
- Added tests for Uptime component to verify rendering and monitoring toggling functionality.
- Created utility functions for setting labels and help texts related to proxy host settings.
- Implemented bulk settings application logic with progress tracking and error handling.
- Added toast utility tests to ensure callback functionality and ID incrementing.
- Improved type safety in test files by using appropriate TypeScript types.
2025-12-01 16:22:21 +00:00