All posts
contractsverify-and-release

Security by Design & Default: Weaving Security into the DNA of your Software

Security by design and security by default, compared: what each means, secure-by-default examples for cloud infrastructure, and how to enforce them on every change, whether a person or an AI agent makes it.

Kirti Krishan
Kirti Krishan
May 21, 2024 · 7 min read

Security by design means building something secure from the beginning, instead of patching holes later. It makes security a fundamental part of creating technology products. This idea fits well with DevOps, a modern development practice, by promoting a proactive approach to security.

It emphasizes including security at every stage of development.

DevOps is an excellent framework for integrating security throughout the software development and deployment process. This way, security is a key element from the start. Similarly, platform engineering benefits from adopting a Security-by-Default approach, which builds security into systems from the beginning and helps to mitigate risks early.

There are challenges, of course. We need to change how we think, what we do, and the tools we use to make security a natural part of development. But if we do this right, security won't slow us down. It will actually make things better and faster.

The aim is an environment where security drives innovation and efficiency in how teams build and ship software.

Two Schools of Thought: Security by Design and Security by Default Controls

There are two schools of thoughts for implementing security in technology and they focus on the same goal, however the approach is differentiated.

Security by Default: Security by Default Controls ensures software and systems start with the most secure settings. This makes it easier for users to stay secure, avoids mistakes in setup, and strengthens overall security. The trick is finding the right balance: strong security shouldn't make things too difficult or frustrating to use.

Security by Design: Security by Design weaves security throughout the entire software development process. This not only makes the software stronger, but also helps follow regulations and makes everyone think about security. However, it can require a change in how things are done and might take longer and cost more upfront.

Both strategies are important. Each approach plays a crucial role in building secure systems, focusing on proactive risk management and secure user experiences, respectively.

Here’s a more detailed comparison between the two:

AspectSecurity by designSecurity by default
DefinitionA proactive approach that builds security into every stage of the software development lifecycleA principle that sets every security setting to its most secure default
FocusSecurity in the design, development and deployment processesDefault configurations that are secure enough to prevent unauthorized access
ObjectiveAnticipate and reduce security risks early, so security is part of the solutionGive users a system that is secure from the start, with little to configure
BenefitsFewer vulnerabilities, easier regulatory compliance, a culture of security awarenessSimpler upkeep, fewer configuration errors, a stronger overall posture
ChallengesNeeds a shift in mindset; can add time and cost at the startBalancing security with usability, so defaults do not block needed functions

Diagram of secure defaults inside a module, with a Postgres database module as the example. The developer chooses only a few settings, such as size and version. The platform team fixes the secure settings inside the module: encryption at rest, a private network only, backups with a retention period, and no public access. If a release tries to override one of these defaults, for example to turn on public access, a guardrail policy of Error severity stops the release, and nothing reaches the cloud.

Secure by default examples for cloud infrastructure

Security by default is easiest to see in cloud infrastructure, where one setting can expose a whole system. These are common secure defaults:

  • Storage buckets are private. Public access is off unless a module is built for public content.
  • Databases are encrypted at rest and placed in private subnets, with no route from the internet.
  • Backups are on, with a retention period that matches the data.
  • No public IP on a server or database unless the module allows it for a reason.
  • One least-privilege role per service, so a service can reach only the resources it uses.
  • Required tags on every resource, such as team, environment and cost center.

Each default follows the same pattern. The platform team decides it once, inside a shared module. The developer chooses only what they need, such as the size and version of a database, and cannot switch the secure setting off through that module. If a change still tries to override a default, a policy stops the release before anything changes.

Why AI makes secure defaults non-negotiable

Coding assistants now write much of the infrastructure code. Their Terraform looks right, and it often is. But a standard that lives in a review comment or a wiki page gets skipped, because the assistant never reads it and the reviewer is busy with ten more changes. You cannot vibe code infrastructure.

So the default has to sit where a machine checks it, on every change. An AI agent can only run what it can verify (why Facets), and a secure default inside a module, backed by a policy, is part of that check.

The right way? Both, by default and by design

Integrating Security by Design and Security by Default Controls into DevOps and platform engineering is now essential. This approach embeds security deep within the development process as a foundational component from the very beginning. By weaving security into every phase, from initial design through to deployment, these strategies ensure that security measures evolve as an integral part of the development lifecycle.

Both strategies come with toolkits. Security by Design stresses planning ahead for security risks, like having a fire extinguisher handy. Security by Default Controls focuses on the safest settings by default, so users don't need to tinker for protection.

By integrating these approaches with DevOps and platform engineering, organizations gain a double win: stronger defenses and smoother operations. This security-first mindset is essential for building dependable systems.

Strategies for embedding security principles into the SDLC

  • Collaborative Culture: Building a security-aware culture is foundational. Regular security training for all team members not only raises awareness but also empowers each individual to take ownership of security within their roles.
  • Shift-Left Security: By integrating security early in the SDLC, teams can identify and mitigate vulnerabilities sooner. Implementing automated security scanning tools in the CI/CD pipeline, and a policy check before every infrastructure release, ensures continuous security checks and makes security a part of the daily workflow.
  • Automated Security Tools: Automation is key in keeping up with fast-paced development cycles. Continuous feedback on code quality and security risks, streamlining the remediation process is pivotal.

Cultural shifts

  • From Siloed to Integrated Teams: Breaking down the silos between development, operations, and security teams encourages a more holistic approach to security, where responsibilities are shared, and communication is open.
  • Continuous Learning and Improvement: Security is an ever-evolving field. Adopting a culture of continuous learning and regular retrospectives ensures that teams stay updated on the latest threats and best practices, adapting their strategies accordingly.
How Facets does it

In Facets, modules with contracts hold the secure defaults. Each module is Terraform with a contract around it: the developer picks a few settings, and the platform team decides the rest inside the module, such as encryption, network placement and backups. Guardrail policies check every release, and a violation of Error severity stops it. A critical resource, such as a production database, needs a separate permission to delete, disable or edit its protected fields. These checks apply whoever starts the release, a person or an AI assistant (approvals and guardrails). Why Facets explains why standards belong in contracts.

The future is secure by default

Patching security holes after the fact does not keep up with the pace of change, and AI only raises that pace. Security by design sets the intent, and security by default makes the secure setting the one every change starts from. Read why Facets for how this works when people and AI agents both change infrastructure, and standardization in security, cost, compliance and observability and by-audit vs by-design for the wider standard.

Frequently asked questions

Tags

#security-by-design#standardization#security-by-default