SSDLC Hub
SSDLC Series / Part 2 of 2

Putting Strategy into Practice: How We Tamed SonarQube using TLCTC

In Part 1, we defined the roles. In Part 2, we show the results. See how we transformed a messy CWE report into actionable threat intelligence by automating context-aware mapping.

BK
Bernhard Kreinz
Loading...
Series Context

In Part 1, we distinguished between the strategic "Programmer" and tactical "Coder." This post applies that theory to a real-world problem: a SonarQube report full of unprioritized findings.

Introduction: The Problem of Noise

Our journey began where many security initiatives stall: with a problem. Our SAST report was a sea of red—a long, flat list of Common Weakness Enumeration (CWE) findings. While technically accurate, it was overwhelming and lacked strategic context. A CWE-120 (Buffer Copy) meant nothing to our risk managers, and "fix everything" meant nothing to our developers.

The breakthrough came when we stopped looking at "what" was wrong (the CWE) and started looking at "how" it could be exploited (the TLCTC cluster).

The "Aha!" Moment

We realized that a single CWE could map to different threats depending on where it lived in the architecture.

  • If a buffer overflow (CWE-120) is in the server-side API, it's #2 Exploiting Server.
  • If the exact same flaw is in a client-side library, it's #3 Exploiting Client.

This distinction, derived from the axioms of the TLCTC framework, completely changed our prioritization strategy.

Methodology: From Manual to Automated

1. Mapping Workshops

We started by manually reviewing our backlog. We took real findings and mapped them to TLCTC clusters. This exercise built a shared language. A CWE-863 (Incorrect Authorization) wasn't just a bug anymore; it was identified as a potential #1 Abuse of Functions vector.

2. Checklists via the "Attacker's View"

To make this actionable for developers, we adopted the "Attacker's View" vs. "Developer's View" concept. For #4 Identity Theft, instead of listing 20 different CWEs, we gave developers a single clear directive:

Attacker's View: "I abuse credentials to operate as a legitimate identity."
Developer's View: "I must implement secure credential lifecycle management: proper hashing, secure transmission, and robust session handling."

3. Automating with SonarQube

We built a custom post-processing script to automate the triage. The logic was simple but powerful: combining the specific vulnerability (CWE) with the architectural context (File Path) to determine the Threat Cluster.

Click to Enlarge
SonarQube JSON Check CWE ID CWE-798 (Creds) File Path? #4 IDENTITY TLCTC-04.00 #2 SERVER EXP. TLCTC-02.00 (/api/) #3 CLIENT EXP. TLCTC-03.00 (/ui/) Strategic Risk Dashboard
Figure 1: The automated triage logic flow. We combine the raw finding (CWE) with architectural context (Path) to derive the strategic Threat Cluster tag.
triage-logic.js
function mapToTLCTC(cwe, filePath) {
  // #4 Identity Theft (Credentials)
  if (['CWE-798', 'CWE-259', 'CWE-321'].includes(cwe)) {
    return 'TLCTC-04.00'; 
  }

  // #2 vs #3 based on Context
  if (['CWE-89', 'CWE-120', 'CWE-78'].includes(cwe)) {
    if (filePath.includes('/server/') || filePath.includes('/api/')) {
      return 'TLCTC-02.00'; // Server Implementation Flaw
    }
    if (filePath.includes('/client/') || filePath.includes('/ui/')) {
      return 'TLCTC-03.00'; // Client Implementation Flaw
    }
  }
  
  return 'TLCTC-Unknown';
}

Impact: Attack Path Thinking

The real win wasn't just tagging; it was connecting the dots. Before TLCTC, we saw two medium-risk bugs: "Hardcoded Creds" and "SQL Injection." After TLCTC, we saw a high-severity Attack Path.

By seeing these as #4 Identity Theft and #2 Exploiting Server, we could model the sequence:

#9 (Phishing) → #4 (Steal Hardcoded Creds) → #2 (Auth & Exploit SQLi)

This perspective completely changed our prioritization. We weren't just fixing bugs; we were breaking attack chains.

Results & Recommendations

This shift in perspective improved communication across the board. We used the Bow-Tie model to explain our strategy to management: "We are fixing controls on the left side (Causes) to prevent the Center Event (Compromise)."

Area Before TLCTC After TLCTC
SAST Triage Whack-a-mole with flat CWE lists Prioritized by Threat Cluster & Attack Paths
Reporting "We have 150 open vulnerabilities" "Our primary risk is #2 Exploiting Server"
Architecture Lacked security context Explicitly addresses #1, #4, #5 by design

Conclusion

If you want to replicate this, start small. Don't try to map every CWE immediately. Start with your existing SAST report, apply the "Programmer vs. Coder" roles defined in Part 1, and use the simple dual-notation (`#X` for strategy, `TLCTC-XX.YY` for tooling). The framework gives you the mental model to turn noise into signal.

References

  1. Kreinz, B. TLCTC White Paper V1.9.1, Page 30, "Clarifications: CWE".
  2. Kreinz, B. TLCTC White Paper V1.9.1, Page 61, "Standardizing Operational Cybersecurity".
  3. Kreinz, B. TLCTC White Paper V1.9.1, Page 11, "Axioms and Assumptions".
  4. Kreinz, B. TLCTC White Paper V1.9.1, Page 15, "#1 Abuse of Functions".
  5. Kreinz, B. TLCTC White Paper V1.9.1, Page 16, "Attacker's View vs Developer's View".
  6. Kreinz, B. TLCTC White Paper V1.9.1, Page 45, "Sequences in Cyber Threat Clusters".
  7. Kreinz, B. TLCTC White Paper V1.9.1, Page 36, "Cyber Bow-Tie".
  8. Kreinz, B. TLCTC White Paper V1.9.1, Page 65, "The Need for Multi-Layer Notation Convention".