The concept Security lives in the backend
Module 06 designed the security architecture; now the code enforces it: authentication, role- or policy-based authorization, API access restrictions, input validation, secret management, sensitive-data handling, audit and safe error handling. Security cannot depend on what the UI shows.
javaAuthorization on the method, not on the screen (Spring Security sketch)
@PostMapping("/{id}/approve")
@PreAuthorize("hasRole('FINANCE_SUPERVISOR')")
ResponseEntity<CaseResponse> approve(@PathVariable String id, Authentication user) {
return ResponseEntity.ok(cases.approve(id, user.getName())); // maker-checker checked inside
}Who may do what The initial role model
| Role | May | May not |
|---|---|---|
| Finance analyst | View permitted transactions, investigate assigned cases, add notes, submit resolutions | Approve resolutions |
| Finance supervisor | Review investigations, approve or reject resolutions submitted by others, view relevant audit | Approve their own submissions |
| Customer support | View approved transaction status | Any case action or financial operation |
| Platform administrator | Run approved platform operations | Business approvals, by default |
These are a starting point: Apex must approve the actual permissions. The platform administrator deliberately has no automatic business approval rights; operating the system and approving money are separate duties.
Keep them out Configuration, secrets and logs
- Environment-specific configuration, with secrets from AWS Secrets Manager or an approved store.
- Workload identity (IAM roles) instead of long-lived keys, and credential rotation.
- Least-privilege database users: the application cannot drop tables or edit audit rows.
- No real secrets in Git, ever, and a secret scanner in the pipeline to catch mistakes.
- Structured logs with safe identifiers and correlation IDs; never passwords, tokens, full payment credentials, unnecessary personal data or raw source payloads.
Before release The production readiness checklist
Practice Run a readiness review
Practical exercise
Exercise 11: the production readiness assessment
Review the application as if it ships tomorrow.
- Authentication and authorization tests for every role and endpoint.
- Secret-management verification and a sensitive-data logging review.
- Dependency and vulnerability scan results.
- Health and readiness endpoints, and the production configuration checklist.
- Security findings with a remediation plan.
Show sample findings
- High: the notes endpoint logged the full request body, including loan account data. Fix: log the case ID and correlation ID only.
- Medium: one library had a known vulnerability. Fix: upgrade, and fail the build on high-severity findings.
- Low: the readiness check did not include the broker. Fix: report NOT READY when the outbox publisher cannot connect.
2 questions
Check your understanding
What you can do now
- Enforce authorization in backend code.
- Propose a least-privilege role model.
- Keep secrets and sensitive data out of code and logs.
- Run a production readiness review with evidence.