bworkx.

Reference method

Reference methodApplication securitySemgrepCodeQLSonarQube CommunityBanditGosec

SAST assessment method

How bworkx scopes, scans, triages, reports, and integrates static application security testing without drowning a team in false positives.

Problem. A raw scanner report creates a backlog, not a fix.

Reference method. This page describes how bworkx runs a SAST assessment. It is not a client engagement, a code audit of a live product, or a compliance certification.

Why a method, not a scanner run

A static analyser is a pattern-matching engine. It does not know the business, the framework conventions, or which data is actually untrusted. Left untuned, it produces a long list that the engineering team learns to ignore.

A useful SAST engagement is mostly decisions:

  • What code is in scope?
  • Which rules match the stack?
  • What is a real data flow, and what is a false positive?
  • Which findings block a release, and which are hardening advice?
  • How does the scan stay useful after the consultant leaves?

1. Scope and authorization

The engagement starts with a written scope:

  • Repositories, branches, and commit range.
  • Languages, frameworks, and build systems.
  • Generated code, vendored dependencies, and test fixtures.
  • Source access method, NDA, and confidentiality terms.
  • Evidence handling and code retention.
  • The person who can approve a code fix.

Source code is among the most sensitive assets a company has. Access is limited, logged, and removed at the end of the engagement.

2. Ruleset and baseline

The default ruleset is a starting point. We tune it to the stack:

  • Framework-specific rules for Frappe, Django, Rails, Spring, Express, or .NET.
  • Custom rules for internal patterns that are dangerous in this codebase.
  • Suppressions for generated code and known-safe patterns.
  • A baseline that separates existing findings from new code.

The baseline is what makes the engagement survivable. A first scan of a mature repository should not create a demand to fix everything at once.

3. Scan

The scan is reproducible: same repository, same commit, same rules, same result.

Tools are chosen for the stack and the licence constraints:

  • Semgrep for broad language coverage and custom rules.
  • CodeQL where the repository licensing allows it. Private repositories may require GitHub Advanced Security; we neither require nor resell that subscription.
  • SonarQube Community Build for a self-hosted baseline.
  • Bandit, Gosec, Brakeman, ESLint security plugins, SpotBugs, and PMD for language-specific checks.
  • Gitleaks and Trivy for secrets and dependency findings where they are in scope.

No paid scanner subscription is required. If the client already owns a platform, it is used only within the agreed scope.

4. Triage

Every finding is reviewed:

Question Why it matters
Is the source untrusted? A pattern on a constant or internal value may not be exploitable
Is the sink reachable? Dead code and test-only paths are different from production code
Is there a framework control? ORM parameterization, output encoding, or a security middleware may already mitigate it
What is the impact? A reflected value in an admin-only page is not the same as authentication bypass
What is the smallest fix? A fix that fits the codebase is more likely to be applied

Confirmed findings are ranked by exploitability and business impact, not by the scanner’s default severity alone. False positives and accepted risks are documented, with the reason.

5. Reporting

Each confirmed finding includes:

  • Title and affected component.
  • Evidence: file, line, and the relevant data flow.
  • Reproduction or exploit path where possible.
  • Business impact in plain language.
  • Remediation direction and references.
  • Status: open, fixed, accepted risk, or false positive.

The report separates release-blocking issues from hardening advice. It also states what was not scanned, so nobody mistakes coverage for a guarantee.

6. CI/CD integration

The scan should outlive the engagement. We integrate it into the pipeline:

  • Pull-request checks on changed code.
  • A baseline for existing findings.
  • A gate that fails on agreed severity levels.
  • An owner for the ruleset and suppressions.
  • A policy for accepting risk.

A gate that fails on every warning will be disabled within a week. The useful gate is narrow, explainable, and owned.

7. Re-scan and handover

After fixes, the agreed findings are re-scanned and the report is updated. The handover includes the ruleset, the pipeline configuration, the baseline, and the suppression policy.

What this method does not cover

  • Dynamic testing or a penetration test.
  • Runtime business-logic abuse.
  • Infrastructure and cloud configuration review.
  • Compliance certification or a guarantee of security.
  • A full manual code audit of every file; SAST is targeted, and manual review is scoped to high-risk areas.

What I would do differently

Baseline before gating. Tune before turning on a blocking check. And write the suppression policy before the first false positive becomes a habit of ignoring the tool.

Outcome. A triaged source-code review with a tuned ruleset, evidence, and a CI gate the team can maintain.

Next step

Need an assessment like this?

If you are preparing for a review, a launch, or a customer security questionnaire, start with the scope and the authorization.