algo/roles
Dan Guido 0aaca43019
Security Hardening and Certificate Authority Constraints (#14811)
* Security hardening and certificate authority constraints

This commit addresses Issues #75 and #14804 with defensive security
enhancements that provide additional protection layers for edge case
scenarios.

## Issue #75: Technically Constrain Root CA
- Add pathlen:0 basic constraints preventing subordinate CA creation
- Implement name constraints restricting certificate issuance to specific IPs
- Add extended key usage restrictions limiting CA scope to VPN certificates
- Separate client/server certificate extensions (serverAuth vs clientAuth)
- Enhanced CA with critical constraints for defense-in-depth when CA keys saved

## Issue #14804: Comprehensive SystemD Security Hardening
- WireGuard: Added systemd hardening as additional defense-in-depth
- StrongSwan: Enhanced systemd configuration complementing AppArmor profiles
- dnscrypt-proxy: Additional systemd security alongside AppArmor protection
- Applied privilege restrictions, filesystem isolation, and system call filtering

## Technical Changes
- CA certificate constraints only relevant when users opt to save CA keys
- SystemD hardening provides additional isolation layers beyond existing AppArmor
- Enhanced client certificate validation for iOS/macOS profiles
- Reliable AppArmor profile enforcement for Ubuntu 22.04

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Address PR review feedback and improve code quality

## Fixes Based on Review Feedback:

### Handler Consistency Issues
- Fix notification naming: "daemon reload" → "daemon-reload" for consistency
- Update deprecated syntax: `daemon_reload: yes` → `daemon_reload: true`

### Enhanced CA Certificate Constraints
- Add .mil and .int to excluded DNS domains for completeness
- Add .mil and .int to excluded email domains for consistency
- Add explanatory comment for openssl_constraint_random_id security purpose

## Technical Improvements:
- Ensures proper handler invocation across DNS and WireGuard services
- Provides more comprehensive CA name constraints protection
- Documents the security rationale for UUID-based CA constraints

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* Address PR review feedback - improve documentation and fix duplicate key

- Add IPv6 documentation range (2001:db8::/32) to excluded ranges
- Add explanatory comment for CA name constraints defense-in-depth purpose
- Remove duplicate DisableMOBIKE key from iOS configuration
- Add comprehensive comments to iOS/macOS mobileconfig parameters
- Explain MOBIKE, redirect disabling, certificate type, and routing settings

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-08-04 20:22:41 -07:00
..
client Ansible upgrade 6.1 (#14500) 2022-07-30 15:01:24 +03:00
cloud-azure Fix AWS CloudFormation linter warnings (#14294) (#14782) 2025-08-03 04:49:40 -04:00
cloud-cloudstack/tasks feat: Add comprehensive performance optimizations to reduce deployment time by 30-60% 2025-08-03 16:42:17 -07:00
cloud-digitalocean/tasks Fix DigitalOcean cloud-init compatibility and deprecation warnings (#14801) 2025-08-03 14:25:47 -04:00
cloud-ec2 feat: Add AWS credentials file support (#14778) 2025-08-03 15:07:57 -06:00
cloud-gce/tasks feat: Add comprehensive performance optimizations to reduce deployment time by 30-60% 2025-08-03 16:42:17 -07:00
cloud-hetzner/tasks Fix hetzner module (#14698) 2024-03-14 09:25:09 +01:00
cloud-lightsail Optimize GitHub Actions workflows for security and performance (#14769) 2025-08-02 23:31:54 -04:00
cloud-linode Ansible upgrade 6.1 (#14500) 2022-07-30 15:01:24 +03:00
cloud-openstack/tasks feat: Add comprehensive performance optimizations to reduce deployment time by 30-60% 2025-08-03 16:42:17 -07:00
cloud-scaleway Ansible upgrade 6.1 (#14500) 2022-07-30 15:01:24 +03:00
cloud-vultr/tasks feat: add support for vultr api v2 (#14773) 2025-08-03 14:56:40 -06:00
common Fix IPv6 address selection on BSD systems (#14786) 2025-08-03 17:15:27 -07:00
dns Security Hardening and Certificate Authority Constraints (#14811) 2025-08-04 20:22:41 -07:00
local/tasks fix: Fix shellcheck POSIX sh issue and make ansible-lint stricter (#14789) 2025-08-03 07:04:04 -04:00
ssh_tunneling Fix DigitalOcean cloud-init compatibility and deprecation warnings (#14801) 2025-08-03 14:25:47 -04:00
strongswan Security Hardening and Certificate Authority Constraints (#14811) 2025-08-04 20:22:41 -07:00
wireguard Security Hardening and Certificate Authority Constraints (#14811) 2025-08-04 20:22:41 -07:00