Running threat modelling throughout application development
Running threat modelling throughout application development connects a security requirement to the behaviour of a real feature. The relevant controls need to remain effective across custom code, integrations and the production configuration. Understanding threat modelling throughout application development helps establish which security property the feature needs and where that property is actually enforced.
What does this involve?
Security architecture describes assets, identities, trust boundaries and the controls expected between components. Documentation is useful when it reflects real deployment and helps reviewers test important assumptions, rather than simply listing products or broad intentions.
In the context of application security, threat modeling is a structured, repeatable process used to gain actionable insights into the security characteristics of a particular system. It involves modeling a system from a security perspective, identifying applicable threats based on this model, and determining responses to these threats. Threat modeling analyses a system from an adversarial perspective, focusing on ways in which an attacker can exploit a system.
Threat modeling is ideally performed early in the SDLC, such as during the design phase. Moreover, it is not something that is performed once and never again. A threat model is something that should be maintained, updated and refined alongside the system. Ideally, threat modeling should be integrated seamlessly into a team's normal SDLC process; it should be treated as a standard and necessary step in the process, not an add-on.
Why it matters
Consider a realistic failure: a design change introduces a new trust relationship without anyone assessing how it can be misused.
An undocumented trust assumption can leave a feature depending on a check that no component actually performs. Gaps may span applications, services and operational processes, making ownership and verification especially important.
Implementation guidance should be applied to a real feature and its deployment. Framework defaults, custom handlers and integrated services all influence whether the intended protection remains effective.
How penetration testers check for it
Trace the relevant feature from its entry point to the data or operation it protects, including custom code and alternate paths.
- Map sensitive data and consequential operations.
- Identify the component responsible for each security decision.
- Compare documented trust relationships with deployment and code.
- Record assumptions, exceptions and evidence of enforcement.
How to fix it
Use the appropriate maintained mechanisms and verify the result in the actual production configuration.
- What are we going to do about it?.
- Shared responsibility: understanding which security controls are managed by the provider vs. the customer.
- Use STRIDE's six categories as prompts while reviewing the system model. Brainstorm threats with the team and record which components, data flows, or trust boundaries they affect.
- Do not add techniques only to make the model appear comprehensive. State why each technique fits the scope and record any concerns it does not address.
- Reduce unnecessary trust and privilege between components.
- Verify important requirements through focused review and testing.
A diagram or checklist is planning evidence, not proof that a control works. Assurance comes from connecting the stated requirement to implementation and observed behaviour.
Recheck the changed behaviour against the original failure conditions and the legitimate user journey. Keep enough evidence to show which release and configuration were verified, and include related entry points that depend on the same security decision.
Related issues
- Applying secure Symfony configuration and development patterns
- Using precise security terminology in development requirements
- Running a practical secure code review process
Read about our methodology or contact pentested.com to discuss secure development and code review.