obsinto FREE EDITION · FOR DISTRIBUTION

Engineering guidance

Secure Software Development Guidelines

Free Edition

Eighteen engineering practices for teams building SaaS products. Each one makes your product safer now, and each one quietly produces the evidence that SOC 2, ISO 27001, HIPAA and PCI DSS will ask you for later. Free to read, free to share, free to adapt for your own team handbook.

Security by Design  ·  Compliance Ready  ·  Cloud First

DocumentOBS-ENG-SSDG-001
Version1.0
IssuedAugust 2026
AudienceFounders, CTOs, engineers

Purpose

Compliance is downstream of architecture


Most teams meet compliance the painful way. They build fast for two years, land an enterprise deal that requires SOC 2, and then discover that the audit is not really about paperwork. It is about whether the product was built with certain habits, and whether anyone can prove it.

The paperwork part is genuinely quick. What actually delays certification is the stuff you cannot backfill: audit history that was never collected, tenant isolation that has to be retrofitted into a live database, an access model nobody wrote down. Those are engineering problems, and by the time an auditor finds them they are expensive engineering problems.

So this guide takes the opposite approach. Build with these eighteen practices from the start and the certification largely assembles itself. None of them exist for the auditor's benefit. They are just good engineering that happens to leave a paper trail.

Where to start, based on where you are

Your stageDo these firstWhy
Designing the schema1, 2, 3, 4Data classification and the access model are the hardest things to change later.
Building toward first customers5 through 10Cheap to set up now. Each becomes an audit finding if you skip it.
Live, with paying customers11, 12, 13, 16You now carry availability and privacy obligations whether you planned to or not.
Preparing for a first audit14, 15, 17Auditors test process and documentation, not just configuration.

Each practice below ends with a row of green tags. Those are the artifacts the practice produces as a side effect, and they are exactly what an auditor will request. If you keep nothing else from this page, keep that framing: a control that leaves no artifact behind cannot be verified, by an auditor or by you.

Navigation

Contents


PART 1 OF 5

Data, identity and access

Three decisions that are cheap this week and brutal to change once you have customers.

1

Data governance

Know what you collect before you collect it.

Every field you store is a field you have to protect, justify, retain and eventually delete. Data collected "because we might want it later" carries the full cost of protection and none of the value. Before adding a column, ask what product decision depends on it.

  • Classify everything. Four tiers is plenty: public, internal, confidential, regulated. Let the tier drive the handling rules so you never decide case by case.
  • Write a data inventory. For each element: what it is, why you have it, who owns it, where it lives, how long you keep it, how it dies. A spreadsheet is fine.
  • Define retention when you add the field, even if the answer is seven years. Deciding is the point.
Common mistakeRetention defined as "forever, probably". Teams define collection and never define deletion. "We have never deleted anything" costs you a finding under SOC 2, ISO 27001 and GDPR alike.
Producesdata inventoryclassification policyretention schedule
2

Authentication and identity

The one area where you should almost never write it yourself.

  • Use an established identity provider. The primitives are subtle and the failure modes are severe. If you sell to businesses, support single sign-on early; it is the first thing enterprise buyers ask about.
  • If you store passwords, hash them with Argon2 or bcrypt. Per-user salt, a cost factor you revisit. Never plain SHA, never anything reversible.
  • MFA on every privileged path. Not just your admin console. Also the cloud account, the CI system, the source repo, the DNS registrar.
  • Manage sessions deliberately. Absolute expiry plus idle timeout, Secure and HttpOnly cookies, server-side invalidation on logout and password change.
  • Rate-limit login attempts per account and per source. Credential stuffing is automated and cheap.
Common mistakeMFA on the console while a long-lived API token with the same permissions sits in a config file. Inventory non-human credentials with the same seriousness as user accounts. Scope them narrowly and give them an expiry.
ProducesIdP config exportprivileged account listsession policy
3

Authorization

Where most real breaches in multi-tenant products actually happen.

Authentication says who is calling. Authorization decides what they may do, and it has to be right on every path, not just at the front door.

  • A few roles, least privilege each. Resist per-user permission flags. They multiply until nobody can reason about the matrix.
  • Enforce on the server, always. Hiding a button is a courtesy to honest users. Anyone else has the developer console open.
  • Deny by default. A route with no declared permission should fail closed, so the endpoint a new engineer forgets about refuses to serve rather than serving everything.
The practiceIn a multi-tenant product, derive the tenant from the authenticated session. Never from a URL parameter, header or request body that a caller can edit. Enforce it in one shared data-access layer, or in the database with row-level security, so a forgotten filter returns nothing instead of returning another company's records.
Common mistakeTesting only the happy path. Write the negative tests: a viewer cannot write, tenant A gets a 404 for tenant B's record id (a 403 confirms the record exists), a guessed sequential id fails.
Producesrole matrixcross-tenant denial testsaccess review records
PART 2 OF 5

Platform and infrastructure

Where your code runs, what it holds, and what it records.

4

Environment separation

Limits how far one mistake can travel.

  • Separate cloud accounts, not namespaces. Account boundaries are the one boundary your provider enforces for you. An over-broad permission inside a shared account reaches everything.
  • Separate credentials. A leaked development key must be worthless against production.
  • Separate data. Lower environments get synthetic fixtures, never a copy of the production database.
The practiceNever routinely test with production data. Build a fixture generator that produces realistic synthetic records. The moment production data lands in a dev environment, that environment inherits every obligation production has, and it almost certainly lacks the controls to match.
Common mistakeThe "anonymized" production copy. Masking done under deadline pressure is nearly always reversible: names get scrambled while free-text fields, uploads and identifiers survive. Treat a masked dump as production data unless you can prove otherwise.
Producesaccount inventoryper-env credentialsno-prod-data rule
5

Secrets management

The most common serious finding in early codebases, and the most avoidable.

  • Use a real secrets manager. Every major cloud has one, and workload identity means your app never holds a bootstrap credential.
  • Scan for secrets in CI and in history. Pre-commit hook plus pipeline check. Scan the full git history once when you adopt it; the interesting findings are usually old.
  • One job per credential. Separate read from write, per service, with an expiry. Never one shared key used by every service and every engineer.
  • Rotate on schedule and on events: suspected exposure, and whenever someone with access leaves.
The practiceTreat any committed secret as compromised. Rotate first, clean up the commit second. Deleting the commit is not remediation; assume the value was exposed the entire time it was there, because private repos get cloned, forked and backed up in ways nobody tracks.
Producessecrets inventoryCI scan resultsrotation record
6

Encryption

The risk is not weak algorithms. It is unencrypted things you forgot about.

  • TLS 1.2+ on every public endpoint, HTTP redirected, HSTS on. Run an external scan to confirm.
  • TLS internally too, service to service and app to database, not just at the edge.
  • Managed encryption at rest on databases, object storage, queues, log stores. Flip it on at creation; it rarely inherits downstream.
  • Managed keys, split permissions. Who can use a key and who can administer it are different questions. Answer them separately.
Common mistakeThe primary database is encrypted and its backups are not. Snapshots, exports, cross-region replicas, log archives and analytics copies each need checking. An auditor will ask about backups specifically.
Producesexternal TLS scanat-rest settings exportkey policies
7

Audit logging

Worth almost nothing if you start collecting after you need it.

Log five classes of event and you cover what incidents and audits ask about: authentication (success and failure), administrative actions, permission changes, configuration changes, and data exports.

  • Structured, not prose, so you can query instead of grepping under pressure.
  • Centralized and append-only. Logs that live only on the machine that made them vanish exactly when you need them. Operators should not be able to edit history.
  • UTC everywhere. Correlating across services needs one clock.
  • Pick a retention period, usually a year for audit purposes, and configure it on purpose.
Common mistakeLogging the request body, and with it the personal data. Audit logs quietly become the least protected copy of your most sensitive information. Log identifiers and metadata, never credentials, document content or full personal records. Add a test, because it creeps back with every debug statement.
Producesretention configsample log extractimmutability proof
8

API security

Anything your web client can do, a script can do faster and without the guardrails.

  • Authenticate every request. Health checks should not enumerate internals.
  • Authorize every action, per request, on the specific object touched. Once at the gateway is not enough.
  • Validate input against an explicit schema and reject what fails, rather than sanitizing and hoping. Size limits on bodies, arrays and uploads.
  • Rate-limit, tighter on login, password reset, invitations and exports.
  • Serialize explicit fields. Serializers that default to "everything" leak new columns the day they are added.
Common mistakeSequential ids plus a missing ownership check. This is the most common serious API vulnerability in the wild. If your ids are guessable integers and any handler resolves the object before checking ownership, someone will find it by counting.
ProducesAPI spec with permissionsrate-limit confignegative-path tests
PART 3 OF 5

Code, dependencies and cloud

What you write, what you borrow, and what you run it on.

9

Secure coding

The vulnerability classes that matter have been stable for twenty years.

Follow OWASP guidance and prefer framework defaults over clever code. The frameworks have already had the bugs you are about to write.

  • Injection: parameterized queries or the ORM builder, never string concatenation into a query.
  • XSS: let the template engine encode output. Any "render raw HTML" call gets reviewed.
  • CSRF: framework tokens plus SameSite cookies.
  • Deserialization: data formats, not object formats, for anything untrusted.
  • Errors: generic message to the client, detail to the log. No stack traces in responses.
The practiceAutomate what you can, review what you cannot. Static analysis on every commit, blocking. It will not catch logic flaws or missing authorization checks, which is exactly what human review is for. Spend the machine on mechanical classes and the human attention on the rest.
Producescoding standardSAST results per buildreview records
10

Dependency management

Most of your product was written by someone else. You are responsible for it anyway.

  • Adopt deliberately. Is it maintained, does the license work for you, does it respond to security reports, how much transitive weight does it drag in.
  • Commit lockfiles so builds are reproducible and a scan result means something.
  • Scan on every commit and on a daily schedule. A vulnerability published tomorrow affects the dependency you did not touch today.
  • Patch targets by severity, and hold them: critical in days, high in weeks, the rest on a planned cadence.
  • Remove what you stopped using. Same risk, zero benefit.
Common mistakeScanning the app and ignoring the base image. Containers ship an operating system with its own vulnerabilities, and build caching can pin a stale layer for months. Scan built images and rebuild bases on a schedule.
ProducesSBOM per buildscan resultsremediation record
11

Cloud security

The provider secures the infrastructure. You secure the configuration.

  • Lock the root account: MFA, no access keys, no daily use. Work through named users and roles.
  • No standing admin. Elevated access is assumed for a purpose and expires.
  • Provider audit logging on, every region, delivered somewhere the account's own admins cannot quietly edit.
  • Closed network by default: no public databases, no open management ports, no public buckets unless they serve genuinely public assets.
  • Infrastructure as code, reviewed and diffable. Console changes are invisible to your change process and are where drift starts.
The practiceRun a configuration benchmark today. Every provider has a posture tool and open-source scanners exist for all of them. The first run takes an hour and typically finds a public snapshot, an over-permissive role, and a region with logging off. Then schedule it.
Producesbenchmark resultsIaC repo historyaudit log config
PART 4 OF 5

Resilience, privacy and lifecycle

Obligations that arrive with your first real customer.

12

Operational resilience

Decide your recovery targets before an incident decides them for you.

  • Pick an RTO and RPO and write them down. For an early B2B product, four hours down and fifteen minutes of data loss are defensible starting answers.
  • Back up daily, keep 30 days, store a copy in another region. Point-in-time recovery on a managed database gets you most of the way.
  • Health checks that reflect real dependencies, alerts routed to a person who agreed to be woken, and a written incident procedure with severity levels and customer communication times.
Common mistakeBackups that have never been restored. An untested backup is a hypothesis. The job silently stopped weeks ago, the snapshot missed the volume that matters, the old encryption key is gone, or the restore takes eleven hours against a four-hour target. You find these in a quarterly rehearsal or you find them in production.
ProducesBCP/DR planrestore test recordsincident records
13

Privacy by design

Knowing where personal data is turns out to be most of the work.

Three questions, answered in writing. What personal data do you process, including logs, analytics, support tickets and whatever customers upload into your product? Why, in one sentence per purpose? And how will you delete it, on request and on schedule, including from backups and every third party you shared it with?

The practiceBuild the deletion path while you build the create path. Once personal data has fanned out to a search index, a warehouse, a support tool, an email platform and thirty days of backups, honoring one deletion request becomes a project. Design the fan-out and the fan-in together, and keep a register of every system that receives personal data.
  • Join on internal ids, not email addresses, so pseudonymization is possible later.
  • Keep a sub-processor list. Customers will ask and contracts will require it.
  • Name an owner for data subject requests before the first one arrives. The deadlines are statutory.
Producesprocessing recordDSR proceduresub-processor register
14

Secure SDLC

Security inside how you already work costs very little. As a separate phase, it costs a lot and gets dropped.

The minimum viable version is four rules, each about a day to set up:

  • Every change is peer reviewed, enforced by branch protection with self-approval off.
  • Automated tests run on every change and block the merge on failure.
  • Dependency and secret scanning run on every change, also blocking.
  • Nothing reaches production without passing all three.
Why this one matters mostBranch protection plus pull request history is the single most useful evidence artifact a young company can have. It demonstrates change authorization, segregation of duties and testing at once, three separate control areas, and it accumulates automatically from work you were doing anyway. It also cannot be created retrospectively. Turn it on this week.
Producesbranch protection exportPR historypipeline definitions
PART 5 OF 5

Process and proof

The habits that make a well-built product demonstrably well-built.

15

Change management

For most SaaS teams this is your existing PR workflow with the gates actually enforced.

  • Everything in version control: app code, infrastructure, migrations, pipeline config. If it can change production and is not in a repo, it is outside your process.
  • Review before merge, by someone other than the author.
  • Track what shipped: a deployment record linking the version to its changes and approver.
  • Know the rollback, especially with database migrations. Write migrations backward-compatible with the running version and run them before the new code takes traffic, so a failure leaves the old version serving.
The practiceMake the emergency path a shorter route, not a bypass. You will need to ship urgently one day. Decide now that urgent changes still get reviewed, tested and recorded, just faster, with a retrospective look afterwards. A documented expedited procedure is a control. An undocumented override is a finding.
Producesdeployment recordsemergency change register
16

Continuous monitoring

Turns "we configured it once" into "we can show it still works".

Five things to watch: system health (your customers should not be your monitoring), authentication failures (the visible signature of credential attacks), privilege and configuration changes, infrastructure alarms including certificate expiry and backup job failure, and data access far outside a principal's normal pattern.

Common mistakeAlerts nobody reads. A channel with a hundred daily messages is the same as no monitoring, except you believe you are covered. Every alert gets a defined response; anything with no action attached becomes a dashboard metric instead.
Producesalert definitionsresponse samplesincident log
17

Architecture documentation

What you need for an audit is what you need for onboarding anyway.

Three artifacts. An architecture diagram: components, boundaries, where each runs, how they authenticate to each other, one page. A data-flow diagram showing where sensitive data enters, lives, moves and leaves; this one determines your audit scope, so accuracy here narrows the assessment. And a register of third-party integrations: what each receives, why, and where it operates.

Common mistakeA beautiful diagram, eighteen months stale. Old documentation is worse than none because people make decisions from it. Keep diagrams as text-based sources in the repo and update them in the same PR that changes the architecture.
Producesarchitecture diagramdata-flow diagramintegration register
18

Think long-term

Five switches to flip this week, because history cannot be backfilled.

First audits are rarely delayed by a missing policy document. Policies can be written in a week. They are delayed by absent history (an auditor testing six months of change control needs six months of records), by architectural retrofits (tenant isolation and deletion paths are engineering programs, not paperwork), and by nobody being able to say what the system actually does.

The practiceEnable the things that accrue history: branch protection, provider audit logging, dependency scanning, secret scanning, backup restore checks. Each takes under a day. Each is worth more every week it runs.
Producesmonths of evidence, automatically
Key takeaway

Do not stop building to do compliance. Build with these habits, and the compliance largely does itself.

Appendix A · Self-assessment

How ready are you?


Tick "We do this" on each practice above, but only where you could hand an auditor the artifacts listed in green. Doing it without being able to show it scores as not doing it, because that is how an auditor will score it too.

The bars below weight each practice by how much it matters to each framework. They estimate the engineering groundwork in place, not certification itself; every framework also has organizational controls (HR, vendor management, policies) outside the scope of this guide.

0 of 18 practices in place

Saved in your browser only. Nothing leaves this page. Reset

Appendix B · Further reading

References


Everything here is free to read, and worth reading in the original when you reach the part of your build it governs.

obsinto

Compliance for the Age of Intelligence.

This guide is the groundwork. Obsinto is the platform that reads what your systems and documents actually show, writes the policies and evidence your framework requires from your own context, and keeps the picture current as your product changes.

Visit obsinto.com Prefer a file? Download the PDF edition Questions or corrections: support@obsinto.com