SECURITY ENGINEERING · PART 0 · START HERE · PROCESS · 5 OF 229

How Security Teams Find Gaps and Secure Systems

The loop every security team runs: keep an inventory, find gaps (design reviews, threat models, code review, scanners, penetration tests, bug bounties, posture checks and audits), rank them by risk, fix them at the root with guardrails and secure defaults, verify the fix, then detect, respond and learn. With the working habits that make other teams want security involved.

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 9
  9. 10
  10. 11
  11. 12
  12. 13
  13. 14
  14. 15
  15. 16
  16. 17
  17. 18
  18. 19
  19. 20
  20. 21
  21. 22
  22. 23
  23. 24
  24. 25
  25. 26
  26. 27
  27. 28
  28. 29
  29. 30
  30. 31
  31. 32
  32. 33
  33. 34
  34. 35
  35. 36
  36. 37
  37. 38
  38. 39
  39. 40
  40. 41
  41. 42
  42. 43
  43. 44
  44. 45
  45. 46
  46. 47
  47. 48
  48. 49
  49. 50
  50. 51
  51. 52
  52. 53
  53. 54
  54. 55
  55. 56
  56. 57
  57. 58
  58. 59
  59. 60
  60. 61
  61. 62
  62. 63
  63. 64
  64. 106
  65. 107
  66. 108
  67. 109
  68. 110
  69. 111
  70. 112
  71. 113
  72. 114
  73. 115
  74. 116
  75. 117
  76. 118
  77. 119
  78. 120
  79. 121
  80. 122
  81. 123
  82. 124
  83. 125
  84. 126
  85. 127
  86. 128
  87. 129
  88. 130
  89. 131
  90. 132
  91. 133
  92. 134
  93. 135
  94. 136
  95. 137
  96. 138
  97. 139
  98. 140
  99. 141
  100. 142
  101. 143
  102. 144
1 / 13

Press play to hear the narration, or step through at your own pace.

Key takeaways

  • Inventory
  • find gaps early and often
  • rank by real risk
  • fix the class
  • verify
  • detect, respond, learn

Notes

Step 1 · Inventory

Step one is the inventory. A list of everything the company owns: servers, cloud accounts, domains and subdomains, code repositories, laptops, the SaaS tools staff use, and every place data is stored, with an owner for each. It sounds dull and it is the foundation of everything. In the last episode the attacker got in through a staging site nobody remembered. The forgotten system is the one that gets breached.

Asset inventory
  • servers, cloud accounts, domains and subdomains
  • code repositories
  • laptops and phones
  • SaaS tools and who can log in data stores: what is in them, who owns them
  • the forgotten system is the one that gets breached

Step 2 · Find gaps

Step two is finding gaps, and the cheapest place to find them is before anything is built. In a design review the security engineer reads the plan for a new feature. In a threat model the team asks, in a structured way, what could go wrong here and what stops it. A flaw caught on a whiteboard costs an hour to fix. The same flaw found after launch can cost a quarter of work, or a breach.

While code is written, people and tools read it. Security engineers review the risky changes: logins, payments, file uploads. Static analysis scans the source for dangerous patterns. Software composition analysis checks the open-source libraries you depend on for known flaws. Secret scanning catches keys committed to git. Infrastructure scanning reads Terraform and flags a port or bucket that would be opened to the world. All of it runs inside the pipeline, on every change.

Once systems are live, the team attacks, scans and audits them. Vulnerability scanners look for missing patches and weak settings. Penetration testers and red teams attack the way a real enemy would. A bug bounty invites outside hackers to report flaws for a reward. Cloud posture tools read every setting in the cloud accounts and flag risky roles and public storage. And audits compare the whole company against a standard, control by control.

Before code is written
  • design review: read the plan for a new feature or system
  • threat model: what could go wrong, and what stops it?
  • security requirements: login, data, logging rules up front
  • a design flaw found here costs an hour, not a quarter
While code is written
  • code review for risky changes
  • SAST: scans your source code
  • SCA: scans the libraries you depend on secret scanning: keys in git
  • IaC scanning: Terraform that would open a port or bucket
  • all run inside the pipeline
On running systems
  • vulnerability scans: missing patches, weak settings
  • penetration tests and red team
  • bug bounty: outside hackers report flaws for a reward
  • cloud posture checks: risky roles, public storage
  • audits against a standard

Step 3 · Rank

Step three is ranking, because scanners produce thousands of findings and a team has time for a few. Four questions sort them. How severe is the flaw? Is it being exploited in the wild right now? Can an attacker actually reach it, or is it buried on an internal system? And what does it protect: test data, or card numbers? A medium flaw on the public login page often beats a critical one on an isolated test box. Each rank gets a deadline.

Rank by real risk
  • how bad is it? (severity)
  • is it being exploited in the wild right now?
  • can an attacker reach it? internet-facing or internal
  • what does it protect? test data or card numbers
  • fix dates set by rank

Step 4 · Fix

Step four is the fix, and there are three levels. A patch fixes this one bug. A pattern fixes the whole class of bug: one safe database helper that every developer uses, so injection cannot happen anywhere. A guardrail makes the mistake impossible: a cloud policy that simply refuses to create a public bucket. Senior engineers aim for the third level, because a guardrail keeps working when everyone is busy and nobody is looking.

Three levels of fix
  • patch: fix this one bug
  • pattern: fix the whole class, such as one safe query helper everyone uses
  • guardrail: make the mistake impossible, such as a policy that blocks public buckets
  • aim for the third

Step 5 · Verify

Step five is verification. A ticket marked done is a claim, not proof. So you run the same attack again and confirm it now fails. You add an automated test, so the bug cannot quietly come back in six months. You rescan, in every environment and not just one. And you look for the same flaw in sibling services, because a mistake one team made is usually a mistake three teams made.

Prove it is closed
  • run the attack again: it must now fail
  • add a test so the bug cannot quietly return
  • rescan, and check every environment, not just one look for the same flaw in sibling services

Steps 6 to 8

Prevention is never perfect, so the loop continues. Detect: collect logs and write alerts for real attack steps, like a login from a new country followed by a large download. Respond: contain the problem, remove the attacker, recover. Learn: hold a blameless review that asks what allowed this, not who to blame. The lesson becomes a new guardrail or a new alert, and that closes the loop back to step one.

Detect, respond, learn
  • detect: collect logs, write alerts for real attack steps
  • respond: contain it, remove the attacker, recover
  • learn: a blameless review, what let this happen?
  • the lesson becomes a new guardrail or alert

Working with teams

One last thing decides whether the loop works: how security treats other teams. Security that only says no gets bypassed. So good teams build guardrails instead of gates, and paved roads, where the easy way to do something is also the secure way. They explain the risk rather than quote the rule. They automate every repeated check. And they answer quickly with yes, and here is how to do it safely. Teams then invite security in early, which is where it is cheapest.

Habits that work
  • guardrails, not gates
  • paved roads: the easy way is the secure way
  • explain the risk, not the rule
  • automate every repeated check
  • be easy to reach, quick to answer
  • say yes, and here is how

Common mistakes

Mistakes. Working without an inventory. Scanning endlessly while nothing gets fixed. Sorting by severity alone, ignoring what is reachable and exploited. Patching one example and leaving the class of bug alive. Closing tickets without proving the fix. Blaming people after incidents, which teaches everyone to hide problems. And becoming the team of no, which guarantees that risky work happens anyway, just without you in the room.

Avoid these
  • no inventory
  • scanning without fixing
  • sorting by severity alone
  • patching one bug, not the class
  • closing tickets unverified
  • blame after incidents
  • being the team of "no"

Say it like this

In the interview: I start with an inventory, because you cannot secure what you do not know about. I find gaps early with design reviews and threat models, in the pipeline with scanners, and on live systems with testing and posture checks. I rank findings by real, reachable risk, fix the whole class with patterns and guardrails rather than one bug, verify the fix, and keep detection and response ready for whatever still gets through.

In the interview
  • "First an inventory. Then find
  • gaps early with design reviews
  • and threat models, in the pipeline with scanners, and on live systems with tests. Rank
  • by reachable risk, fix the class with guardrails, verify, and keep detecting."

Interview questions

Q1How do security teams find vulnerabilities?

Before build with design reviews and threat modeling; during build with code review, SAST, dependency (SCA), secret and IaC scanning; and on live systems with vulnerability scans, penetration tests, bug bounties, cloud posture checks and audits.

Q2Why is an asset inventory the first step?

You cannot patch, monitor or protect systems you do not know exist. Unknown and forgotten assets, such as old test sites or unused cloud accounts, are a common entry point because nobody maintains them.

Q3How do you prioritise vulnerabilities?

By real risk rather than severity alone: how severe the flaw is, whether it is being exploited in the wild, whether an attacker can reach it, and how sensitive the data or system behind it is. Each rank gets a fix deadline.

Q4What is the difference between a gate and a guardrail?

A gate stops work until someone approves it. A guardrail lets teams move freely but automatically blocks the dangerous action, for example a policy that prevents creating a public storage bucket.

Q5What is a paved road in security?

A supported, easy path, such as templates, libraries and pipelines with security built in, so the simplest way for a developer to do something is also the secure way.

Q6What does shift left mean?

Moving security earlier in the development life cycle: requirements, design review and checks in the developer workflow and pipeline, where problems are far cheaper to fix than after release.

Q7How do you verify that a vulnerability is really fixed?

Reproduce the original attack and confirm it now fails, add a regression test, rescan every environment, and look for the same flaw in similar services so the whole class is closed.

Q8Why are incident reviews blameless?

Blame makes people hide mistakes and near misses. A blameless review focuses on the conditions that allowed the incident, which produces honest timelines and fixes to systems rather than punishment of individuals.