Checkpoint Lab — SAML, LDAP, OIDC/SSO, Proxies, TLS, and Network Security
Produce a rollback-ready trust-boundary dossier that proves local TLS/proxy behavior and validates fake identity/group mapping without using enterprise credentials or uncontrolled systems.
Learning objectives
- Produce a complete trust-boundary diagram and rollback plan for external authentication/network ingress.
- Execute a local TLS/reverse-proxy test with certificate verification enabled.
- Diagnose and repair one deliberate forwarded-protocol or callback/base-URL mistake.
- Validate synthetic SAML/LDAP/OIDC identity/group contracts without enterprise credentials.
- Prove the local recovery path survives the experiment.
- Package assumptions, limits, evidence, and cleanup state for governance review.
1. Checkpoint scenario
You are preparing a SonarQube instance for delegated authentication. Before any production IdP or public DNS change, you must prove the network/authentication contract locally. Your dossier must show:
- where TLS terminates and how the backend is protected;
- the external Server base URL and callback calculation;
- trusted proxy headers;
- one synthetic identity/group mapping;
- the built-in LDAP/SAML versus optional OIDC/plugin boundary;
- a tested local administrator recovery route;
- one deliberate misconfiguration and causal repair;
- explicit residual limitations.
2. Exact assumptions
| Component | Checkpoint assumption |
|---|---|
| SonarQube | Community Build 26.9.0.129388 |
| Java/database/plugins | No changes required; record actual runtime/database and existing plugin list |
| Backend |
http://127.0.0.1:9000, local disposable
instance
|
| Proxy |
Python teaching proxy on https://localhost:9443
|
| TLS |
Two-day localhost self-signed certificate explicitly trusted
with --cacert
|
| SAML | Built-in Community Build capability; fake metadata/claims only |
| LDAP | Built-in Community Build capability; configuration simulation only unless a local disposable LDAP server exists |
| OIDC | Not claimed as native current Community Build auth; simulation/optional third-party plugin only |
| Credentials | No production IdP, LDAP, CI, scanner, or admin secrets in files/evidence |
3. Predictions before actions
- Prediction 1: HTTPS requests with the local certificate explicitly trusted will reach the same SonarQube system status as the HTTP backend.
-
Prediction 2: the deliberate
X-Forwarded-Proto=httpproxy run will still be capable of reaching the API but will leave incorrect external-transport evidence in the proxy log. - Prediction 3: a mismatched Server base URL/callback origin can be detected offline without a real IdP.
- Prediction 4: the local administrator remains usable after the proxy/SSO simulation because external identity was never made the only recovery path.
4. Execute the local proxy experiment
Reuse the certificate and proxy.py from Lesson 2.
Preserve both the broken and corrected states:
mkdir -p evidence/{broken,fixed,identity}
# Broken forwarded protocol
python proxy.py http > evidence/broken/proxy.log 2>&1 &
echo $! > proxy.pid
sleep 1
curl --cacert localhost.crt -fsS \
https://localhost:9443/api/system/status \
| tee evidence/broken/system-status.json
kill "$(cat proxy.pid)"
# Correct forwarded protocol
python proxy.py https > evidence/fixed/proxy.log 2>&1 &
echo $! > proxy.pid
sleep 1
curl --cacert localhost.crt -fsS \
https://localhost:9443/api/system/status \
| tee evidence/fixed/system-status.json
grep 'FORWARD proto=' evidence/broken/proxy.log \
| tee evidence/broken/forwarded-header.txt
grep 'FORWARD proto=' evidence/fixed/proxy.log \
| tee evidence/fixed/forwarded-header.txt
The server result may be identical while the proxy evidence differs. Record that the defect existed at the network/trust boundary, not in the SonarQube database, rules, users, or projects.
5. Prove the external origin contract
external_url=https://localhost:9443
server_base_url=https://localhost:9443
saml_reply_url=https://localhost:9443/oauth2/callback/saml
proxy_host=localhost:9443
proxy_forwarded_proto=https
Now deliberately set the offline server_base_url record
to https://localhost:9444, run the Lesson 4 origin
validator, preserve its assertion failure, restore
9443, and preserve the passing output. This is the
checkpoint’s required deliberate configuration failure.
6. Required trust-boundary diagram
flowchart LR B[Browser] -->|HTTPS + validated cert| RP[Loopback reverse proxy :9443] RP -->|HTTP trusted backend| SQ[SonarQube :9000] SQ -. fake SAML contract .-> IDP[Synthetic IdP metadata] IDP -. identity + groups .-> SQ SQ --> GRP[Existing SonarQube groups] GRP --> PERM[Global / project permissions] A[Local recovery admin] --> SQ SC[Scanner / CI token path] -->|separate authentication| RP
Annotate the real production design separately if it differs. Do not pretend the local Python proxy is production architecture.
7. Synthetic identity/group validation
{
"identity_provider": "fake-saml",
"login": "alice-lab",
"display_name": "Alice Lab",
"email": "alice@example.invalid",
"groups": ["sq-ch22-developers"],
"forbidden_groups": ["sonar-administrators"]
}
Run the offline claim validator and store the output in
evidence/identity/claims-validation.txt. Then write a
short mapping note explaining which SonarQube permissions the
sq-ch22-developers group would receive and which
privileged permissions it explicitly would not receive.
8. LDAP and OIDC boundary notes
Your evidence packet must include:
- LDAP: fake LDAPS URL, bind/search/group fields, required Java trust-store note, and statement that no real directory was queried.
- SAML: fake IdP entity/login URL, external callback, identity/group attributes, and statement that no production assertion was used.
- OIDC: fake issuer/discovery endpoints plus a statement that current Community Build native authentication documentation does not list generic OIDC; any third-party plugin would require separate plugin compatibility/security approval.
9. Prove rollback/recovery
- Restore the pre-lab Server base URL if you changed it.
- Verify the local administrator can still authenticate through the normal local/backend route.
- Stop the proxy.
- Delete only the local private key and temporary proxy process/state after evidence capture.
- Do not delete server logs before extracting the relevant window.
- Do not modify the database/search indices directly to “undo” authentication changes.
10. Required evidence packet
-
assumptions.md— version, runtime/database/plugin notes, local-only scope. -
topology.mmdor equivalent trust-boundary diagram. -
certificate.txt— subject/SAN/issuer/dates only; no private key. -
broken/proxy.logandfixed/proxy.logwith token/cookie redaction if any. - broken/passing origin-validator outputs.
- Server base URL before/lab/after record.
- fake SAML metadata and claim mapping.
- LDAP trust/mapping simulation note.
- OIDC product-boundary note.
- local recovery-admin verification.
-
limitations.md— what was not tested against real enterprise IdP/network infrastructure.
11. Residual-risk statement
This checkpoint proves the local reverse-proxy/TLS/header/base-URL contract and validates synthetic identity/group mappings for the recorded Community Build release. It does not validate a production CA, DNS, WAF/load balancer, corporate LDAP/IdP, MFA policy, SCIM lifecycle, Internet exposure, third-party OIDC plugin, or enterprise failover. Production rollout requires a separately authorized nonproduction integration test and normal change control.
12. What this adds to the governed operating model
Chapter 22 adds explicit network and external-identity trust boundaries to Chapter 21’s RBAC model. Authentication, TLS, proxy state, external group ownership, and SonarQube authorization can now be tested and rolled back independently.
Chapter 23 continues with Web API, Webhooks, Automation, Provisioning, and Policy as Code, turning these manually verified controls into safe, observable automation.
Knowledge check
Which evidence proves the deliberate proxy fault was repaired?
The broken and fixed proxy logs show the same local route with only forwarded protocol changing from http to https, while the backend server state remains unchanged.
Why is the SAML IdP fake in the mandatory checkpoint?
It validates callback/claim/group contracts without changing a production identity provider or using real enterprise credentials.
What must be in place before delegated auth can be considered rollback-ready?
A tested local recovery administrator, original base/config values, known proxy/cert changes, and a documented restoration procedure.
Does an SSO login prove the user has permission to administer a project?
No. SonarQube authorization remains a separate permission decision after authentication/group mapping.
What is the safe next chapter after manual trust-boundary validation?
Automate through Web APIs/webhooks with explicit scopes, idempotency, evidence, and policy-as-code controls rather than hiding configuration changes.
Official references and version notes
- Community Build — authentication and provisioning overview — current native delegated-authentication list and JIT/group-synchronization model.
- Community Build — LDAP — LDAP/AD authentication, group synchronization, LDAPS/trust guidance, logs and migration notes.
- Community Build — SAML overview — SP-initiated SAML, IdP certificate, attributes and group synchronization.
- Community Build — Server base URL — canonical external URL required for authentication/integration correctness.
- Community Build — securing behind a proxy — inbound HTTP model, TLS termination, required forwarded headers, and proxy examples.
- Community Build — networking requirements — external systems, base-URL reachability, HTTPS/proxy topology, and network rules.
-
Community Build — SAML with Microsoft Entra ID
— Reply URL format
/oauth2/callback/samland base-URL dependency. - Community OIDC plugin (third party) — optional generic OIDC path; explicitly not a first-party SonarSource native authentication guarantee.
Rechecked 2026-09-08. Mandatory examples target
Community Build 26.9.0.129388. Current Community
Build documentation lists HTTP-header, LDAP, SAML, GitHub,
Bitbucket Cloud, and GitLab authentication; LDAP and SAML are
available in Community Build with JIT/group synchronization.
Generic OIDC is not listed as a native method in the current
Community Build authentication overview, so this chapter treats it
as a configuration simulation or optional third-party-plugin path
requiring independent compatibility/security review. SonarQube
accepts inbound application traffic as HTTP; production HTTPS is
terminated at a reverse proxy/ingress/load balancer. For
HTTPS/SAML, X-Forwarded-Proto and
X-Forwarded-For must be set by the trusted proxy.
Server base URL must match the externally reachable
origin/callback design. Automatic provisioning/SCIM and other
enterprise identity lifecycle features are
edition/provider-specific and are not required by the mandatory
local path. Recheck authentication support, plugin compatibility,
proxy headers, callback URLs, Java trust-store requirements, and
provisioning ownership before applying this material to another
release.
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.