All posts
contractsverify-and-releaseplatform-engineering

By-Audit vs By-Design: Why Standards Must Run Before the Change

Audits find the same cost, security and compliance gaps every quarter. By-design puts the rule in the module and the policy, so every change is checked before it runs, by a person or an AI agent.

Anshul Sao
Anshul Sao
Jan 24, 2023 · 8 min read

In this post, I want to share some insights gained from my advisory engagements on cloud spend. I advised over 20 companies on cloud cost optimization. What we expected to be short-term engagements, where I'd analyze bloated costs and share tips and tricks, became multi-quarter engagements that needed continued support. This was highly inefficient.

How did we end up here? The answer was in our DevOps practices and tools.

Endless audit loops

While investigating cloud spend, we would dig through spend dashboards, discover insights, sort them by priority, assign them to teams, and then measure them again, every week. The toil it took on teams was immense. It was like Groundhog Day.

We had success on many occasions and celebrated the pure dollar savings. However, this made me question our fundamental approach: how can we think preemptively about this?

Make no mistake, continuous verification and auditing is a necessary practice. We all need to routinely audit costs and practices, but it should not be the only way.

Expanding on this, I realized that it isn't limited to cloud cost. We take this "by-audit" approach in almost all of our DevOps practices.

The by-audit approach

I call this approach of taking stock after the fact "by-audit". These days, when I come across a DevOps tool or process, I classify whether it fixes things by-audit or by-design.

Here is how common practices look when you think by-audit:

  1. Cloud cost: A central team analyzes cost reports every day or every week, then assigns and tracks fixes across engineering teams. It takes a lot of effort, and while it trims some excess, it does not make the system more efficient.
  2. Compliance: You perform quarterly or annual audits, find the non-compliances, work out which teams they belong to and assign them for fixing. Nothing guarantees the same issues won't be back in the next audit.
  3. Security: Higher than required privileges, open database credentials, improper network segmentation and loose security groups are common areas where you pull reports and try to work out with teams whether each finding is genuine or a misconfiguration.
  4. Disaster recovery: Many companies set up simple backups and runbooks for recovery, and confidence in them is usually low. So the DevOps team either lives with blind optimism or, at the other extreme, runs DR drills several times a quarter because it fears the runbook has drifted.
  5. Completeness of monitoring: Nobody is sure whether the dashboards and alerts are complete, or whether the right team gets notified. No alert does not mean nothing is wrong; the alert may be missing. So when issues happen, we check every dashboard and alert configuration by hand. We wrote about this in observability by design.

This applies to tools as well.

For instance, say you have a tool that analyzes the exposed credentials of a database. A database expert then reads the report, finds the services that connect to the database, finds their owners and asks them to re-examine it.

Think by-design

Diagram that compares two ways to keep standards. On the left, by audit: a change ships, an audit finds a gap, a ticket goes to a team, and someone fixes it by hand; the next audit finds the same gap, so the loop repeats. On the right, by design: the rule lives in the module and the policy, each change is checked before release, and the release record becomes the audit report. The rule is fixed once, not every quarter.

With the by-design approach, best practices are in place before the change is made. The route that has them built in is often called a golden path: the easy way to do something is also the compliant way.

To continue the database example, a by-design approach gives each service a formal way to request a credential beforehand. The request separates what the credential is for from how it is made, so both can be checked.

It also needs a policy on how credentials are created, isolated, stored and rotated, applied uniformly and programmatically each time a request is fulfilled. This must be the only way to create a credential. When that is in place, the need for verification tools drops sharply. The codified policy can be checked statically, before every change, not after it.

The same split shows up in cloud cost tools. AWS Cost Explorer, where you analyze costs per team and find the teams that use the most, is a "tool of verification". AWS Budgets, where you give each team a budget and automation stops it from going over, is a "tool of design".

By-audit versus by-design

By-auditBy-design
GoalsShort-term and iterative goalsLong-term goals; less audit work
OwnershipCentral tooling and central governanceCentral tooling, decentralized governance and developer autonomy
BenefitHelps fix anomaliesHelps fix the baseline
FocusToolsPlatform thinking

Goals

If you have a burning problem like bloated costs, the by-audit process helps. You put a team together, pull all the reports, break them down and assign fixes to developers. However, more often than not, these practices become the norm. By-design processes give long-term benefits and keep things fixed. You may still need audits, but the workload drops sharply.

Ownership

In the by-audit approach, one central team is usually responsible. Governance is centralized because ownership sits with that team, which uses its tools to analyze reports. This is fine for the short term.

With the by-design approach, the goals are long-term. Ownership spreads across teams, so governance is decentralized and teams get more autonomy. Each team knows its share of the work.

Benefits

Apart from routine audits, by-audit processes help with anomalies, such as a security breach or a cost spike. Audits handle anomalies well, but they do not improve the baseline. By-design processes raise the baseline itself: your default security posture, your observability coverage and your cost baseline.

Focus

To move from by-audit to by-design, the focus must shift from tools to platform thinking. Two questions decide it:

  1. How will developers use this directly, without more cognitive load?
  2. How will this check every change before it reaches production, so mistakes do not spread?

Practice by practice, the shift looks like this:

PracticeBy-auditBy-designWhat changes
Cloud costCost reports, then ticketsSizes and budgets set in the standardPredictable costs, less waste
CompliancePeriodic auditsRules as policy, checked on every changeFewer findings, less auditing
SecurityReports after the issueSecure settings inside shared modulesFewer checks, more trust
Disaster recoveryFrequent drillsBackups and recovery planned into the designFewer drills, more reliable systems
ObservabilityAlerts built from scratchDashboards and alerts ship with each serviceFaster, more accurate fixes

By design, when agents make the changes

AI raises the number of changes each team makes every week. Coding assistants write the service, and more and more often they write the Terraform too. An agent cannot read a wiki page or remember a review comment, and no reviewer can keep up with every change by hand.

So by design now has a precise meaning. The standard must sit where a machine checks it on every change. That means three things: typed, versioned module contracts that hold the defaults, guardrail policies that run on every release, and approval rules where a person's judgment is still needed. If a change does not comply, it does not deploy.

How Facets does it

In Facets, the platform team puts its standards into modules: Terraform with a contract around it, which says what a developer can choose and fixes the rest, such as encryption, backups and monitoring. Guardrail policies check each release, and a violation of Error severity stops it. An approval rule holds a release until an approver acts. These checks apply whoever starts the release, a person or an AI assistant (approvals and guardrails). Why Facets explains why the standards belong in contracts.

The audit becomes a report

The audit stays, and its job changes. The blueprint says what should exist, and every release records what changed, where, when and who started it. An auditor can read that record instead of waiting for a quarter of manual checks. The same record lets teams check cost and gaps across every environment at once, which is where what comes next for operations begins.

Conclusion

Platform teams today must move away from stitched-together tools and audit-driven practices. Platform engineering is centered on a by-design mindset.

Platform teams need ways to make sure the well-architected parts of the cloud are guaranteed, so they do not have to be audited. With people and AI agents both making changes, the standard has to run before the change, every time. Read why Facets for how that model works end to end, and see standardization across security, cost, compliance and observability and security by design and by default for the same idea applied to two areas.

Frequently asked questions

Tags

#devops-metrics#platform-engineering#by-design#proactive-devops