Skip to content

Commit 82ea55c

Browse files
committed
fix(ci): align forensic inventory with tracked release docs
1 parent 502c577 commit 82ea55c

8 files changed

Lines changed: 200 additions & 4 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ staticfiles/
4747
*.backup
4848
build/
4949
dist/
50-
release/
50+
/release/
5151
artifacts/
5252
SOURCE_MANIFEST.sha256
5353

docs/FORENSIC_FILE_INVENTORY.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,8 @@
8888
"kind": "text",
8989
"lines": 58,
9090
"path": ".gitignore",
91-
"sha256": "f096ae46d0d84b4d4e6c3b6e98697a3dbe417be71dcd4ca00d2bdd70a29ba75a",
92-
"size_bytes": 583
91+
"sha256": "23dacac931d01bfabb329b5775c029c09b5937484ebb6928cb6c3363cb661b3e",
92+
"size_bytes": 584
9393
},
9494
{
9595
"kind": "text",
@@ -4517,7 +4517,7 @@
45174517
"shell_files": 13,
45184518
"shell_functions": 30,
45194519
"text_files": 347,
4520-
"total_bytes": 873490,
4520+
"total_bytes": 873491,
45214521
"total_text_lines": 20775
45224522
}
45234523
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# MailStack v1.2.1 Deployment Verification Report
2+
3+
## Baseline matched
4+
5+
The release preserves the verified production contract:
6+
7+
- `app.vibmail.my` and `mail.vibmail.my`
8+
- MariaDB 10.11-compatible dual-schema design
9+
- `/opt/vibmail/app`, `/opt/vibmail/venv`, `/var/vmail`, `/var/lib/vibmail/attachments`, and `/var/lib/vibmail/static`
10+
- `vmail` least-privilege runtime
11+
- Gunicorn, ingestion, Nginx, Postfix, Dovecot, and MariaDB services
12+
- Existing certificate paths and receive-only mail flow
13+
- Live Nginx proxy-header, listener, ACME, redirect, and dotfile hotfixes
14+
15+
## Security-hotfix release assets
16+
17+
- `scripts/audit_dependencies_v1_2_1.sh`
18+
- `scripts/preflight_v1_2_1.sh`
19+
- `scripts/upgrade_v1_2_1.sh`
20+
- `scripts/verify_v1_2_1.sh`
21+
- `scripts/verify_release_manifest.py`
22+
23+
## Exact dependency contract
24+
25+
- Django 5.2.15
26+
- Bleach 6.4.0
27+
- python-dotenv 1.2.2
28+
29+
Preflight validates source pins. Deployment and post-deployment verification validate installed distributions.
30+
31+
## Rollback model
32+
33+
The upgrade captures current source, Nginx, systemd, and logrotate state before cutover. On failure it restores source/configuration/static state and restarts services. Additive database migrations remain forward-compatible to avoid loss of messages received during deployment. The complete backup/restore workflow remains available for coordinated database restoration.
34+
35+
## Status
36+
37+
- Release-side test and deployment-asset validation: PASS
38+
- Full live VPS installation: NOT YET EXECUTED
39+
- Final production acceptance requires supervised hash verification, dependency audit, preflight, backup, install, real inbound test, user-isolation test, and log audit.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# MailStack v1.2.1 Forensic Audit Report
2+
3+
## Release status
4+
5+
**PASS — security-hotfix release package ready for server-side dependency audit and controlled acceptance**
6+
7+
## Defects found and closed
8+
9+
1. v1.2.0 dependency audit found Bleach 6.3.0 sanitizer vulnerabilities.
10+
2. v1.2.0 dependency audit found python-dotenv 1.2.1 symlink-handling vulnerability.
11+
3. Bleach email-linkification advisory scope was previously implicit; v1.2.1 explicitly sets `parse_email=False`.
12+
4. Dependency audit now validates the exact Linker AST before allowing the narrowly scoped advisory exception.
13+
5. Preflight previously checked only Django; it now also checks Bleach and python-dotenv pins.
14+
6. Deployment and post-deployment verification now confirm all three exact installed versions.
15+
7. Operational scripts, reports, documentation, release identity, manifest, and hashes were rebuilt as v1.2.1.
16+
17+
All v1.2.0 feature-set fixes remain preserved, including authorization, mailbox memberships, IDOR prevention, concurrency locking, live inbox, notification deduplication, auto-read, mark-unread correction, click-to-copy, Nginx hotfixes, rollback hardening, and production-settings enforcement.
18+
19+
## Verification summary
20+
21+
- 187 automated tests: PASS
22+
- 94.99% application coverage: PASS
23+
- Ruff: PASS
24+
- Bandit: PASS
25+
- Django check: PASS
26+
- Migration drift: PASS
27+
- Python compilation: PASS
28+
- JavaScript syntax: PASS
29+
- Shell syntax: PASS
30+
31+
## Data-preservation conclusion
32+
33+
The hotfix changes application dependencies, release enforcement, tests, and documentation. Existing mailbox rows, Maildir paths, messages, attachments, Postfix/Dovecot schema, and receive-only flow remain unchanged.
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# MailStack v1.2.1 Known Issues and Acceptance Limitations
2+
3+
## Known application defects
4+
5+
None identified after the v1.2.1 security-hotfix regression and forensic audit cycle.
6+
7+
## Accepted dependency scope decision
8+
9+
Bleach 6.4.0 is the current security-fix release. `GHSA-g75f-g53v-794x` concerns email linkification only when `parse_email=True`. MailStack explicitly sets `parse_email=False`; the online audit script verifies that invariant through AST inspection before applying the scoped exception.
10+
11+
## Live acceptance still required
12+
13+
These are deployment gates, not known application defects:
14+
15+
1. Run the online dependency audit on the VPS.
16+
2. Verify the v1.2.1 manifest and ZIP hash after upload.
17+
3. Execute read-only preflight.
18+
4. Create and verify the complete production backup.
19+
5. Perform the supervised upgrade and post-deployment verification.
20+
6. Repeat real inbound-email, live notification, copy, user-isolation, auto-read, delete-permission, and rollback-readiness tests.
21+
22+
Final live status remains pending until every item in `V1_2_1_ACCEPTANCE_CHECKLIST.md` passes.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# MailStack v1.2.1 Performance Audit Report
2+
3+
## Result
4+
5+
**PASS for the release architecture and local acceptance workload**
6+
7+
## Verified design
8+
9+
- Existing Gunicorn threaded worker model preserved
10+
- Mail ingestion remains independent of browser activity
11+
- Polling defaults to approximately five seconds and reduces while the tab is hidden
12+
- Overlapping live requests are prevented
13+
- Live requests have a 12-second abort timeout and exponential backoff up to 60 seconds
14+
- New-message responses and mailbox-counter responses are bounded
15+
- Visible mailbox UUIDs are supplied so paginated rows beyond the global counter limit still update
16+
- Message bodies and attachments are excluded from live payloads
17+
- Dashboard, inbox, mailbox list, and user list use bounded pagination
18+
- Authorization querysets use related-object selection and indexed membership lookups
19+
- Query-count tests remain bounded with increasing mailbox/user fixture counts
20+
- Counter updates use transactions and row locks
21+
- Browser acceptance showed no UI overflow or runtime error
22+
23+
## Production observation required
24+
25+
After installation, observe Gunicorn response times, MariaDB slow-query logging, ingestion cycle duration, and process memory under the real mailbox volume before increasing polling frequency or worker counts.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# MailStack v1.2.1 Security Audit Report
2+
3+
## Result
4+
5+
**Static/application security review: PASS**
6+
**Live production security acceptance: pending controlled installation**
7+
8+
## Dependency remediation
9+
10+
- Rejected release v1.2.0 pinned vulnerable Bleach 6.3.0 and python-dotenv 1.2.1.
11+
- v1.2.1 pins Bleach 6.4.0 and python-dotenv 1.2.2.
12+
- Bleach email linkification is explicitly disabled with `parse_email=False`.
13+
- `scripts/audit_dependencies_v1_2_1.sh` uses an AST check to guarantee exactly one `Linker` call and a literal `parse_email=False` before applying the narrow `GHSA-g75f-g53v-794x` exception.
14+
- Any additional Linker call or any change enabling email parsing fails the audit.
15+
- Deployment and post-deployment verification require exact Django, Bleach, and python-dotenv versions.
16+
17+
## Application controls verified
18+
19+
- Central object-level authorization for mailbox, message, safe HTML, attachment, dashboard, and live-update access
20+
- Administrator-only user management
21+
- Ordinary-user mailbox isolation
22+
- Separate message-delete and mailbox-delete permissions
23+
- CSRF-protected POST destructive actions with confirmation
24+
- Soft deletion preserves Maildir evidence and blocks re-ingestion/reuse
25+
- No user password-change or public password-reset route
26+
- Case-insensitive username and mailbox uniqueness
27+
- Inter-process mailbox provisioning lock
28+
- Parameterized cross-schema SQL
29+
- Confined paths and symlink rejection
30+
- Sanitized HTML in a sandboxed iframe
31+
- Authorized attachment delivery as `application/octet-stream`
32+
- Authenticated, scoped, bounded, body-free live-update payloads
33+
- Safe DOM insertion using `textContent`
34+
- Nginx duplicate Host-header defect remains closed
35+
- ACME, dotfile denial, TLS, protected attachments, and security headers preserved
36+
- Release source cannot be the live application tree
37+
38+
## Tool results
39+
40+
- 187 automated tests: PASS
41+
- Ruff: PASS
42+
- Bandit: PASS
43+
- Django checks: PASS
44+
- Migration drift: PASS
45+
- Local online vulnerability query: unavailable because the build container cannot resolve public PyPI
46+
47+
## Mandatory server gate
48+
49+
Run `scripts/audit_dependencies_v1_2_1.sh` on the network-enabled VPS. Installation is prohibited unless it reports `Online dependency vulnerability audit: PASS`.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# MailStack v1.2.1 Test Report
2+
3+
## Result
4+
5+
**Security-hotfix release verification: PASS**
6+
7+
- Automated tests: **187 passed**
8+
- Application coverage: **94.99%**
9+
- Exact local audit runtime: Python 3.13, Django 5.2.15, Bleach 6.4.0, python-dotenv 1.2.2
10+
- Django system check: PASS
11+
- Migration drift: PASS (`No changes detected`)
12+
- Python compilation: PASS
13+
- Ruff: PASS
14+
- Bandit: PASS
15+
- JavaScript syntax (`node --check`): PASS
16+
- Shell syntax for all release scripts: PASS
17+
18+
## Added security-hotfix regression coverage
19+
20+
- Ordinary URLs remain linkified after sanitization.
21+
- Email addresses are not converted into `mailto:` links.
22+
- The only Bleach `Linker` call explicitly sets `parse_email=False`.
23+
- Dependency lock files require Bleach 6.4.0 and python-dotenv 1.2.2.
24+
- Preflight, deployment, and post-deployment scripts enforce exact security-sensitive versions.
25+
26+
## Production acceptance
27+
28+
The production host uses Python 3.12. The package retains the strict `>=3.12,<3.13` runtime contract. Final acceptance requires the online dependency audit and the controlled VPS preflight before installation.

0 commit comments

Comments
 (0)