Environment configuration
Proper environment configuration is critical for securing sensitive credentials and connection strings.Environment variables
Store all sensitive configuration in environment variables, never in source code:| Variable | Description | Example |
|---|---|---|
BMS_DB_USER | Database username | postgres.example123 |
BMS_DB_PASSWORD | Database password | [secure password] |
BMS_DB_SERVER | Database server hostname | aws-1-ap-southeast-1.pooler.supabase.com |
BMS_DB_PORT | Database port | 5432 |
BMS_DB_NAME | Database name | postgres |
Initial setup
When deploying BMS POS:-
Copy the environment template:
- Configure all required variables with production values
-
Restrict file permissions (Linux/Mac):
-
Verify configuration is not exposed:
Connection string security
TheSecureConfigurationService processes connection strings by replacing placeholders with environment variables:
SecureConfigurationService.cs:22-50
Database security
Protect your database with multiple layers of security.Connection security
Use SSL/TLS connections:- Enable SSL in your database server configuration
- Use connection strings with SSL mode enabled
- Verify SSL certificates to prevent man-in-the-middle attacks
Credential management
Strong passwords:- Use passwords at least 16 characters long
- Include uppercase, lowercase, numbers, and symbols
- Avoid dictionary words and common patterns
- Use a password manager to generate and store credentials
- Create dedicated database user for BMS POS application
- Grant only necessary permissions (SELECT, INSERT, UPDATE, DELETE)
- Avoid using superuser accounts for application connections
- Regularly rotate database passwords
SQL injection prevention
BMS POS uses parameterized queries throughout to prevent SQL injection:Entity Framework Core automatically uses parameterized queries, providing protection against SQL injection attacks.
PIN security
Employee PINs are the primary authentication mechanism and must be properly secured.PIN requirements
Recommended PIN policies:- Minimum length: 4 digits
- Recommended length: 6 digits
- Avoid sequential numbers (1234, 5678)
- Avoid repeated digits (1111, 9999)
- Avoid birth dates and other personal information
- Change PINs periodically (every 90 days for managers)
BCrypt configuration
BMS POS uses BCrypt with a work factor of 12:PinSecurityService.cs:14
- Work factor 12 provides strong security for 2024+
- Higher work factors increase computation time
- Balance security with user experience (login speed)
- Consider increasing work factor as hardware improves
Legacy PIN migration
If migrating from a system with plaintext PINs:-
Automatic upgrade occurs on first login:
AuthController.cs:193-204
- Monitor migration progress through audit logs
- Verify all PINs upgraded before removing legacy support
Session management
Secure session handling prevents unauthorized access and session hijacking.Session storage
Current implementation:- Sessions stored in browser localStorage
- Appropriate for desktop kiosk deployment model
- Relies on physical device security
- localStorage persists across browser restarts
- Data accessible to JavaScript on same origin
- Not suitable for shared or untrusted devices
BMS POS assumes physical device security in kiosk mode. For multi-user workstations, implement additional session isolation.
Auto-logout
Implement automatic logout after inactivity:- Configurable timeout period (default: 15-30 minutes)
- Warn user before logout
- Clear session data on logout
- Require re-authentication to resume
Session validation
Validate sessions on every request:- Check session token validity
- Verify user still has active account
- Confirm role permissions haven’t changed
- Log suspicious session activity
Physical security
The desktop application security model assumes physical device security.Device security
Essential measures:- Keep POS terminals in secure, supervised areas
- Lock devices when unattended
- Use cable locks for hardware theft prevention
- Enable BIOS/firmware passwords
- Configure auto-lock on inactivity
- Full disk encryption (BitLocker, LUKS)
- Trusted Platform Module (TPM) for key storage
- Secure boot configuration
- Disable unnecessary USB ports
- Physical intrusion detection
Access control
Terminal access:- Limit who can access POS terminals physically
- Supervise training sessions with production systems
- Log all physical access to server rooms
- Use security cameras in POS areas
- Power down or lock terminals when closed
- Store backup devices in locked cabinets
- Implement alarm systems
- Document device inventory regularly
Network security
Localhost communication
BMS POS uses localhost communication between Electron frontend and .NET backend. No network encryption is provided as traffic doesn’t leave the device.
- Backend API binds only to localhost (127.0.0.1)
- Not accessible from network
- Prevents remote attacks
- Suitable for single-device deployment
External connections
Database connections:- Use SSL/TLS for remote database connections
- Configure firewall rules to restrict database access
- Use VPN when accessing cloud databases
- Monitor connection logs for anomalies
Backup and recovery
Protect against data loss and ensure business continuity.Backup strategy
Automated backups:- Automate daily backups
- Store backups on separate device/location
- Encrypt backup files
- Test restoration procedures regularly
- Maintain offsite backup copies
- Document backup and restore procedures
Disaster recovery
Recovery plan should include:- Backup restoration procedures
- Alternative POS operations (manual fallback)
- Contact information for support
- Hardware replacement procedures
- Data integrity verification steps
Audit and monitoring
Regular reviews
Daily tasks:- Review failed login attempts
- Check for unusual transaction patterns
- Verify system health indicators
- Monitor available disk space
- Generate activity summary reports
- Review user access patterns
- Check for software updates
- Verify backup completion
- Comprehensive security audit
- Review employee access levels
- Update security documentation
- Test disaster recovery procedures
Security metrics
Track key security indicators:- Failed login attempts per day
- Number of role mismatch events
- Average session duration
- Transaction void frequency
- Manager override frequency
- After-hours activity
Software updates
Keep BMS POS and dependencies up to date.Update policy
Critical updates:- Apply security patches immediately
- Test in staging environment first
- Schedule downtime during off-hours
- Maintain rollback plan
- Review release notes for security fixes
- Update dependencies monthly
- Test all features after updates
- Document update history
Dependency management
Compliance considerations
BMS POS is designed for small to medium business operations. Organizations with specific compliance requirements should implement additional controls.PCI-DSS considerations
If processing credit card payments:- Use PA-DSS validated payment terminals
- Never store full card numbers
- Encrypt cardholder data in transit and at rest
- Implement access control and monitoring
- Conduct regular security assessments
- Maintain PCI compliance documentation
Data privacy regulations
For GDPR, CCPA, or similar regulations:- Document what personal data is collected
- Implement data retention policies
- Provide data export capabilities
- Support data deletion requests
- Obtain proper consent for data collection
- Appoint data protection officer if required
Financial regulations
For financial record keeping:- Retain transaction records per legal requirements
- Implement tamper-evident audit logs
- Support tax reporting requirements
- Document internal controls
- Conduct regular financial audits
Security roadmap
Future security enhancements planned for BMS POS:Upcoming features
Authentication:- Two-factor authentication for Manager accounts
- Biometric authentication support
- Smart card/badge integration
- SSO integration for enterprise deployments
- Enhanced tamper protection
- Cryptographic hash chaining
- External SIEM integration
- Automated anomaly detection
- Database encryption at rest
- End-to-end encryption for sensitive data
- Key management service integration
- Data loss prevention (DLP) features
- Application code signing
- Automated security scanning in CI/CD
- Vulnerability disclosure program
- Security certification compliance
Incident response
Security incident procedures
If you suspect a security breach:- Contain - Isolate affected systems immediately
- Assess - Determine scope and impact
- Document - Preserve evidence and logs
- Notify - Inform stakeholders and authorities as required
- Remediate - Fix vulnerabilities and restore systems
- Review - Conduct post-incident analysis
Reporting vulnerabilities
Include in your report:- Description of the vulnerability
- Steps to reproduce
- Potential impact assessment
- Suggested remediation if known
- Your contact information
Resources
Security references
Support
For security questions or concerns:- Review the Security Policy
- Check Audit Logging documentation
- Contact your system administrator
- Report security vulnerabilities privately
Next steps
Authentication
Implement secure PIN-based authentication
Roles and permissions
Configure role-based access control
Audit logging
Monitor user activity and security events