# Remediation Plan

> [← Back to Summary](./summary.md) | [Maintenance Burden](./maintenance-burden.md)

## Priority 1: Critical Security Fixes — 🔴

### REM-001: Implement Password Hashing
- **Addresses:** SEC-001 (Plaintext passwords)
- **Action:** Modify COSGN00C and USRSEC file handling to store hashed passwords
- **Approach:** Use CICS LINK to a hashing utility program; migrate existing passwords

### REM-002: Remove Default Credentials
- **Addresses:** SEC-002 (Public credentials)
- **Action:** Remove hardcoded credentials from README.md; implement first-login password change

### REM-003: Enable RACF Security
- **Addresses:** SEC-003 (RACF disabled)
- **Action:** Update CSD definitions: set RESSEC(YES) and CMDSEC(YES) on all transactions
- **Dependencies:** Requires RACF profile definitions for all transactions and resources

### REM-004: Encrypt Sensitive Data
- **Addresses:** SEC-004 (Unencrypted PII/PCI)
- **Action:** Implement field-level encryption for CARD-NUM, CARD-CVV-CD, CUST-SSN
- **Approach:** Use z/OS ICSF services or application-level encryption routines

### REM-005: Enable Journaling
- **Addresses:** SEC-005 (No recovery)
- **Action:** Update CSD: set JOURNAL(YES) and RECOVERY(BACKOUTONLY) on critical files
- **Dependencies:** Requires journal log stream setup

## Priority 2: High Complexity Reduction — 🟠

### REM-006: Decompose COACTUPC
- **Addresses:** 4,236 line program with 51 GO TOs
- **Action:** Split into: validation sub-program, display logic, update logic, date validation module
- **Target:** Each resulting program under 1,000 lines

### REM-007: Refactor GO TO Statements
- **Addresses:** GO TO usage in 8 programs
- **Action:** Replace GO TO with structured PERFORM THRU patterns
- **Priority:** Start with COACTUPC (51 GO TOs), then COCRDUPC (21), COCRDLIC (16)

### REM-008: Simplify COPY REPLACING
- **Addresses:** Repetitive CSSETATY COPY REPLACING in COACTUPC, COTRTUPC
- **Action:** Create a single validation paragraph that iterates through field list

## Priority 3: Code Quality — 🟡

### REM-009: Remove Unused Copybook
- **Addresses:** UNUSED1Y.cpy
- **Action:** Verify non-use, remove from repository

### REM-010: Consolidate Customer Records
- **Addresses:** Duplicate CUSTREC.cpy and CVCUS01Y.cpy
- **Action:** Standardize on CVCUS01Y.cpy; update CBSTM03A to use CVCUS01Y

### REM-011: Standardize File Extensions
- **Addresses:** Mixed .cbl/.CBL, .cpy/.CPY, .jcl/.JCL
- **Action:** Rename all files to lowercase extensions

### REM-012: Implement Audit Logging
- **Addresses:** SEC-008 (No audit trail)
- **Action:** Add CICS journal writes or audit VSAM file for key operations

## Priority 4: Modernization Pathways

### Option A: Replatform to AWS M2
- Move COBOL workloads to AWS Mainframe Modernization managed runtime
- Minimal code changes; preserves existing COBOL/CICS patterns
- Addresses infrastructure cost and scalability concerns
- **Recommended starting point** for organizations wanting to reduce mainframe costs quickly

### Option B: Refactor to Modern Languages
- Convert COBOL programs to Java, C#, or other modern languages
- Use automated refactoring tools + manual review
- Modernize data layer from VSAM to relational database (RDS, Aurora)
- Replace BMS maps with web UI
- **Higher complexity** but enables cloud-native architecture

### Option C: Re-architect as Microservices
- Decompose monolithic application into bounded contexts:
  - Account Service, Card Service, Transaction Service, User Service, Auth Service, Reporting Service
- Implement API-first design with REST/GraphQL
- Use AWS services: Lambda, API Gateway, DynamoDB/RDS, SQS/SNS
- **Highest complexity** but maximum modernization benefit

---

*See also: [Technical Debt Report](../technical-debt-report.md) | [Migration Component Order](../migration/component-order.md)*
