A minimalist, role-based web application designed for internal teams to manage projects and tasks with robust security controls.
- Authentication: Salted password hashing (bcrypt), generic login errors, account lockout
- Authorization: Role-based access control with three distinct user roles
- Input Validation: Comprehensive validation with rejection-based approach
- Security Logging: Comprehensive audit logging of all security-sensitive events
- Error Handling: Custom error pages with no technical information exposure
- Create, view, and delete Project Manager accounts
- View comprehensive audit logs
- Change own password
- Cannot manage tasks directly
- Create new tasks
- View all tasks they created
- Assign/reassign tasks to Employee users
- Delete tasks they created
- View list of Employee users
- Change own password
- View tasks assigned to them
- Change task status (Pending/Completed)
- Change own password
- Cannot view other employees' tasks
-
Clone the repository
git clone <repository-url> cd SecureTask
-
Install dependencies
npm install
-
Start the application
npm start
For development with auto-restart:
npm run dev
-
Access the application Open your browser to
http://localhost:3000
Administrator Account:
- Username:
admin - Password:
Admin123!
For production deployment, set the following environment variables:
SESSION_SECRET: A strong, unique secret for session encryptionPORT: Application port (default: 3000)
- Minimum 8 characters
- Must contain uppercase and lowercase letters
- Must contain at least one number
- Must contain at least one special character (@$!%*?&)
- Accounts are locked for 15 minutes after 5 failed login attempts
- Failed attempts are reset upon successful login
- HTTP-only cookies
- 24-hour session timeout
- Secure session configuration
- Server-side validation for all user inputs
- Length limits and format validation
- Rejection-based approach (no sanitization)
- All authentication events
- Authorization failures
- Administrative actions
- Task management operations
- Accessible only to Administrators
SecureTask/
├── server.js # Main application server
├── package.json # Node.js dependencies
├── database/
│ └── init.js # Database schema and helpers
├── middleware/
│ └── auth.js # Authentication and authorization
├── routes/
│ ├── auth.js # Authentication routes
│ ├── dashboard.js # Main dashboard routes
│ ├── admin.js # Administrator routes
│ └── account.js # Account management routes
├── utils/
│ ├── logger.js # Security logging utility
│ └── validation.js # Input validation helpers
├── views/
│ ├── layout.ejs # Main template layout
│ ├── login.ejs # Login page
│ ├── register.ejs # Registration page
│ ├── error.ejs # Error page
│ ├── dashboard/ # Role-specific dashboards
│ ├── admin/ # Administrator pages
│ └── account/ # Account management pages
└── logs/ # Application log files
- Database: Uses SQLite with parameterized queries to prevent SQL injection
- Sessions: Secure session configuration with HTTP-only cookies
- Headers: Security headers via Helmet.js
- Rate Limiting: Protection against brute force attacks
- Input Validation: Comprehensive validation with explicit rejection of malicious content
- Error Handling: Generic error messages to prevent information disclosure
- Logging: Comprehensive audit trail for security analysis
- Built with Node.js, Express.js, and SQLite
- Uses EJS templating engine
- Bootstrap 5 for responsive UI
- Font Awesome for icons
- bcrypt for password hashing
- Winston for logging
- Set environment variables (especially
SESSION_SECRET) - Use HTTPS (set session
secure: true) - Configure proper database permissions
- Set up log rotation
- Monitor audit logs regularly
- Keep dependencies updated
This project is for educational purposes as part of the CSSECDV course.