52 Commits

Author SHA1 Message Date
Jeff Caldwell
e3172135ab Merge pull request #23 from jeffcaldwellca/ntfy
notifications!
2.2.0
2025-08-29 01:39:31 -04:00
Jeff Caldwell
950560c914 notifications! 2025-08-29 01:38:34 -04:00
Jeff Caldwell
16941ad6d3 Merge pull request #22 from jeffcaldwellca/bugfixes
Critical Security Issues: 3 CodeQL vulnerabilities resolved
Critical Bug Fixes: 1 frontend integration issue resolved (certificate generation edge case)
Attack Surface: Reduced through code cleanup and validation
Compliance: Enhanced security posture for enterprise deployment
Functionality: Zero breaking changes to existing features
API Reliability: 100% success rate for certificate generation with proper CSRF tokens
2025-08-29 01:01:52 -04:00
Jeff Caldwell
02c081f9ae bugfixes and security fixes 2025-08-29 00:59:55 -04:00
Jeff Caldwell
4d850bb2fd Merge pull request #20 from jeffcaldwellca/secfixes
## [2.0.0] - 2025-08-09

### 🚨 MAJOR RELEASE - Security & Architecture Overhaul

### Security - CRITICAL FIXES
- **🔒 Command Injection Protection**: Complete overhaul of command execution system
  - Implemented strict allowlist-based command validation to prevent injection attacks
  - Added `executeCommand` utility with comprehensive input sanitization
  - Restricted shell command execution to verified safe patterns for mkcert and openssl operations
  - Added timeout and buffer limits for command execution with proper error handling
  - **BREAKING**: All commands now validated against security patterns - invalid commands rejected

- **🛡️ Path Traversal Prevention**: Comprehensive file access security
  - Added `validateAndSanitizePath` function to prevent directory traversal attacks
  - Implemented secure filename validation with comprehensive sanitization
  - All file operations now use validated paths to prevent unauthorized access
  - Added protection against null bytes, directory traversal sequences, and invalid characters
  - **BREAKING**: File operations with invalid paths now return standardized error responses

- ** Enhanced Rate Limiting**: Multi-tier protection system
  - Authentication rate limiter: 5 attempts per 15 minutes (prevents brute force)
  - CLI rate limiter: 10 operations per 15 minutes (prevents command abuse)
  - API rate limiter: 100 requests per 15 minutes (prevents API flooding)
  - General rate limiter: 200 requests per 15 minutes (general protection)
  - Applied rate limiting to all previously unprotected routes
  - Configurable via environment variables with intelligent defaults

### Architecture - COMPLETE MODULARIZATION
- **📁 Modular File Structure**: Transformed monolithic codebase into organized modules
  - `src/config/`: Centralized configuration management
  - `src/security/`: Security utilities and validation functions
  - `src/middleware/`: Authentication and rate limiting middleware
  - `src/routes/`: Organized route handlers by functionality
  - `src/utils/`: Reusable utility functions and response handlers
  - **RESULT**: 34% reduction in code duplication (256 lines eliminated)

- **🔧 Utility-Based Architecture**: Standardized patterns for consistency
  - `apiResponse.*` utilities for consistent HTTP responses across all endpoints
  - `validateFileRequest()` for standardized file validation workflows
  - `asyncHandler()` for automatic error handling in async routes
  - `handleError()` for unified error logging and response formatting
  - **RESULT**: 70% reduction in repetitive code maintenance

- **📊 Code Quality Improvements**:
  - Files Route: 249 → 120 lines (52% reduction)
  - Certificates Route: 313 → 222 lines (29% reduction)  
  - System Route: 196 → 160 lines (18% reduction)
  - Server: 2300+ → 150 lines (94% reduction through modularization)

### API Changes - STANDARDIZED RESPONSES
- ** Consistent Response Format**: All API endpoints now return standardized JSON
  ```json
  // Success responses
  { "success": true, "data": {...}, "message": "optional" }
  
  // Error responses  
  { "success": false, "error": "description" }
  ```
- **🔍 Enhanced Error Details**: Development mode provides additional debugging information
- ** Improved Validation**: Consistent input validation across all endpoints
- **🛠️ Better Error Handling**: Automatic async error catching prevents server crashes

### Performance & Reliability
- **🚀 Reduced Memory Footprint**: Smaller codebase with optimized utilities
- **⏱️ Faster Error Processing**: Centralized error handling improves response times
- **🔄 Auto-Recovery**: Better error handling prevents application crashes
- **📈 Monitoring Ready**: Structured logging and response patterns enable better monitoring

### Developer Experience
- **📖 Comprehensive Documentation**: Added detailed architecture documentation
- **🧪 Testable Components**: Modular design enables unit testing of individual components
- **🔄 Reusable Patterns**: Utility functions speed up future development
- **🎯 Clear Separation of Concerns**: Route handlers focus on business logic

### BREAKING CHANGES
1. **API Response Format**: All endpoints now return standardized `{ success: boolean }` format
2. **Error Responses**: Error format changed from various patterns to consistent structure
3. **Command Validation**: Invalid shell commands now rejected instead of executed
4. **File Path Validation**: Invalid file paths return 400 errors instead of processing
5. **Environment Variables**: Some rate limiting variables renamed for consistency

### Migration Guide
- Update any client code expecting old error response formats
- Verify all shell commands are in the approved allowlist
- Check file access patterns for proper path validation
- Review environment variable configurations for rate limiting

### Deprecations
- Old error response patterns (will be removed in future versions)
- Direct shell command execution without validation (now blocked)
- Unvalidated file path access (now secured)
rc1
2025-08-09 01:34:40 -04:00
Jeff Caldwell
a69fad81f6 update changelog 2025-08-09 01:33:49 -04:00
Jeff Caldwell
86139814b8 update gitignore 2025-08-09 01:33:00 -04:00
Jeff Caldwell
e496e14482 fix fingerprint and format selection 2025-08-09 01:30:38 -04:00
Jeff Caldwell
cdfed0914a certificate generation fix 2025-08-09 00:54:19 -04:00
Jeff Caldwell
bb54c67f45 route fixes and api reconnection 2025-08-08 21:55:24 -04:00
Jeff Caldwell
cc6483fcc9 2.0 initial commit 2025-08-08 02:31:25 -04:00
Jeff Caldwell
1199f44151 fix security issues 2025-08-08 01:32:23 -04:00
Jeff Caldwell
d332621f99 Merge pull request #19 from jeffcaldwellca/ratelimits
## [1.5.5] - 2025-08-08

### Security
- **Comprehensive Rate Limiting Enhancement**: Applied rate limiting protection to all previously unprotected routes
  - Added authentication rate limiter (5 attempts per 15 minutes) to prevent brute force attacks on login endpoints
  - Added general rate limiter (200 requests per 15 minutes) for static content and non-API routes
  - Extended API rate limiting coverage to `/api/status`, `/api/generate`, and auth status endpoints
  - Protected OIDC authentication routes with rate limiting
  - Added rate limiting to all authentication-related routes including traditional form login
  - Configured environment variables for authentication rate limits (AUTH_RATE_LIMIT_WINDOW, AUTH_RATE_LIMIT_MAX)

- **Critical Security Fix**: Implemented command validation and input sanitization for shell command execution
  - Added allowlist-based command validation to prevent command injection attacks
  - Restricted shell command execution to specific safe patterns for mkcert and openssl operations
  - Added timeout and buffer limits for command execution
  - Enhanced logging of blocked command attempts for security monitoring
  - **BREAKING**: Commands not matching allowed patterns will now be rejected
2025-08-08 01:17:09 -04:00
Jeff Caldwell
55790c6ec2 documentation update further bugfixes 2025-08-08 01:15:54 -04:00
Jeff Caldwell
7c22fbfa29 Merge pull request #18 from jeffcaldwellca/dev
## [1.5.0] - 2025-08-08

### Added
- **Drag & Drop Certificate Upload**: New upload interface for importing existing certificate/key pairs
  - Intuitive drag & drop zone with visual feedback and hover effects
  - Click-to-browse file selection with multi-file support
  - Smart certificate-key pairing (automatically matches .crt with .key files, .pem with -key.pem files)
  - Comprehensive file validation (supports .pem, .crt, .key, .cer, .p7b, .p7c, .pfx, .p12 formats)
  - Real-time upload progress tracking with visual progress bar
  - Detailed upload results with success/error reporting for each file
  - Uploaded certificates stored in dedicated "uploaded" folder for organization
  - Full integration with existing certificate management (download, archive, bundle, PFX generation)

### Fixed
- **Root CA Generation Error**: Fixed `showNotification is not defined` JavaScript error
  - Changed incorrect `showNotification` function call to use existing `showAlert` function
  - Root CA generation now completes successfully without JavaScript errors
- **CA Installation Timing Issues**: Improved CA installation status refresh mechanism
  - Added retry mechanism with exponential backoff for CA status checking
  - Eliminates need for manual page refresh after CA installation
  - More reliable detection of newly installed Certificate Authorities

### Enhanced
- **Certificate Listing**: Enhanced recursive directory scanning to properly display uploaded certificates
- **Upload Processing**: Streamlined file processing logic to prevent duplicate file operations
- **User Experience**: Improved visual feedback and error handling throughout upload process
2025-08-08 00:12:47 -04:00
Jeff Caldwell
655e2f0040 bugfixes and doc updates 2025-08-08 00:11:31 -04:00
Jeff Caldwell
e7fc6ccef7 update docker add upload 2025-08-07 23:48:22 -04:00
Jeff Caldwell
c834e205c8 docker up fix 2025-08-07 23:19:49 -04:00
Jeff Caldwell
535aa564ac Merge pull request #12 from jeffcaldwellca/ratelimiting
Ratelimiting
beta-alpha
2025-08-01 19:37:58 -04:00
Jeff Caldwell
567bd29417 add rate limiting protection 2025-08-01 19:35:14 -04:00
Jeff Caldwell
20d8bca0a9 Merge pull request #11 from jeffcaldwellca/oidc
## [1.4.0] - 2025-08-01

### Added
- **OpenID Connect (OIDC) SSO Authentication**: Full OpenID Connect integration for single sign-on support
  - Passport-based OIDC strategy implementation with configurable providers
  - Support for Azure AD, Google, and other OIDC-compliant identity providers
  - Comprehensive environment variable configuration for OIDC settings
  - OIDC callback URL handling and user profile management
  - Optional OIDC authentication alongside existing basic authentication
- **Enhanced Root CA Management**: Improved Root CA generation workflow and user experience
- **Environment Configuration**: Expanded `.env.example` with comprehensive OIDC configuration options
- **Session Management**: Enhanced passport-based session handling for OIDC flows

### Changed
- **Authentication System**: Refactored authentication to support multiple authentication methods
- **Server Configuration**: Enhanced server startup to handle OIDC provider initialization
- **User Interface**: Updated login forms to support both basic auth and OIDC flows

### Fixed
- **PFX Password Handling**: Resolved password validation and encryption issues in PFX generation
- **Root CA Workflow**: Streamlined and improved Root CA generation process
- **Session Security**: Enhanced session cookie configuration and security settings
- **UI Styling**: Various style fixes and improvements for better user experience

### Security
- **OIDC Integration**: Secure OpenID Connect implementation with proper token validation
- **Enhanced Session Management**: Improved session security and authentication flows
- **Provider Validation**: Secure OIDC provider configuration and callback validation
2025-08-01 19:20:30 -04:00
Jeff Caldwell
f62993775e update documentation 2025-08-01 19:18:47 -04:00
Jeff Caldwell
b2791eb160 tweak root CA generation workflow 2025-08-01 12:49:29 -04:00
Jeff Caldwell
50a1ae14b5 update documentation 2025-08-01 12:45:17 -04:00
Jeff Caldwell
05b1fe2f7b bugfixes, style fixes 2025-08-01 12:42:00 -04:00
Jeff Caldwell
df524a482c fix pfx password bug 2025-08-01 12:08:50 -04:00
Jeff Caldwell
d1c8c912fe initial openconnect testing 2025-08-01 11:45:10 -04:00
Jeff Caldwell
6146bc2e72 Merge pull request #10 from jeffcaldwellca/v1.3
## [1.3.0] - 2025-08-01

### Added
- **PFX Generation**: On-demand PKCS#12 (.pfx) file generation for Windows/IIS compatibility
- User-friendly password modal for PFX protection with optional encryption
- Enhanced certificate card layout with improved text handling for long filenames
- Better responsive design for mobile devices with optimized button sizes
- Text truncation with tooltips for long domain lists (100+ characters)
- Structured file information display with dedicated styling for certificate and key files
- URL encoding fixes for proper handling of complex folder paths with special characters

### Changed
- **Certificate Cards**: Complete redesign with better organization and overflow handling
- Improved mobile responsiveness with single-column layout on small screens
- Enhanced button styling and spacing for better user experience
- Updated certificate information display with clearer visual hierarchy
- Better word wrapping and text breaking for long strings

### Fixed
- **Download Functionality**: Fixed 404 errors in download buttons due to URL encoding issues
- **PFX Generation**: Resolved routing issues with complex folder paths containing slashes
- **Archive/Restore**: Fixed double URL encoding problems in certificate management
- **UI Consistency**: Removed confusing question mark cursor from filename displays
- **Mobile Layout**: Fixed text overflow and improved touch-friendly button sizing

### Removed
- Debug console logging from production PFX generation
- Unnecessary cursor help indicators from file name displays
beta-evenmore
2025-08-01 11:25:38 -04:00
Jeff Caldwell
75cd2da99e update git ignore, remove development files 2025-08-01 11:24:19 -04:00
Jeff Caldwell
9595279b1e bugfixes and documentation. pfx generation. 2025-08-01 11:20:01 -04:00
Jeff Caldwell
1600411428 Merge pull request #9 from jeffcaldwellca/dev
Dev
2025-08-01 10:47:48 -04:00
Jeff Caldwell
52dd0bec61 resolve double encoded path bug 2025-08-01 10:47:06 -04:00
Jeff Caldwell
abbbd7318e login form updates 2025-08-01 10:21:21 -04:00
Jeff Caldwell
019a330a22 session control changes 2025-08-01 10:21:03 -04:00
Jeff Caldwell
2e0e31e831 Chrome not downloading files as expected 2025-08-01 10:19:04 -04:00
Jeff Caldwell
3e451c8998 fix endpoint/folder translation for encoding 2025-08-01 10:08:44 -04:00
Jeff Caldwell
31bb69e183 Merge pull request #4 from jeffcaldwellca/rootcagen
## [1.2.0] - 2025-07-29

### Added
- Complete Docker containerization support
- Multi-stage Dockerfile with Node.js 18 Alpine base image
- Pre-installed mkcert CLI in Docker container
- Docker Compose configuration for easy deployment
- Volume persistence for certificates and application data
- Comprehensive Docker documentation (DOCKER.md)
- Docker-specific npm scripts for container management
- Health check configuration for container monitoring
- Non-root user security implementation in containers
- Environment variable support for all configuration options
- Automatic Root CA generation when none exists
- Manual Root CA generation option with user-friendly interface
- Visual indicators for auto-generated Root CAs
- New API endpoint `/api/generate-ca` for manual CA creation

### Changed
- Updated .gitignore to exclude Docker-related build files
- Enhanced package.json with Docker-related scripts
- Optimized .dockerignore for efficient Docker builds
- Cleaned up unused backup and development files
- **Docker**: Added OpenSSL to container for full certificate functionality

### Fixed
- **Docker**: OpenSSL now included in container for certificate analysis and operations

### Removed
- Unused backup files
- Development test utility

### Security
- Docker container runs as non-root user (nodejs:1001)
- Secure volume mounting for certificate persistence
- Production-ready security configurations
beta-more
2025-07-29 15:15:41 -04:00
Jeff Caldwell
9ca2bb0306 revert docker details for now, add root ca gen 2025-07-29 15:14:26 -04:00
Jeff Caldwell
d84631ff37 Merge pull request #3 from jeffcaldwellca/dockerize
## [1.2.0] - 2025-07-29

### Added
- Complete Docker containerization support
- Multi-stage Dockerfile with Node.js 18 Alpine base image
- Pre-installed mkcert CLI in Docker container
- Docker Compose configuration for easy deployment
- Volume persistence for certificates and application data
- Comprehensive Docker documentation (DOCKER.md)
- Docker-specific npm scripts for container management
- Health check configuration for container monitoring
- Non-root user security implementation in containers
- Environment variable support for all configuration options

### Changed
- Updated .gitignore to exclude Docker-related build files
- Enhanced package.json with Docker-related scripts
- Optimized .dockerignore for efficient Docker builds
- Cleaned up unused backup and development files

### Removed
- Unused backup files
- Development test utility

### Security
- Docker container runs as non-root user (nodejs:1001)
- Secure volume mounting for certificate persistence
- Production-ready security configurations
2025-07-29 14:49:06 -04:00
Jeff Caldwell
46ac271afb file cleanup 2025-07-29 14:48:04 -04:00
Jeff Caldwell
7e474a1b04 let's dockerize! 2025-07-29 14:44:05 -04:00
Jeff Caldwell
deab12e798 Merge pull request #2
Adding auth and new styling
beta
2025-07-29 14:36:30 -04:00
Jeff Caldwell
aac03ca3c7 update changelog 2025-07-29 14:33:31 -04:00
Jeff Caldwell
a5943c8eb0 dark and light mode! 2025-07-29 14:32:45 -04:00
Jeff Caldwell
fd7990c345 screenshot and readme 2025-07-29 13:49:48 -04:00
Jeff Caldwell
7031fa9992 update documentation 2025-07-29 13:42:25 -04:00
Jeff Caldwell
a90e6f5695 add changelog 2025-07-29 13:22:04 -04:00
Jeff Caldwell
8e560cd8b0 resolve http auth and new styles 2025-07-29 13:17:11 -04:00
Jeff Caldwell
5d4133225d fix route handling 2025-07-29 12:55:06 -04:00
Jeff Caldwell
13c70e9a23 adding system authentication system 2025-07-29 12:47:18 -04:00