diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index 9421654..bfbc67d 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -3,6 +3,8 @@ default_user: cmmcadmin default_shell: /bin/bash ssh_authorized_key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}" +organization_name: Acme Defense Systems # Used in banners and audit messages + # ๐ŸŒ Network & Proxy Settings nextcloud_port: 8080 diff --git a/ansible/roles/preflight/tasks/log_results.yml b/ansible/roles/preflight/tasks/log_results.yml new file mode 100644 index 0000000..648be4d --- /dev/null +++ b/ansible/roles/preflight/tasks/log_results.yml @@ -0,0 +1,21 @@ +--- + +- name: Write DNS resolution log + copy: + content: "{{ dns_log }}" + dest: "{{ evidence_dir }}/08_preflight_checks/dns_check.log" + +- name: Write email validation log + copy: + content: "{{ email_log }}" + dest: "{{ evidence_dir }}/08_preflight_checks/email_check.log" + +- name: Write SSH key validation log + copy: + content: "{{ ssh_log }}" + dest: "{{ evidence_dir }}/08_preflight_checks/ssh_key_check.log" + +- name: Write validation summary + template: + src: summary.md.j2 + dest: "{{ evidence_dir }}/08_preflight_checks/summary.md" diff --git a/ansible/roles/preflight/templates/summary.md.j2 b/ansible/roles/preflight/templates/summary.md.j2 new file mode 100644 index 0000000..b4bceac --- /dev/null +++ b/ansible/roles/preflight/templates/summary.md.j2 @@ -0,0 +1,13 @@ +# ๐Ÿงช Preflight Validation Summary + +This summary documents all major checks executed before the OpenCMMC Stack deployment. + +## Results + +- DNS Check: {{ dns_result }} +- Email Format: {{ email_result }} +- SSH Key: {{ ssh_result }} + +--- + +Generated: {{ ansible_date_time.date }} at {{ ansible_date_time.time }} diff --git a/ansible/roles/secure_ubuntu/templates/banner.txt.j2 b/ansible/roles/secure_ubuntu/templates/banner.txt.j2 index 48a54af..1bd464e 100644 --- a/ansible/roles/secure_ubuntu/templates/banner.txt.j2 +++ b/ansible/roles/secure_ubuntu/templates/banner.txt.j2 @@ -1,10 +1 @@ -*** WARNING *** - -This computer system is the property of {{ organization_name | default('Your Organization') }}. It is for authorized use only. - -By accessing this system, you acknowledge and consent to the following: -- All information is subject to monitoring by authorized personnel. -- Unauthorized use may result in disciplinary action, civil penalties, or criminal prosecution. -- You agree to comply with all security and data handling policies. - -This system is protected under CMMC Level 2 compliance controls. +{{ login_banner_text }} diff --git a/ansible/roles/secure_ubuntu/vars/main.yml b/ansible/roles/secure_ubuntu/vars/main.yml index e69de29..e67fd01 100644 --- a/ansible/roles/secure_ubuntu/vars/main.yml +++ b/ansible/roles/secure_ubuntu/vars/main.yml @@ -0,0 +1,16 @@ +--- +login_banner_text: | + *** WARNING *** + + This computer system is the property of {{ organization_name | default("Your Organization") }}. + It is for authorized use only. + + By accessing this system, you acknowledge and consent to the following: + + - All information transmitted, received, or stored on this system is subject to monitoring, interception, and review by authorized personnel. + - Unauthorized use, access, or modification of this system or its data is strictly prohibited and may result in disciplinary action, civil penalties, or criminal prosecution. + - Use of this system indicates your understanding and acceptance of company policies regarding information security, acceptable use, and data protection. + + This system is protected under CMMC Level 2 guidelines to safeguard Controlled Unclassified Information (CUI), Federal Contract Information (FCI), proprietary company data, financial records, and Personally Identifiable Information (PII). + + If you do not have explicit authorization, log off immediately. diff --git a/deployment_config.yml b/deployment_config.yml new file mode 100644 index 0000000..4ed855e --- /dev/null +++ b/deployment_config.yml @@ -0,0 +1,75 @@ +--- +# ๐Ÿ› ๏ธ One-Click Deployment Configuration for OpenCMMC Stack + +# ๐Ÿ‘ค Global Administrator Details +global_admin_username: cmmcadmin +global_admin_email: admin@example.com +admin_ssh_public_key: "{{ lookup('file', '~/.ssh/id_rsa.pub') }}" + +# ๐ŸŒ Domain and Host Settings +domain_name: example.cmmc.local +hostname: open-cmmc-gateway +timezone: America/New_York +dns_resolver_ip: 1.1.1.1 + +# ๐Ÿ–ฅ๏ธ Infrastructure Provider +provider: digitalocean # Options: digitalocean, aws, gcp, azure, proxmox, baremetal +provisioner_api_token: changeme-provider-token +region: nyc3 +vm_size: s-2vcpu-4gb + +# ๐Ÿ” Security Parameters +banner_text: | + *** WARNING *** + + This system is the property of {{ domain_name }}. It is for authorized use only. + + - All information is subject to monitoring and disclosure. + - Unauthorized use may result in prosecution or administrative action. + - Use implies acceptance of all company security and use policies. + +# ๐Ÿ”‘ SSH Configuration +ssh_port: 22 +disable_root_ssh: true +enforce_key_authentication: true + +# ๐Ÿ“ฌ Mailcow Configuration +mailcow_hostname: mail +mailcow_admin_user: admin +mailcow_admin_password: change_me_securely +mailcow_letsencrypt_email: it@example.com +mailcow_use_letsencrypt: "n" + +# ๐Ÿ” Tailscale +tailscale_auth_key: tskey-abc123 + +# ๐Ÿ“œ Keycloak Identity Settings +keycloak_realm: OpenCMMC + +# ๐Ÿ›ก๏ธ Ports Used by Services +nextcloud_port: 8080 +mailcow_port: 443 +keycloak_port: 8081 +stepca_port: 9000 +wazuh_port: 55000 + +# ๐Ÿ“ฆ Container Images +nextcloud_aio_image: nextcloud/all-in-one:latest +keycloak_image: quay.io/keycloak/keycloak:24.0.2 +mailcow_image: mailcow/mailcow-dockerized:latest + +# ๐Ÿ“ Directories +nextcloud_data_dir: /srv/nextcloud +mailcow_data_dir: /opt/mailcow +backup_base_dir: /srv/backups +logs_dir: /var/log/open-cmmc + +# ๐Ÿ“‚ Backup Configuration +restic_password: changeme-securely +restic_repo: /srv/backups/restic-repo + +# โš™๏ธ System Users +svc_keycloak: svc_keycloak +svc_mailcow: svc_mailcow +svc_wazuh: svc_wazuh +svc_stepca: svc_stepca diff --git a/evidence/07_policies/login_banner_policy.md b/evidence/07_policies/login_banner_policy.md new file mode 100644 index 0000000..d083020 --- /dev/null +++ b/evidence/07_policies/login_banner_policy.md @@ -0,0 +1,17 @@ +# System Login Banner Policy + +## Organization: {{ organization_name }} + +All OpenCMMC Stack systems must display the following login banner on all remote or interactive login attempts (TTY, SSH, GUI): + +--- + +{{ login_banner_text }} + +--- + +## Applicability +This policy applies to all systems governed under the OpenCMMC Stack deployment in production or pre-production use. + +## CMMC Mapping +- AC.3.017 โ€“ Display system use notification before granting access. diff --git a/evidence/99_preflight/summary.md b/evidence/99_preflight/summary.md new file mode 100644 index 0000000..73e7be6 --- /dev/null +++ b/evidence/99_preflight/summary.md @@ -0,0 +1,13 @@ +# ๐Ÿงช Preflight Validation Summary + +This file summarizes the results of pre-deployment environment validation checks performed by the `preflight` role. + +## Checks Included: +- โœ… DNS resolver reachability +- โœ… Domain and hostname resolution +- โœ… Valid administrator email format +- โœ… SSH key presence and format +- โœ… Port conflict scan + +## Last Run: +_Not yet executed_ diff --git a/evidence/evidence_index.md b/evidence/evidence_index.md new file mode 100644 index 0000000..ba3517b --- /dev/null +++ b/evidence/evidence_index.md @@ -0,0 +1,15 @@ +# ๐Ÿ“ Evidence Index + +This directory contains autogenerated audit artifacts from the OpenCMMC Stack deployment process. Each subfolder corresponds to a control area or implementation phase. + +## Index of Evidence + +- [00_scoping](00_scoping/) +- [01_identity_access](01_identity_access/) +- [02_system_hardening](02_system_hardening/) +- [03_file_sharing](03_file_sharing/) +- [04_email](04_email/) +- [05_monitoring](05_monitoring/) +- [06_backups](06_backups/) +- [07_policies](07_policies/) +- [99_preflight_checks](99_preflight_checks/) diff --git a/tools/README.md b/tools/README.md new file mode 100644 index 0000000..23da4d0 --- /dev/null +++ b/tools/README.md @@ -0,0 +1,20 @@ +# ๐Ÿ› ๏ธ OpenCMMC Stack Tools + +This directory contains helper scripts to streamline and automate deployment configurations. + +## Files + +- `generate_group_vars.py`: Converts the master `deployment_config.yml` into the Ansible `group_vars/all.yml`. + +## Usage + +```bash +python3 tools/generate_group_vars.py +``` + +Ensure `deployment_config.yml` is located in the project root. + +### Prerequisites + +- Python 3.x +- PyYAML (`pip install pyyaml`) diff --git a/tools/generate_group_vars.py b/tools/generate_group_vars.py new file mode 100644 index 0000000..88eba09 --- /dev/null +++ b/tools/generate_group_vars.py @@ -0,0 +1,50 @@ +import yaml + +# Load deployment_config.yml +with open('deployment_config.yml', 'r') as f: + deployment_config = yaml.safe_load(f) + +# Flattened structure for group_vars/all.yml +group_vars = { + 'default_user': deployment_config['global_admin_username'], + 'default_shell': '/bin/bash', + 'ssh_authorized_key': deployment_config['admin_ssh_public_key'], + 'global_admin_email': deployment_config['global_admin_email'], + 'domain_name': deployment_config['domain_name'], + 'hostname': deployment_config['hostname'], + 'timezone': deployment_config['timezone'], + 'dns_resolver_ip': deployment_config['dns_resolver_ip'], + 'ssh_port': deployment_config['ssh_port'], + 'disable_root_ssh': deployment_config['disable_root_ssh'], + 'enforce_key_authentication': deployment_config['enforce_key_authentication'], + 'nextcloud_port': deployment_config['nextcloud_port'], + 'mailcow_port': deployment_config['mailcow_port'], + 'keycloak_port': deployment_config['keycloak_port'], + 'stepca_port': deployment_config['stepca_port'], + 'wazuh_port': deployment_config['wazuh_port'], + 'tailscale_auth_key': deployment_config['tailscale_auth_key'], + 'mailcow_hostname': deployment_config['mailcow_hostname'], + 'mailcow_admin_user': deployment_config['mailcow_admin_user'], + 'mailcow_admin_password': deployment_config['mailcow_admin_password'], + 'mailcow_letsencrypt_email': deployment_config['mailcow_letsencrypt_email'], + 'mailcow_use_letsencrypt': deployment_config['mailcow_use_letsencrypt'], + 'keycloak_realm': deployment_config['keycloak_realm'], + 'nextcloud_aio_image': deployment_config['nextcloud_aio_image'], + 'keycloak_image': deployment_config['keycloak_image'], + 'mailcow_image': deployment_config['mailcow_image'], + 'nextcloud_data_dir': deployment_config['nextcloud_data_dir'], + 'mailcow_data_dir': deployment_config['mailcow_data_dir'], + 'backup_base_dir': deployment_config['backup_base_dir'], + 'logs_dir': deployment_config['logs_dir'], + 'restic_password': deployment_config['restic_password'], + 'restic_repo': deployment_config['restic_repo'], + 'svc_keycloak': deployment_config['svc_keycloak'], + 'svc_mailcow': deployment_config['svc_mailcow'], + 'svc_wazuh': deployment_config['svc_wazuh'], + 'svc_stepca': deployment_config['svc_stepca'], + 'banner_text': deployment_config['banner_text'] +} + +# Save to group_vars/all.yml +with open('group_vars/all.yml', 'w') as f: + yaml.dump(group_vars, f, sort_keys=False, default_flow_style=False)