The concept Security belongs in the architecture
Security is not a final review before deployment. Apex handles financial transactions, loan account references, operational decisions and possibly sensitive customer data. Begin by finding the trust boundaries: the points where data or requests cross between environments with different security assumptions. External provider to Apex, public API gateway to private services, service to database, finance screen to backend API, account or network boundaries, and administrative access to production.
Who acts Security principals
The system has several kinds of identity: the payment provider integration, the banking integration, finance operations users, finance supervisors, customer support users, application service identities and platform administrators. They must not share unrestricted permissions.
Two questions Authentication and authorization
| Question | Answered by | Apex example |
|---|---|---|
| Who are you? | Authentication | A finance user signs in through the enterprise identity provider |
| What may you do? | Authorization | An analyst may investigate an assigned exception but not approve a high-risk adjustment; a supervisor may approve |
A provider may submit payment notifications but never read unrelated customer data. Design permissions around specific capabilities, and give every user and service only what its job needs (least privilege):
- Payment ingestion writes payment records.
- Reconciliation reads the relevant payment and settlement records and writes outcomes.
- Finance users access the exception cases assigned to them.
- Supervisors approve defined resolution actions.
- Reporting reads approved reporting data.
Protect the data In transit and at rest
Consider TLS for external and internal traffic where appropriate, encryption at rest, a managed key service, secret storage and rotation, database access restrictions, network segmentation, masking of sensitive data and protected backups.
High-risk operations Maker-checker approval
A reconciliation result can be produced automatically. Changing a financial record is a different operation. When an analyst asks for a manual resolution, the system records who asked, which record, why, who approved, what changed, when, and the supporting evidence. Depending on the customer’s controls, sensitive changes need maker-checker approval: one person initiates, another authorizes.
| Role | May | May not |
|---|---|---|
| Finance analyst | View transactions and exceptions; create resolution requests with a reason and evidence | Approve any request, including their own |
| Finance supervisor | Approve or reject other people's requests, within the approval limit | Approve a request they created; approve above the limit |
| Finance manager | Approve above the supervisor limit (amount to confirm with Apex) | Change audit records |
| Operations lead | Assign and reassign exception cases | Approve financial changes |
| Auditor | Read everything, including the audit history | Change anything |
| Provider integration | POST payment notifications for its own provider | Read any record |
| Reconciliation service | Write reconciliation results | Approve or change financial records |
Every rule is enforced in the backend, on every request. The service checks the caller's role, the approval limit, and that the approver is not the maker, before anything changes. A request that was already approved or rejected cannot be decided again. Hiding a button in the UI is a convenience, never a control: Module 07 tests these rules by calling the API directly.
Think like an attacker A threat model
| Threat | Possible mitigation |
|---|---|
| Forged provider notification | Signature verification and authenticated integration |
| Unauthorized case access | Role- and attribute-based authorization |
| Duplicate financial processing | Idempotency and unique constraints |
| Sensitive data exposed in logs | Masking and structured logging controls |
| Compromised service credentials | Short-lived credentials and least privilege |
| Unauthorized manual adjustment | Approval workflow and an unchangeable audit trail |
| Malicious or malformed input | Validation and safe parsing |
| Excessive API traffic | Rate limiting and abuse monitoring |
Practice Review the security architecture
Practical exercise
Exercise 06: the security architecture document
Produce the security design for Apex.
- A trust-boundary diagram with external, public-facing, private application, data and administrative zones.
- An identity and permission matrix.
- A list of sensitive data fields.
- Encryption and secret-management requirements.
- A threat and mitigation register.
- An approval and audit design for manual adjustments.
Show sample matrix rows
- Provider A integration: may POST payment notifications; may not read any record.
- Finance analyst: may read assigned cases and request resolutions; may not approve.
- Finance supervisor: may approve or reject resolution requests made by someone else.
- Reconciliation service: reads payments and settlements, writes results; no access to identity data.
- Platform administrator: production access only through an approved, audited session.
3 questions
Check your understanding
What you can do now
- Find trust boundaries and the checks each one needs.
- Design least-privilege permissions per identity.
- Plan data protection and secret management.
- Design maker-checker approval with a complete audit record.
← Lesson 05: Event-Driven Architecture and Transaction Integrity