Skip to content

docs(infra): cPanel/WHM/STX/OpenStack/HostBill workflow guide#54

Merged
rooz-live merged 2 commits intomainfrom
docs/infra-workflow-improvements
Apr 10, 2026
Merged

docs(infra): cPanel/WHM/STX/OpenStack/HostBill workflow guide#54
rooz-live merged 2 commits intomainfrom
docs/infra-workflow-improvements

Conversation

@rooz-live
Copy link
Copy Markdown
Owner

Summary

Adds `docs/INFRA_WORKFLOW.md` — the operational reference for the unified infra automation layer delivered across Phases 1–6.

What was built (Phases 1–6)

Phase Key Files Description
1 — Credential bootstrap `.env.cpanel.example`, `cpanel-env-setup.sh`, `group_vars/all.yml` Single-source credential file; `--persist`, `--register-launchd`, `--all` flags
2 — SSL monitor `com.agentic-flow.ssl-monitor.plist` Durable launchd service; runs every 4 hours
3 — HostBill real API `hostbill_api_client.py` `RealHostBillAPIClient` (stdlib urllib) + `HostBillAPIClient.from_env()` factory; `dry_run=True` default
4 — Unified health runner `run-health.sh`, `openstack-status.yml` Single entry point for all passive checks; OpenStack preflight guard
5 — Semgrep hardening `.semgrep.yml` nginx `proxy_pass` variable+URI rule, cPanel token-in-URL, subprocess injection, `os.system()`
6 — WHM + Paramiko `whm-firewall-check.sh`, `cpanel_ssh_client.py` `--confirm` write gate + audit log; Paramiko SSH client with write blocklist

Test results

50/50 assertions pass. All files validated with `bash -n`, `python3 -m py_compile`, YAML parse, and functional tests.

Documentation covers

  • Quick start (3-step bootstrap)
  • Credential lifecycle and Ansible integration
  • `run-health.sh` targets and execution order
  • SSL monitor, DNS zone manager, Paramiko SSH client
  • WHM passive vs active operations with `--confirm` gate
  • HostBill real/mock client with CLI and Python examples
  • Ansible playbook matrix with risk levels
  • Semgrep rules reference
  • Active vs passive operation boundary table

Links

Co-Authored-By: Oz oz-agent@warp.dev

Rooz and others added 2 commits April 10, 2026 15:56
Covers all 6 phases delivered in feat(infra/phase1) and feat(infra/phases2-6):
- Quick start (3-step bootstrap)
- Credential file setup (.env.cpanel lifecycle)
- Passive health runner (run-health.sh reference)
- cPanel/WHM scripts (SSL monitor, DNS, Paramiko SSH)
- WHM firewall (passive vs active, --confirm gate)
- HostBill API (real/mock client, CLI, Python usage)
- Ansible playbooks (full matrix with risk level)
- Security scanning (.semgrep.yml rules, CodeQL, Scorecard)
- Active vs passive operation reference table
- Embedded quick test suite

Co-Authored-By: Oz <oz-agent@warp.dev>
- Add ssh_lines() and ssh_count() safe helpers that never fail pipelines
- ssh_count() extracts clean integers from SSH grep -c (handles PowerDNS
  warning lines mixed with numeric output)
- Narrow upstream regex to 'upstream NAME' blocks only, skip tokens
  without dots, variables, short fragments — eliminates false positives
- Make 'recently modified configs' informational (info() not warn())
- Fix PHP-FPM glob: use explicit ea-php84-php-fpm instead of shell glob
  through SSH
- drift-check.sh now exits 0 on clean infrastructure

Co-Authored-By: Oz <oz-agent@warp.dev>
@github-actions
Copy link
Copy Markdown

✅ Security Scan Results

Severity Count
🔴 Critical 0
🟠 High 0
🟡 Moderate 3
🟢 Low 4

Status: ✅ No high/critical vulnerabilities

What to do if vulnerabilities are found
  1. Run npm audit locally to see details
  2. Run npm audit fix to attempt automatic fixes
  3. For breaking changes, manually update dependencies
  4. If vulnerabilities are in dev-only dependencies, consider if they're acceptable

@augmentcode
Copy link
Copy Markdown

augmentcode bot commented Apr 10, 2026

🤖 Augment PR Summary

Summary: Adds a consolidated infrastructure operations guide for the repo’s automation layer spanning cPanel/WHM, STX/OpenStack, and HostBill.

Changes:

  • Introduces docs/INFRA_WORKFLOW.md as the end-to-end operator reference
  • Documents credential bootstrap via cpanel-env-setup.sh and the shared .env.cpanel contract
  • Explains the unified passive health runner (scripts/infra/run-health.sh) and its dependency-ordered execution
  • Captures cPanel utilities (SSL monitor LaunchAgent, DNS zone manager) and the Paramiko-based SSH client safety model
  • Describes WHM firewall tooling with a --confirm write gate and audit logging
  • Details HostBill client behavior (real vs mock selection; dry-run default for writes)
  • Summarizes Ansible playbook matrix (targets, risk levels, and opt-in write behavior)
  • Includes local security scanning notes (Semgrep + CodeQL/Scorecard workflows)

Technical Notes: Emphasizes a passive-by-default workflow with explicit opt-in flags for any operation that could mutate production state.

🤖 Was this summary useful? React with 👍 or 👎

Copy link
Copy Markdown

@augmentcode augmentcode bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 4 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread docs/INFRA_WORKFLOW.md
**Template**: `scripts/infra/credentials/.env.cpanel.example`
**Status**: gitignored — never committed

The credential file is the single source of truth for:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs/INFRA_WORKFLOW.md:L36 — This section says the credential file is the “single source of truth”, but the table below omits several variables that exist in scripts/infra/credentials/.env.cpanel.example (e.g., STX_HOST, STX_SSH_PORT, OS_PROJECT_NAME, GITHUB_TOKEN, PASSBOLT_KEY_FILE) and also doesn’t mention WHM_HOST/WHM_USER which whm-firewall-check.sh requires. That mismatch can cause operators to think they’re fully configured when they’re not.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread docs/INFRA_WORKFLOW.md
**Plist**: `scripts/infra/cpanel/com.agentic-flow.ssl-monitor.plist`

Runs every 4 hours as a macOS LaunchAgent. Reads credentials from
`scripts/infra/credentials/.env.cpanel` and checks SSL certificate expiry
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs/INFRA_WORKFLOW.md:L122 — The doc states the LaunchAgent “reads credentials from scripts/infra/credentials/.env.cpanel”, but the current com.agentic-flow.ssl-monitor.plist sources $HOME/Documents/code/scripts/infra/credentials/.env.cpanel (hard-coded checkout path). This can lead to a non-functional LaunchAgent on machines where the repo is located elsewhere.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread docs/INFRA_WORKFLOW.md

Runs every 4 hours as a macOS LaunchAgent. Reads credentials from
`scripts/infra/credentials/.env.cpanel` and checks SSL certificate expiry
for all domains in `group_vars/cpanel.yml`.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs/INFRA_WORKFLOW.md:L123 — This claims the SSL monitor checks “all domains in group_vars/cpanel.yml”, but cpanel-ssl-monitor.sh currently uses a hard-coded domains=("rooz.live" "yo.life" "yoservice.com") list. The operational behavior described here doesn’t match what actually runs.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

Comment thread docs/INFRA_WORKFLOW.md
Run locally to verify all phases:

```bash
cd /Users/shahroozbhopti/Documents/code
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docs/INFRA_WORKFLOW.md:L350 — The test snippet uses an absolute local path (/Users/shahroozbhopti/Documents/code) as the repo root, which can be misleading for other operators following the workflow. Consider clarifying that this should be run from the repository root on their machine.

Severity: low

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@rooz-live rooz-live merged commit 2d521f0 into main Apr 10, 2026
24 of 44 checks passed
@rooz-live rooz-live deleted the docs/infra-workflow-improvements branch April 10, 2026 20:02
@rooz-live
Copy link
Copy Markdown
Owner Author

Deployment Complete ✅

Tag: v1.0.0-infra on main @ 2d521f05
Date: 2026-04-10 20:08 UTC

Infrastructure Remediation Summary

Passbolt Server (passbolt.yocloud.com)

  • Fixed HTTP 500: installed gnupg + gd PHP extensions for ea-php84
  • Fixed SSL: disabled broken DNSSEC on child zone, set NSEC3 opt-out=1 on parent, triggered AutoSSL
  • New Let's Encrypt cert valid until 2026-07-09

rooz.live

  • SSL renewed via AutoSSL, valid until 2026-07-09

Drift Detection Suite Deployed

  • 5 audit scripts in scripts/infra/ (DNS, SSL, firewall, Nginx, orchestrator)
  • launchd agent running every 4 hours
  • Firewall baseline updated (ports 853, 6556, 8443)

Final Audit Result

╔══════════════════════════════════════════════╗
║  RESULT: ALL CLEAR ✓                        ║
╚══════════════════════════════════════════════╝
- SSL Monitor:    ALL CLEAR (4 domains, 36-89d remaining)
- DNS/DNSSEC:     ALL CLEAR (41 zones, 8 child zones verified)
- Firewall:       ALL CLEAR (ports match baseline, CSF production)
- Nginx:          ALL CLEAR (syntax OK, PHP-FPM running, 6/6 extensions)

cc @rooz-live

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant