- Strong Authentication Mechanisms: Implement multi-factor authentication (MFA) to provide an additional layer of security beyond just passwords.
- Least Privilege Principle: Ensure that users have the minimum levels of access (or permissions) needed to perform their tasks, reducing the risk of unauthorized access to sensitive information.
- Role based Access Control. RBAC and it's role in Internal and external Access
- Continuous Monitoring: Implement continuous monitoring tools to detect and respond to security incidents in real-time.
- Incident Response Plan: Have a clear and tested incident response plan in place to quickly address any security breaches or compliance issues.
- Backup & Restore. RPO (Return Point Objective) & RTO (Return Time Objective). Defining SLAs
Training: Regularly employees on the importance of security and compliance, including how to recognize phishing attempts and other common cyber threats, Use stronger passwords, 2FA's etc ..
- Deploying a Highly Available Application
- Explain Load Balancers and their role in deploying HA
- Infrastructure Design of a High Available System (AWS, Local)
- Two types: Horizontal & Vertical
Exercise Collaborative work to build a scalable end-to-end system that has security and development best practices in place.
Highly Available Backend using Docker
docker-compose.yml
Example:
version: '3'
services:
backend1:
image: eddsnx3/astro-backend
container_name: backend1
build: .
networks:
- backend
ports:
- "3000"
env_file:
- .env
backend2:
image: eddsnx3/astro-backend
container_name: backend2
build: .
networks:
- backend
ports:
- "3000"
env_file:
- .env
backend3:
image: eddsnx3/astro-backend
container_name: backend3
build: .
networks:
- backend
ports:
- "3000"
env_file:
- .env
caddy:
image: caddy
container_name: caddy
restart: unless-stopped
networks:
- backend
ports:
- 80:80
- 443:443
env_file:
- .env
environment:
- BACKEND_URL=${BACKEND_URL:-backend.local}
- IP_WHITELIST=${IP_WHITELIST:-0.0.0.0/0}
volumes:
- caddy_data:/data
- caddy_config:/config
- .Caddyfile:/etc/caddy/Caddyfile
volumes:
caddy_data:
caddy_config:
networks:
backend:
Caddyfile
Example:
{$BACKEND_URL} {
route {
@allowed {
path /*
remote_ip {$IP_WHITELIST}
}
reverse_proxy @allowed {
to backend1:3000 backend2:3000 backend3:3000
lb_policy round_robin
health_uri /health
health_interval 5s
health_timeout 2s
health_status 200
}
respond 403
}
}