This Epic completes the ConfigureCommand implementation by adding system security configuration capabilities. After establishing the foundational architecture and Docker installation in previous work, this Epic focuses specifically on system-level security hardening through three key areas:
Goals
- Automatic Security Updates - Configure
unattended-upgrades for automated security patch management
- UFW Firewall Configuration - Implement network-level security with safe SSH access preservation
- Template Architecture Refinement - Consolidate Ansible templates into a centralized variables pattern
This Epic provides immediate production value by securing deployed instances with industry-standard security practices, while also establishing a clean architectural foundation for future service additions.
Implementation Strategy
Phase 1: Automatic Security Updates (#17)
Estimated Time: 1-2 days
- Lower risk implementation that configures unattended-upgrades for automatic security patching
- Install and configure unattended-upgrades package
- Enable automatic reboots at 2:00 AM for security updates
- Configure update notifications and logging
Phase 2: UFW Firewall Configuration (#18)
Estimated Time: 2-3 days
- Higher risk implementation requiring careful SSH access handling
- Reset UFW to clean state
- Configure restrictive default policies (deny incoming, allow outgoing)
- CRITICALLY: Allow SSH access BEFORE enabling firewall
- Use configurable SSH port from
user_inputs.ssh_port
Phase 3: Template Architecture Refinement (#19)
Estimated Time: 1-2 days
- Architectural cleanup and consistency improvement
- Consolidate 2 Tera templates into 1 centralized variables pattern
- Create
variables.yml.tera matching OpenTofu's approach
- Convert
inventory.yml.tera and configure-firewall.yml.tera to static files
- Establish consistent pattern for future service additions
Architecture Impact
Domain Changes Required
The ConfigureStep enum in src/domain/environment/state/configure_failed.rs needs to be extended:
/// Steps in the configure workflow
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
pub enum ConfigureStep {
/// Installing Docker
InstallDocker,
/// Installing Docker Compose
InstallDockerCompose,
/// Configuring automatic security updates
ConfigureSecurityUpdates,
/// Configuring UFW firewall
ConfigureFirewall,
}
New Application Steps
Two new step implementations required:
src/application/steps/system/configure_security_updates.rs
src/application/steps/system/configure_firewall.rs
New Ansible Templates
Two new Ansible playbook templates:
templates/ansible/configure-security-updates.yml (static)
templates/ansible/configure-firewall.yml.tera (dynamic - requires SSH port resolution)
Acceptance Criteria
Related
Roadmap: Task 3.1 - Finish ConfigureCommand
Related Issues: #1 (Roadmap)
Total Estimated Effort: 4-7 days
Full specification: Epic Documentation
This Epic completes the
ConfigureCommandimplementation by adding system security configuration capabilities. After establishing the foundational architecture and Docker installation in previous work, this Epic focuses specifically on system-level security hardening through three key areas:Goals
unattended-upgradesfor automated security patch managementThis Epic provides immediate production value by securing deployed instances with industry-standard security practices, while also establishing a clean architectural foundation for future service additions.
Implementation Strategy
Phase 1: Automatic Security Updates (#17)
Estimated Time: 1-2 days
Phase 2: UFW Firewall Configuration (#18)
Estimated Time: 2-3 days
user_inputs.ssh_portPhase 3: Template Architecture Refinement (#19)
Estimated Time: 1-2 days
variables.yml.teramatching OpenTofu's approachinventory.yml.teraandconfigure-firewall.yml.terato static filesArchitecture Impact
Domain Changes Required
The
ConfigureStepenum insrc/domain/environment/state/configure_failed.rsneeds to be extended:New Application Steps
Two new step implementations required:
src/application/steps/system/configure_security_updates.rssrc/application/steps/system/configure_firewall.rsNew Ansible Templates
Two new Ansible playbook templates:
templates/ansible/configure-security-updates.yml(static)templates/ansible/configure-firewall.yml.tera(dynamic - requires SSH port resolution)Acceptance Criteria
ConfigureStepenumvariables.yml.tera) needs variable processingRelated
Roadmap: Task 3.1 - Finish ConfigureCommand
Related Issues: #1 (Roadmap)
Total Estimated Effort: 4-7 days
Full specification: Epic Documentation