Why I treat security as part of the pipeline

A wide curve of waterfalls across a river, seen from the water's edge under an overcast sky

For a long time, security in software delivery was a gate. The work got done, and then someone reviewed it for security, and then it shipped or it did not. I think that model finds problems at the moment they are most expensive to fix, and I have come to treat security as part of the pipeline instead.

Why the gate is the wrong place

A gate at the end sees the finished thing. By then the design is settled, the code is written, and there is a date. Small findings get fixed, large findings get argued about, and the largest get accepted with a plan to address them later, which is a sentence I have come to distrust.

The other problem with a gate is who stands at it. If security is something a separate group does at the end, the team that wrote the code learns it is not their job.

What I think belongs in the pipeline

Dependency checks on every change, not a quarterly scan. A check that runs when a dependency is added or updated and fails the build on a known problem.

Secret scanning before anything is committed. A credential that reaches the repository has already leaked, whatever happens next.

Permissions as code. What a service can reach, what a build can do, who can deploy, in files that go through review. Permissions that live in a console get changed by hand and forgotten.

A hard look at the pipeline itself. The continuous integration (CI) system runs with real credentials and runs code from pull requests, which makes it one of the most interesting targets in a company. What it is allowed to do, and what untrusted changes can make it do, deserve the same review as production.

And linting rules that catch known-bad patterns, because a rule that fires in the editor is cheaper than any review.

Ownership is the part that matters

I think the checks matter less than who owns them. A pipeline the team runs, understands, and can change is one the team will keep honest. One imposed from outside, that fails for reasons the team does not understand, gets worked around, and a worked-around check is worse than none because it reports green.

So my view is that the team owns its security checks the way it owns its tests. A central security group sets the standard and helps. The team runs it.

What a pipeline cannot replace

None of this replaces thinking. A pipeline cannot tell you that the feature should not exist, that the data you are collecting is more than you need, or that the trust boundary is in the wrong place. Those are design questions, and I think they belong at the start, with someone asking what could go wrong.

The pipeline handles the known problems so people can spend their attention on the unknown ones. A gate at the end tries to do both, late, and does neither well.

Photo source: https://photos.robertstowe.com/iguazu-falls