The previous module ended with an invitation to look at the platform diagram with different eyes. Where RouteManager had one server behind a firewall, the Rutaverde platform has more than a dozen components, two environments (the Zaragoza data center and the cloud), a link that joins them, a CDN, an event bus, several stores with recipient data, and three external providers. Four questions were also deliberately left for later: whether internal traffic should be encrypted, what can be stored in a cache, how to keep someone from enumerating the tracking codes, and which user accesses which database schema.
In this module, Clara, the head of security (CISO), moves to the foreground. We will work with her from the architect's point of view: we are not going to configure tools or hunt for flaws in the code, but to make the structural decisions that make a system defensible. This first lesson provides the vocabulary and the method: what is protected, from what, with which principles, and who answers for each thing. We will finish with the asset inventory of the platform and with the list of RouteManager security findings that the rest of the module will close one by one.
Warning. This module covers security and data protection from the standpoint of technical design. Legal and regulatory obligations (GDPR, industry regulations, contracts) depend on each organization and must always be reviewed with regulatory compliance professionals and legal counsel. All the data in the case is fictitious.
Contents
- What it means for a system to be secure: the properties
- Assets, threats, vulnerabilities, and risk
- Controls: preventive, detective, and corrective
- Secure design principles
- The responsibility model: who protects what
- Inventory and initial classification of Rutaverde's assets
- The starting point: security findings in RouteManager
- What it means for a system to be secure: the properties
"Secure" is not a single property. It breaks down into several, and each one is defended by different means. The three classic ones form the CIA triad (confidentiality, integrity, availability):
| Property | What it guarantees | Example of a breach at Rutaverde |
|---|---|---|
| Confidentiality | Only those who are authorized access the information | Someone enumerates the tracking codes and obtains the addresses of thousands of recipients |
| Integrity | Information and systems are not improperly altered | A shipment shows as DELIVERED without having been delivered |
| Availability | The service and the data are accessible when they are needed | A flood of requests leaves merchants unable to create shipments |
We already know availability: we devoted the last lesson of the previous module to it. What is new is that we now also consider failures that are caused on purpose. A denial-of-service attack and a Black Friday peak look very much alike from the load balancer's point of view; that is why several defenses from Module 2 (rate limiting, backpressure, CDN) are also security controls.
Two more properties, which an architect needs to keep in mind, are added to the triad:
| Property | What it guarantees | Example at Rutaverde |
|---|---|---|
| Authenticity | Whoever acts is who they claim to be, and the data comes from where it claims to come from | The request that arrives with an API key really belongs to that merchant; the event on the bus really was published by the monolith |
| Traceability and non-repudiation | There is a record of who did what and when, in a way that cannot be denied | It can be proven which courier confirmed a delivery, at what time, and with what evidence |
These properties conflict with one another and with other quality attributes. Encrypting everything protects confidentiality and costs performance; requiring more verification improves authenticity and adds friction; keeping more logs improves traceability and creates a new data store to protect. Security, like the rest of architecture, is a matter of trade-offs. Recall how it was left in the requirements: it is not one more attribute on the priority list, but a mandatory constraint (NFR-09), and principle P7 says the platform must be secure by design.
- Assets, threats, vulnerabilities, and risk
Security is reasoned about with five linked concepts. It is worth learning them precisely, because everyday language mixes them up.
- Asset: anything that has value for the organization and deserves protection. Data, services, servers, credentials, and also reputation.
- Threat: something that could cause harm to an asset. It can be intentional (an attacker, a disloyal employee) or accidental (a configuration error, a careless deletion).
- Vulnerability: a weakness that a threat can exploit. A design flaw, an insecure configuration, a process with no checks.
- Risk: the possibility that a threat exploits a vulnerability and causes harm, assessed by its likelihood and its impact.
- Control (or safeguard): a measure that reduces risk.
flowchart LR
TH["Threat: someone wants recipient data"]
VU["Vulnerability: consecutive tracking codes"]
AS["Asset: personal data of the recipients"]
RI["Risk: massive data leak"]
CO["Control: random codes and rate limiting"]
TH -->|"exploits"| VU
VU -->|"exposes"| AS
AS -->|"harm to it is the"| RI
CO -->|"reduces"| RI
The diagram reads from left to right: a threat exploits a vulnerability, which exposes an asset; the possible consequence is the risk, and the control acts by reducing it. Notice that without a threat there is no risk even if the vulnerability exists, and without a vulnerability the threat gets nowhere. The architect works mainly on two points: eliminating design vulnerabilities and adding controls.
Assessing risk: likelihood times impact
Risk is assessed with a simple formula:
There is no need for a precision we do not have. A three-level scale for each factor is enough, defined with criteria the whole team understands in the same way:
| Level | Likelihood | Impact |
|---|---|---|
| 1 Low | Requires uncommon means or knowledge; there are no known cases | Internal nuisance; no personal data affected; no effect on the service |
| 2 Medium | Possible with ordinary knowledge; it has happened at similar companies | Affects some merchants or a limited set of data; one-off SLA breach |
| 3 High | Easy and automatable; anyone can try it from the Internet | Massive leak of personal data, prolonged outage of critical functions, or significant financial fraud |
Multiplying the two gives the risk matrix:
| Likelihood \ Impact | 1 Low | 2 Medium | 3 High |
|---|---|---|---|
| 3 High | 3 Medium | 6 High | 9 High |
| 2 Medium | 2 Low | 4 Medium | 6 High |
| 1 Low | 1 Low | 2 Low | 3 Medium |
Rutaverde will read it this way: from 1 to 2, low risk (it is accepted and reviewed once a year); from 3 to 4, medium (its treatment is planned); from 6 to 9, high (it is treated before the component goes into production). The same calculation, expressed as a very simple function:
def risk_level(likelihood, impact):
value = likelihood * impact
if value >= 6:
return value, "high"
if value >= 3:
return value, "medium"
return value, "low"
print(risk_level(3, 3)) # enumerable tracking codes
print(risk_level(1, 3)) # physical theft of a data center server- The function takes two numbers from 1 to 3 and multiplies them.
- The
ifstatements translate the product into one of the three categories; the most serious one is checked first. - The first call returns
(9, 'high'): enumerating consecutive codes is easy and automatable (likelihood 3) and exposes personal data in bulk (impact 3). - The second returns
(3, 'medium'): the impact would be high, but the data center has physical access control and the likelihood is low.
The matrix does not produce truths; it produces orderly conversations. Its value lies in forcing the team to justify each number and in making it possible to compare risks with one another. In the last lesson of the module we will use it to prioritize the threats to two specific flows.
- Controls: preventive, detective, and corrective
Controls are classified by the moment at which they act relative to the incident:
| Type | When it acts | Goal | Examples |
|---|---|---|---|
| Preventive | Before | Keep the incident from happening | Authentication, encryption, firewall rules, unguessable codes |
| Detective | During | Find out that it is happening | Audit logs, alerts on anomalous patterns, configuration reviews |
| Corrective | After | Limit the damage and recover | Revoking a credential, restoring a backup, failing over to a clean system |
A balanced design has controls of all three types for each important risk. The typical mistake is to invest everything in prevention and learn about an incident months later, from a third party. If prevention fails, and at some point it will, detection determines how long the incident lasts, and correction determines how much it costs.
Controls are also distinguished by their nature: technical (encryption), organizational (a procedure for onboarding and offboarding staff), and physical (the data center door). This module focuses on the technical ones that are decided in the architecture. Detection and operational response are developed together with monitoring in Module 4; the organizational ones, together with governance in Module 5.
- Secure design principles
Just as we distilled general design principles in the first module, security has its own. There are seven, and every decision in the module will rest on one of them.
Defense in depth
No control is infallible, so several independent layers are put in place: if one fails, the next one is still standing. To protect recipient data, the firewall is not enough: there will also be authentication, minimal permissions in the database, encryption, and access logging.
flowchart LR
A["Internet"] --> B["Edge: CDN and filtering"]
B --> C["Network: zones and firewalls"]
C --> D["Identity: authentication and permissions"]
D --> E["Application: input validation"]
E --> F["Data: encryption and least privilege"]
Each box in the diagram is a layer an attacker would have to get past. The condition is that the layers be independent: five controls that depend on the same password are a single layer.
Least privilege
Every person, service, or process receives only the permissions it needs for its task, and only for as long as it needs them. That way, when an identity is compromised, the damage is limited to what that identity could do. RouteManager's single database user is the textbook violation: a flaw in the Reports module gives write access to billing.
Secure by default
The initial state of any component must be the secure one; anything insecure must require an explicit, justified action. A newly created store is private; a port is closed until a rule opens it; a new account has no permissions. The reason is practical: most configurations are never reviewed after they are created.
Fail-safe
When a control fails, the system must end up in the secure state. If the service that checks permissions does not respond, the request is denied, not let through. This principle has to be reconciled with P4 and with the graceful degradation of the previous module, and the rule for reconciling them is clear: functionality is degraded, never access control. Making the tracking cache optional is correct; making authentication optional "if the identity server is slow" would not be.
Separation of duties
No single person should be able to complete a critical operation alone. Whoever writes a change does not approve it; whoever manages the encryption keys is not the one who reads the encrypted data; whoever grants a permission is not the one who requests it. This is not about distrusting people: it also protects against mistakes and against the theft of a single account.
Reducing the attack surface
The attack surface is the set of points through which someone could try to get in: open ports, published interfaces, accounts, dependencies, features nobody uses. The smaller it is, the less there is to defend. Every component added in Module 2 enlarged it; now it is time to trim everything that does not need to be exposed.
No reliance on obscurity
Security cannot depend on the attacker not knowing how the system works. An address "nobody knows," an unusual port, or a secret homegrown algorithm are not controls. The design must hold up even if the attacker has the diagrams from this course; the only thing that must remain secret is the keys. Obscurity can be added as an extra layer, never as the only one.
Relationship with Rutaverde's principles
| Security principle | How it develops Rutaverde's catalog |
|---|---|
| Defense in depth | P4: everything fails, controls included |
| Least privilege | P1: every piece of data has a single owner, and only the owner modifies it |
| Secure by default and fail-safe | P7: secure by design |
| Reducing the attack surface | P3: simple first; what does not exist cannot be attacked |
| Separation of duties | P6: what is automated can require approval from a second person |
- The responsibility model: who protects what
In RouteManager the answer was simple: everything was in the data center and everything was Rutaverde's responsibility. On the platform, the protection of each piece is shared among several parties, and the greatest danger lies in the gaps: whatever each party believes the other is protecting.
| Party | Protects | Does not protect |
|---|---|---|
| Rutaverde | Its applications, its data, identities and permissions, the configuration of everything it uses, the entire data center | The providers' facilities and physical infrastructure |
| Cloud provider | Its data centers, the hardware, the physical network, and the virtualization layer; the software of the managed services | How Rutaverde configures those services or whom it gives access to |
| SMS and email, maps, and ERP providers | Their own platforms and the data while they process it | The use Rutaverde makes of their credentials |
| Client merchants | The safekeeping of their API keys and of their employees' accounts on the portal | The platform itself |
| Couriers and internal staff | Their credentials and the device issued to them | The platform's technical controls |
Three ideas worth fixing in mind from now on:
- Responsibility can be shared; accountability cannot. If a provider suffers a leak of recipient data, merchants and authorities will look to Rutaverde. Choosing providers well and limiting the data they receive is part of the design.
- Configuration always belongs to the customer. A secure managed service, badly configured, is an insecure service. We will see the detailed split by type of service in the lesson on cloud security.
- Every asset needs a named owner. An asset without an owner is an unprotected asset.
- Inventory and initial classification of Rutaverde's assets
You cannot protect what you do not know about. The first job Clara asks of the architecture team is an asset inventory of the target platform, with an assessment of how much each property matters for each asset. We use three levels (high, medium, low) for confidentiality (C), integrity (I), and availability (A).
| Asset | Where it is | Owner | C | I | A |
|---|---|---|---|---|---|
| Recipient data: name, address, phone, email | db-01, shipments schema, and its replicas and backups |
Shipments module | High | High | High |
| Merchant data, rates, and contracts | db-01, customers schema |
Customers module | High | High | Medium |
| Invoices and billing data | db-01, billing schema; ERP |
Billing module | High | High | Medium |
| Shipment status for public lookup | db-tracking and cache-tracking |
Tracking service | Medium | High | High |
| Delivery photos and labels | Data center NAS | Delivery module | High | High | Medium |
| Domain events | event-bus and the shipments.outbox table |
Shipments module | Medium | High | High |
| Courier location | db-01, delivery schema |
Delivery module | High | Medium | Medium |
| Credentials: passwords, API keys, encryption keys, certificates | Today, scattered across configuration files | Security | High | High | High |
| Critical services: shipment creation, tracking, delivery | Monolith and Tracking | Operations | Medium | High | High |
| Backups and archive | NAS; in the future, object storage | Operations | High | High | Medium |
| Activity logs | Application servers | Operations | Medium | High | Medium |
| Source code and deployment configuration | Code repository | Architecture | Medium | High | Medium |
Several takeaways from this table:
- Recipient data is the most sensitive asset. It is the personal data of people who are not even Rutaverde's customers: they are the merchants' customers. It is also spread around: in the main database, in its two replicas, in the backups and, as we will see, in a few places where it should not be.
- Courier location is employee personal data. It is often forgotten because it is not "customer" data.
- Credentials are an asset in themselves, and the most valuable one for an attacker: whoever obtains them does not need to break anything else.
- Backups inherit the sensitivity of the original. An unprotected backup cancels out all the protection of the database.
- The public status of a shipment has medium confidentiality, not low. On its own it says little, but its value changes depending on what other data accompanies it. We will settle this when we talk about data protection.
This is an initial classification, aimed at deciding priorities. The formal classification of data by levels, with the handling rules for each one, is established in the lesson on data protection.
- The starting point: security findings in RouteManager
With the inventory in hand, Clara and Marta spend a day, 11 June 2026, reviewing RouteManager and the platform design. The result is a list of twelve findings. Some had already come up in the course; others are new.
| Id | Finding | Principle or property affected | Risk (L × I) | Resolved in |
|---|---|---|---|---|
| F-01 | The application uses a single database user with all permissions on the 180 tables | Least privilege | 2 × 3 = 6 High | Authentication and Authorization |
| F-02 | Portal passwords are stored with a fast hashing algorithm and no salt | Confidentiality | 2 × 3 = 6 High | Authentication and Authorization |
| F-03 | Internal staff sign in with a password only; in the warehouses there are accounts shared between shifts | Authenticity, traceability | 3 × 2 = 6 High | Authentication and Authorization |
| F-04 | Each merchant has a single API key, with no expiration, no differentiated permissions, and never rotated | Least privilege | 2 × 3 = 6 High | Authentication and Authorization |
| F-05 | Tracking codes are consecutive (RV-0048213, RV-0048214...) and can be enumerated |
Confidentiality; no reliance on obscurity | 3 × 3 = 9 High | Data Protection |
| F-06 | The public tracking page shows the recipient's full name and address | Confidentiality | 3 × 3 = 9 High | Data Protection |
| F-07 | Nothing is encrypted at rest (db-01, NAS, nightly backups) and internal traffic travels in the clear |
Confidentiality, defense in depth | 2 × 3 = 6 High | Data Protection |
| F-08 | Passwords and provider keys written in configuration files inside the code repository | Confidentiality | 2 × 3 = 6 High | Data Protection |
| F-09 | The application logs contain recipients' phone numbers and addresses | Confidentiality, minimization | 2 × 2 = 4 Medium | Data Protection |
| F-10 | The cloud is a new environment: there is no model for accounts or permissions, and no rules that prevent insecure configurations | Secure by default | 2 × 3 = 6 High | Cloud Security |
| F-11 | Flat network in the data center: all servers can see one another, the VPN gives access to the whole network, and administration is done with shared accounts | Defense in depth, attack surface | 2 × 3 = 6 High | Network Security and Zero Trust Architecture |
| F-12 | No systematic threat analysis has ever been done; the existing controls are responses to past incidents | All | Not applicable | Threat Modeling |
Findings F-05 and F-06 make each other worse and deserve a comment. Separately, each one is a defect; together they let anyone, without authenticating, obtain recipients' names and addresses just by incrementing a number. It is a good example of why risks are assessed over the whole system and not piece by piece.
There is also a positive observation. Several decisions from Module 2 were already pointing in the right direction without having been made for security reasons: ADR-006 assigned a schema and a database user to each module, ADR-007 kept personal data out of the events, and ADR-005 set a rate limit on tracking. An architecture with well-separated responsibilities is easier to protect. This module will complete those decisions and record them, as before, in the form of ADRs, starting with ADR-009.
Common Mistakes and Tips
- Confusing threat, vulnerability, and risk. "Consecutive codes" are a vulnerability; "someone who wants the data," a threat; "the massive leak," the risk. If they are mixed up, you do not know what to act on.
- Thinking security is a product that gets added at the end. Findings F-01, F-05, and F-11 are design decisions; no tool fixes them without changing the design.
- Protecting all assets equally. Resources are limited. The inventory and the assessment serve to concentrate effort where the damage would be greatest.
- Investing only in prevention. Without detection, an incident lasts for months; without planned correction, every incident is improvised.
- Layers that are not independent. Three controls that share the same credential or the same administrator fall together.
- Assuming the provider protects it. The provider protects its infrastructure; the configuration, the identities, and the data are yours.
- Forgetting backups, logs, and test environments. They usually contain the same data as production with a fraction of its controls.
- Assessing risk with false precision. A well-argued three-level scale is more useful than a hundred-level one with made-up numbers.
- Tip: for any new component, ask three questions: which asset it touches, who answers for it, and what happens if the identity that uses it falls into the wrong hands.
Exercises
Exercise 1
State which security property (confidentiality, integrity, availability, authenticity, or traceability) is mainly affected in each situation:
- A warehouse employee marks twenty shipments as delivered using the shift's shared account, and nobody can determine who it was.
- A nightly backup of the database, stored unencrypted, turns up on a lost external drive.
- An automated program creates thousands of fake shipments per second with a stolen API key, and legitimate merchants receive errors.
- Someone publishes a fake
ShipmentStatusChangedevent onevent-bus, posing as the monolith. - An error in a migration changes the destination city of 300 shipments.
Exercise 2
Use the matrix from the lesson to assess these three Rutaverde risks. Assign likelihood and impact from 1 to 3, justify each number, calculate the level, and rank them by priority.
- A merchant pastes its API key into a public forum when asking for help, and someone uses it to look up that merchant's shipments.
- A fire destroys the Zaragoza data center.
- A developer with access to the repository copies the SMS provider's password and sends fraudulent messages in Rutaverde's name.
Exercise 3
For finding F-01 (a single database user with all permissions), propose one preventive control, one detective control, and one corrective control, and state which secure design principle each one applies.
Solutions
Solution 1
- Traceability and non-repudiation. There is also an integrity problem, because the status is false, but what sets the case apart is that the action cannot be attributed to a person. The cause is the shared account.
- Confidentiality. The data is within reach of whoever finds the drive. The backup inherits the sensitivity of the original.
- Availability, as the main effect: legitimate merchants cannot work. At the root there is a failure of authenticity, because whoever is using the key is not the merchant.
- Authenticity. The data does not come from where it claims to come from. If the consumers accept it, the consequence is damage to the integrity of the shipment status.
- Integrity. There is no attacker: it is an accidental threat. Security also covers mistakes.
Solution 2
One reasonable assessment, although other well-argued ones would be valid:
- Published API key. Likelihood 2: it happens fairly often at companies with many integrators, and there are 1,200 merchants. Impact 2: it affects the shipments and recipients of a single merchant, not the whole platform. Risk 4, medium. If the key also allowed creating and canceling shipments without limit, the impact would go up.
- Data center fire. Likelihood 1: the data center has physical safeguards and it is a rare event. Impact 3: the core of the platform would be lost and, today, the backups as well, which are in the same building. Risk 3, medium. The number is somewhat misleading: an impact that threatens the continuity of the company deserves treatment even if the likelihood is low, which is why there is a specific lesson on continuity in Module 4.
- SMS provider password in the repository. Likelihood 2: the password is within reach of 35 people and of anyone who gains access to the repository. Impact 3: fraud against recipients in Rutaverde's name, with reputational and financial damage. Risk 6, high.
Priority order: the third, then the first and the second. The matrix ranks; the team's judgment corrects it when an impact is catastrophic.
Solution 3
- Preventive: one database user per module, with permissions only on its own schema, as ADR-006 already provided for. It applies least privilege: a flaw in Reports no longer allows writing to Billing.
- Detective: log denied access attempts between schemas and alert when a module user tries to read tables that are not its own. It applies defense in depth: if prevention has a gap, the attempt is detected.
- Corrective: a procedure for immediately changing the password of a compromised module user without affecting the others. With a single user, changing it would stop the whole application; with separate users, the damage and the repair are contained. It also applies separation of duties if whoever manages the credentials is not the team that develops the module.
A common mistake is to answer with the preventive control only. The three types complement one another.
Conclusion
The security of a system is expressed in concrete properties: confidentiality, integrity, and availability, joined by authenticity and traceability. It is reasoned about with a precise vocabulary (assets, threats, vulnerabilities, risk, and controls) and prioritized by assessing each risk by its likelihood and its impact. Controls prevent, detect, or correct, and a good design combines all three. Seven principles will guide the decisions: defense in depth, least privilege, secure by default, fail-safe, separation of duties, reducing the attack surface, and no reliance on obscurity. And on a platform spread across a data center, a cloud, and several providers, you need to know at all times who protects what.
For Rutaverde, the lesson leaves two working results: an asset inventory, which singles out recipient data and credentials as the most valuable items, and a list of twelve findings, F-01 through F-12, which is the plan for the module. The first four share a common root: the system does not know with enough certainty who is acting, nor does it properly limit what each one can do. That is where we start: in the next lesson we will study authentication and authorization, and design the identity of people, of merchants, and of the platform's own services.
Technological Architecture Course
Module 1: Fundamentals of Technological Architecture
- Introduction to Technological Architecture
- System Design Principles
- Components of a Technological Architecture
- Architecture Models
- Non-Functional Requirements and Quality Attributes
- Architecture Decisions and Trade-off Analysis
Module 2: Designing Scalable Systems
- Scalability Concepts
- Scalable Design Patterns
- Load Balancing
- Caching and In-Memory Storage
- Data Layer Scalability: Replication and Partitioning
- Asynchronous Communication: Message Queues and Events
- High Availability and Resilience
Module 3: Security in Technological Architecture
- Security Fundamentals
- Authentication and Authorization
- Data Protection
- Cloud Security
- Network Security and Zero Trust Architecture
- Threat Modeling
Module 4: Efficiency and Optimization
- Resource Optimization
- Monitoring and Maintenance
- Process Automation
- Performance Evaluation
- Technology Cost Management (FinOps)
- Business Continuity and Disaster Recovery
Module 5: Managing Technological Architecture
- IT Governance
- Technology Project Management
- Documentation and Communication
- Evaluation and Continuous Improvement
- Technical Debt and the Evolution of Legacy Systems
