Opens in a new tab

NewBlack Friday scams: stop them with DNS Defence

Secure by design: how we keep a bug from becoming a breach

Published: November 26, 2026
Last updated: November 26, 2026

Product & Technology

Secure by design: how to keep a bug from becoming a breach

Why a secure by design approach matters

No software is bug-free. The question we ask ourselves is not whether something will go wrong, but what will happen when it does.

We start from an assumption that sits at the heart of the secure by design approach: an attacker will try to turn every edge case into an entry point. An unexpected input, an inconsistent state, a race condition in a secondary feature: they are all attack vectors.

That is why at FlashStart we chose to treat security as an architectural constraint, not as a phase of the release cycle. When a component hits an unexpected state, the system must degrade safely: no data exposed, filtering policies always enforced.

In this article we cover the two pillars on which we built our secure by design stack:

  1. Domain isolation, to contain the blast radius of a defect.
  2. Immutable audit logs, to always have a complete, verifiable record of what happened.

Next-generation DNS protection, fully cloud & AI-based and easy to activate

Pillar 1: domain isolation with Domain-Driven Design to contain the blast radius

In a tightly coupled codebase, different modules share data models, in-memory structures and implicit logic. An unexpected state in a peripheral feature can cascade all the way into authentication or the filtering engine: the blast radius ends up spanning the entire system.

Secure by design software architecture isolating a bug before it becomes a breach

Bounded context: Domain-Driven Design as a security tool

To make our architecture secure by design from the ground up, we applied Domain-Driven Design (DDD) rigorously, splitting critical areas into isolated bounded contexts:

  • Identity integration: handles user authentication and synchronization with corporate directories. It is the context that translates external identities, such as users and groups, into a consistent internal model.
  • Policy evaluation: the core of filtering. It evaluates the configured rules and decides what to allow and what to block, for each user, group or network.
  • Account management: handles configurations, plans, tenant settings and ancillary features such as reporting. It is the context that changes most often, because this is where new features are born.

Next-generation DNS protection, fully cloud & AI-based and easy to activate

Clear boundaries, explicit contracts

Each context owns its persistence models, its invariants and its execution boundaries. We share no mutable state: contexts communicate only through explicit, strongly typed contracts, with no direct access to another module’s data and no implicit dependencies.

In practice:

  • malformed payloads are rejected at the boundary, before they reach domain logic;
  • a defect in one context has no path, in memory or in the database, to mutate the state of adjacent contexts;
  • one tenant’s data cannot end up in another tenant’s context.

If the reporting module receives an unexpected value, the problem stays there: policy evaluation shares neither the data model nor the execution context with reporting. What in a coupled architecture would be a potential security incident becomes a local bug. That is what we mean by secure by design: not pretending to eliminate every error, but limiting its consequences.

Pillar 2: immutable audit logs for full traceability

In a secure by design approach, security is not just prevention, it is also verifiable accountability: the ability to monitor, at any moment, who did what, when and in which context.

When policy rules change or authentication events occur across distributed environments, ambiguity is a liability. It is one during an incident investigation, when every minute counts, and it is one in day-to-day operations, when a customer asks why a site was blocked or since when a rule has been active.

Next-generation DNS protection, fully cloud & AI-based and easy to activate

Append-only logs: you add, you don’t modify

That is why we design our policy and configuration pipelines around append-only, immutable audit logs. The principle is simple: every event is appended to the log and no existing record can be silently modified or deleted.

Every rule change and every access event is recorded with its full context:

  • who performed the action;
  • what changed, with the previous and the new state;
  • when it happened;
  • where it came from and through which channel.

Control plane and data plane: zero impact on DNS resolution

Strict boundaries and audit logging add no latency to DNS resolution, because they operate on a different plane. Architectural boundaries and audit pipelines govern the control plane: policy configuration and rule updates. The data plane, meaning real-time DNS query resolution, stays out of it.

In other words, security checks happen upstream, when a rule is created or modified, not every time a query is resolved. For users, protection is always on but never turns into waiting.

Separation between the control plane, where policy checks happen, and the DNS resolution data plane

What changes in security incident analysis

An immutable log gives us deterministic visibility into system behavior: we don’t have to reconstruct events by inference, or wonder whether a log has been tampered with.

  • Faster root-cause analysis: we trace the exact cause, whether a policy rule, an API call or a directory sync event, by following the chain of changes.
  • Reliable results: conclusions rest on data no one could alter after the fact.
  • External verifiability: the same trail supports audits, compliance checks and precise answers to customers.

The trade-offs we accepted

No architectural choice comes for free. These are the costs we factored in:

  • Eventual consistency. A change in one context is not reflected instantly in the others, nor on the resolvers. Between a policy update and its enforcement there is a propagation window that we must monitor and keep short.
  • More code at the boundaries. Typed contracts, mapping and validation require more boilerplate than a direct call. In return, every interaction between domains is explicit and testable.
  • Log growth. An append-only log grows by definition. It takes retention and archiving policies that don’t compromise immutability.

Next-generation DNS protection, fully cloud & AI-based and easy to activate

Conclusion

Domain isolation and immutable audit logs answer two different questions: the first limits how much damage a defect can do, the second lets us reconstruct what happened without ambiguity.

Together they sum up how we understand secure by design: not a checklist to tick before release, but a constraint that shapes every architectural decision from the start. Bugs will keep happening. Our job is to make sure they stay bugs, and never become breaches.

Sources

Martin Fowler – Bounded Context

Martin Fowler – Event Sourcing

OWASP – Logging Cheat Sheet

FAQ

What does secure by design mean?

It means designing software so that security is an architectural requirement from the start, not a check added before release. You begin with the assumption that something, sooner or later, will go wrong. That is why component separation, boundary validation and traceability exist to limit the damage of an error: faced with an unexpected state, the system degrades safely and keeps enforcing policies.

What is a bounded context in Domain-Driven Design?

It is an explicit boundary within which a domain model has a precise meaning, with its own data and rules. Communication with other contexts happens only through defined contracts, and no context can read or modify another’s data directly. From a security standpoint, every boundary becomes a checkpoint: anything that doesn’t honor the contract is rejected.

What are immutable audit logs?

They are append-only logs: every event is appended and no record can be silently modified or deleted. Each entry records who performed the action, what changed, when and from where. Since no one can alter them after the fact, the conclusions of an investigation or audit rest on reliable data.

What is the blast radius of a bug?

It is the set of components and data a defect can compromise. In a tightly coupled system it is wide: an error in a secondary feature can reach all the way into authentication or filtering rules. With isolated domains, the same error stays confined to the module where it originated and becomes a local problem, easy to fix.

Isn’t Domain-Driven Design (DDD) just a way to organize code? How can it enforce security?

DDD starts as a modeling discipline. But enforcing strict bounded contexts, with isolated persistence models and strongly typed contracts, removes shared mutable state. In practice, a bug or malformed payload in a peripheral domain, such as billing or reporting, has no direct path, in memory or in the database, to modify core DNS filtering rules or cross-tenant session mappings.

Do strict boundaries and immutable audit logs add latency to DNS resolution?

No, and that distinction is critical. Architectural boundaries and audit pipelines govern the control plane, meaning policy configuration and rule updates. They don’t touch the data plane, meaning real-time DNS packet resolution. Checks happen when a rule is created or modified, not on every query: protection stays on without slowing down browsing.

How does this help during a security incident or a compliance audit?

When an unexpected block or policy change shows up on a customer’s network, IT admins need definitive answers, fast. Because every configuration change is logged deterministically, we can trace the exact root cause: a specific policy rule or an API call. No guessing from fragmented debug logs.

Does the secure by design approach replace traditional security testing and penetration tests?

No, it complements them. Static analysis, automated integration gates and external audits catch vulnerabilities before release. Architectural fail-safes ensure that even an unforeseen edge case in production cannot escalate into a breach.

Filippo Gurioli

LinkedIn

I work on full-stack development of the cloud ecosystem and high-availability backend architectures. Passionate about software process engineering, I design and optimize resilient architectures and automation workflows that support cybersecurity and DNS filtering infrastructure.