Secrets, Dependency/Supply-Chain Signals, and Advanced Security Boundaries: Core Concepts and Mental Model
Place SonarQube secret and dependency signals inside a layered application-security model without confusing detection with credential lifecycle, SCA, SBOM, or remediation ownership.
Learning objectives
- Separate secret detection, credential lifecycle, dependency inventory, SCA, SBOM, external-issue import, and SonarQube governance into distinct states.
- Explain what Community Build can detect natively and what requires commercial SonarQube Server or a dedicated external control.
- Trace source/config/dependency evidence → native or imported analyzer signal → Compute Engine → issue/risk state → downstream remediation owner.
-
Define the current secret-analysis scope, including
language-analyzer files and
sonar.text.inclusions. - Explain why imported SARIF findings remain owned by the external producer and are not converted into Sonar-managed rules or native SCA inventory.
- Interpret a green security result as bounded evidence, never as proof that credentials or supply-chain risk are completely controlled.
1. The practical problem: security signals cross ownership boundaries
Chapter 15 separated vulnerabilities, hotspot-style review, and taint-analysis capability. Chapter 16 adds a different boundary: some security facts are discovered in source, some are created by dependency tools, and some live outside SonarQube entirely.
A hard-coded credential can be detected by SonarQube, but detection does not revoke or rotate that credential. A dependency risk can be imported as an external issue, but importing one result does not create a complete dependency inventory or Software Bill of Materials. SonarQube Advanced Security can provide native SCA and SBOM capabilities in supported commercial deployments, but Community Build does not become an SCA engine merely because it can display a SARIF finding.
source/config/dependency context → native secret rules OR
optional Sonar SCA/advanced security OR external analyzer →
analysis report → SonarQube issue/risk state → owning remediation
system → reanalysis / rotation / upgrade / governance
evidence
2. Mental model: detection, inventory, remediation, and credential control are different jobs
flowchart TD A[Source + config + manifests] --> B[Community secret rules] A --> C[External SCA / secret tool] A --> D[Optional SonarQube Advanced Security SCA] B --> E[Native Sonar issue] C --> F[SARIF / generic external report] F --> G[External Sonar issue] D --> H[Native dependency inventory / risks / SBOM] E --> I[Code/config remediation] G --> J[Producer-owned remediation] H --> K[Dependency upgrade / license / supply-chain action] I --> L[Credential manager: rotate/revoke if real]
The arrows show causality and ownership. SonarQube can be the place where evidence is analyzed and governed, but the system that owns a credential, package version, artifact repository, or SBOM release record may be different.
3. State ledger before changing anything
Source/revision
Git SHA, indexed files, configuration files, dependency manifests/lockfiles, generated files, and exact fake-secret locations.
Scanner/analyzer
Scanner version/runtime, active secret rules, text-inclusion scope, external report paths, producer tool/version, and analyzer ownership.
Server/process
Community Build/Server version, edition, instance mode, report
upload, ceTaskId, task status, analysis ID, and
Quality Gate.
Finding/inventory
Native issue vs external issue vs Advanced Security dependency risk, rule identity, dependency/component evidence, status, false-positive state, and history.
Downstream controls
Vault/secret manager, credential issuer, package manager, repository, SCA/SBOM system, patch owner, license owner, and audit record.
4. Community Build secret detection: useful, bounded source evidence
Current Community Build includes basic secret detection. The secrets
analyzer examines files processed by language analyzers and can also
scan language-agnostic text files brought into scope through
sonar.text.inclusions. Current default text-inclusion
patterns include common shell/config/key file shapes such as
*.sh, *.ps1, *.properties,
*.conf, *.pem, .env, and
*.key.
This is a source-analysis control. It does not know whether a detected credential is currently valid, whether it has already been revoked, whether the same credential leaked through logs or tickets, or whether rotation completed in the provider. If a real credential is exposed, remediation normally requires both source cleanup and credential revocation/rotation in the owning system.
5. Basic, enhanced, and custom secret rules
| Capability | Current boundary | Operational meaning |
|---|---|---|
| Basic secret detection | Community Build | Basic hard-coded credential/public-cloud patterns in supported source/text scope. |
| Expanded/powerful secret detection | Commercial Server capability beginning with Developer edition according to current product packaging | Much broader service/pattern coverage; verify the exact release and rule inventory. |
| Organization-specific custom secret patterns | Enterprise edition | Administrators can define company-specific secret rules; this is not available in Community Build. |
| Credential rotation/revocation | External credential owner | Vault, cloud/IAM provider, database, CI secret store, or other issuer—not a SonarQube rule action. |
6. Dependency and supply-chain analysis: do not infer SCA from manifest visibility
A repository may contain requirements.txt,
pom.xml, package-lock.json, or another
manifest. Seeing that file in source analysis does not automatically
mean the current edition has built a complete dependency graph.
Current SonarQube Advanced Security provides Software Composition Analysis as a SonarQube Server add-on starting in Enterprise edition. When licensed and enabled, it can analyze dependencies, surface dependency risks, and expose dependency inventory/SBOM capabilities. That is a different product state from Community Build.
7. External issue import is aggregation, not ownership transfer
Community Build can import third-party findings through built-in
analyzer integrations, Sonar generic issue format, or SARIF 2.1.0.
SARIF is configured on the scanner side with
sonar.sarifReportPaths.
The imported issue participates in the SonarQube analysis result, but its external rule is not managed on SonarQube’s Rules page and is not part of a Sonar quality profile. If you mark an imported issue false positive inside SonarQube, that change does not update the external producer. This is why the evidence packet must identify both systems.
8. Ownership matrix
| Security fact | Detection/inventory owner | Remediation owner | Evidence to retain |
|---|---|---|---|
| Hard-coded fake credential pattern | Sonar native secret rule | Developer/source owner | Rule, line, revision, fix, reanalysis. |
| Real exposed credential | Secret scanner(s) | Credential issuer/secret manager + source owner | Finding, revocation/rotation record, source cleanup, reanalysis. |
| Synthetic imported dependency risk | External report producer | Dependency/package owner | Producer report, Sonar import evidence, package decision. |
| Native Advanced Security dependency risk | SonarQube Advanced Security SCA | Dependency/package/license owner | Dependency path, risk, SBOM/inventory, update/acceptance evidence. |
| Release SBOM | Dedicated SBOM/SCA process or Advanced Security where licensed | Release/compliance owner | Immutable release-linked CycloneDX/SPDX artifact and provenance. |
9. Read-only inspection first
git rev-parse HEAD
sonar-scanner --version
curl -fsS "$SONAR_HOST_URL/api/system/status"
# Inspect current secrets configuration in the UI:
# Administration / Project Settings → General Settings → Languages → Secrets
# Record sonar.text.inclusions and whether secret analysis is active.
# Preserve scanner-created task identity after an analysis:
cat .scannerwork/report-task.txt
# Read-only issue evidence:
curl -fsS -H "Authorization: Bearer $SONAR_TOKEN" \
"$SONAR_HOST_URL/api/issues/search?componentKeys=$SONAR_PROJECT_KEY&ps=100"
Do not begin by deactivating a noisy secret rule or by importing another tool’s result. First prove the current native rule scope, current edition features, current project findings, and whether a dependency/SBOM view is actually licensed and populated.
Knowledge check
A SonarQube issue identifies a real exposed API token. Has the token been revoked?
No. SonarQube detected source evidence. Revocation/rotation belongs to the credential issuer or secret-management system and must be verified separately.
Does importing a dependency SARIF report into Community Build create a native SBOM?
No. It creates imported external issue evidence. Native SCA/dependency inventory/SBOM requires the relevant Advanced Security capability or another dedicated tool.
Who owns an imported SARIF rule?
The external producer. SonarQube displays/imports the issue but does not make the external rule part of its quality profiles.
Can Community Build define company-specific custom secret regex rules?
No. Current custom secret-pattern support starts in Enterprise edition.
Why record the manifest/lockfile separately from a dependency-risk finding?
The manifest is source dependency metadata; a dependency graph/risk is derived evidence created by an SCA engine. They are different states and may come from different tools.
Official references and version notes
- SonarQube downloads / feature comparison — current Community Build 26.9.0.129388; basic secret detection in Community Build; broader commercial secret/security features.
- Community Build — Secrets — secret scope, text inclusions, file processing, and Community limitation on custom patterns.
- SonarQube Server — Secrets — current server secret configuration and custom secret-pattern behavior; custom patterns start in Enterprise edition.
- About external issues — imported-rule ownership and the fact that Sonar issue workflow changes do not update the external producer.
-
SARIF reports
— SARIF 2.1.0 requirements and
sonar.sarifReportPaths. - SonarQube Advanced Security — Enterprise-edition-and-above add-on boundary.
- Analyzing projects for dependencies (SCA) — native dependency-risk analysis prerequisites, build-environment implications, and licensing.
- Viewing dependencies / SBOM — native dependency inventory and SBOM evidence when Advanced Security is licensed.
- SonarScanner CLI 8.1.0.6389 — scanner baseline used by the local path.
Rechecked 2026-09-08. Mandatory examples target SonarQube Community Build 26.9.0.129388 and SonarScanner CLI 8.1.0.6389. Commercial reference streams are SonarQube Server 2026 Release 4.1 and 2026.1.5 LTA. Community Build currently provides basic secrets detection and SARIF/generic external-issue import. Current product packaging expands secret coverage in commercial Server editions, while organization-specific custom secret patterns start in Enterprise edition. SonarQube Advanced Security SCA is a Server add-on starting in Enterprise edition; native dependency inventory/risk/SBOM evidence must not be claimed on Community Build merely because a manifest exists or a SARIF dependency issue was imported. Recheck secret rules, text inclusion defaults, external-report schema, supported package managers/languages, and license entitlements before automating another release.
SonarQube product names, editions, release trains, scanner runtimes, APIs, authentication options, and platform prerequisites can change independently. Re-check the linked SonarSource primary documentation for the exact target release before applying version-sensitive commands or operational guidance outside the disposable course environment.
Keep the academy open
Support free, practical DevOps education.
Every lesson is designed to remain readable in a browser, downloadable from GitHub, and usable without a paid learning platform. Contributions help expand and maintain the curriculum.
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0Send only Ethereum/ERC-20 compatible assets to this
address.