Skip to content

Build the GitHub SAML facts with openhound-saml-producer (Refs SpecterOps/saml-og-research#79) - #117

Merged
JimSycurity merged 7 commits into
feature/29-github-saml-fixturesfrom
feature/79-github-saml-producer-port
Dec 2, 2026
Merged

JimSycurity merged 7 commits into
feature/29-github-saml-fixturesfrom
feature/79-github-saml-producer-port

Conversation

@JimSycurity

@JimSycurity JimSycurity commented Nov 24, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Builds every SAML_* node and edge of the GitHub collector through openhound-saml-producer 0.4.6rc5 (PyPI), in the expanded v0.3 form. The hand-built SAML identifiers, kind constants, edge property classes, and builders are removed. No native GH_* kind changes. The SCIM provisioning slice from #24 is not in this pull request: the owner dropped it because main already resolves that edge by exact ID (df3f5d8).

  • Dependency: openhound-saml-producer==0.4.6rc5. The dev and container groups require openhound>=0.5.1, and the lock holds openhound 0.5.1 (Refs SpecterOps/saml-og-research#178). openhound 0.5.1 brings newer versions of some other packages and adds boto3.
  • models/saml_producer.py (new): the producer and the service provider and issuer facts.
  • saml_service_provider.py, saml_issuer.py, saml_assertion_consumer_service.py, external_identity.py: library builders.
  • tests/test_saml_conformance.py (new): assert_conformant on the collector output.

Before and after comparison

Input: the #29 fixture (bottom of this stack). Method: the #29 baseline test, run on the port before the baseline was regenerated, then a node-by-node and edge-by-edge comparison. Old service provider IDs are mapped to new IDs through SAML_Implements.

Sign-in paths do not change. The 5 SAML_HasAccount edges have the same account endpoints, match_values, scoped_exact_match_values, entra_object_id_match_values, direct_binding (true), and account_state (unknown). The 19 non-SAML nodes and 26 non-SAML edges are byte-identical. The node and edge counts per SAML kind do not change.

Difference Cause
Every SAML_* node ID is a library UUIDv5 (was `github:saml:sp acs
The 5 issuer nodes have one shared ID, keyed by entity ID, and differ only in environmentid. SAML_TrustsIssuer points to that ID. ACS nodes use the same shared-node form. Library shared-node design.
Service provider: name is the environment name; node_id, native_id, entity_id, environment_name, saml_provider_id removed; native_object_id, native_object_name, native_kind, technology, rule_count added; scope properties become github_scope_type and github_scope_slug. Library node properties; collector-specific values move to github_ extras.
Issuer and ACS nodes keep only contract properties. route_source moves to SAML_HasAssertionConsumerService with the same value. Shared nodes carry no scope-specific properties.
Every SAML edge gains the library relationship context. On SAML_HasAccount, direct_binding_source and external_identity_id become github_direct_binding_source and github_external_identity_id (same values). Empty email_match_values, upn_match_values, external_id_match_values, incomplete_match_value_fields are added. Library edge properties.
An Entra object ID claim that is not a UUID stays in match_values but is not typed as an object ID. The library rejects a non-UUID in the typed list, which would stop the conversion. Not in the fixture; unit test.
direct_binding is true only when scoped exact values exist. An identity with only an Entra object ID gets direct_binding false (was true). The library requires scoped values for a direct binding. Not in the fixture; unit test, and a correlator check (see below).
A blank, whitespace-only, or line-broken issuer gives no issuer node and no SAML_TrustsIssuer edge (a whitespace-only issuer wrote a node before). A whitespace-only issuer or a line break logs a warning. A null or empty issuer logs nothing. The library rejects these entity IDs, and one bad row would stop the whole table. Unit test.
The issuer node holds the issuer without the space characters at its two ends. The old code wrote the issuer as GitHub returned it. The library removes these characters from each entity ID (shared.issuer_node). The collector passes the value as GitHub returned it. SpecterOps/saml-og-research#143 reviews the library rule. Not in the fixture.

No difference changes a sign-in path in the fixture. No finding.

Correlator check for the identity with only an Entra object ID (not in the fixture). Method: the #29 input plus one org identity with a null username and NameID and one object ID attribute, collected at e1121d4 and at 8414e15, then paired with the Entra fixture of SpecterOps/openhound-saml#105 and run through the current correlator. Result: the SAML_CanSignInAs path is present before and after, for the same principal, account, and object ID value. Before, the correlator makes it through its direct-binding mode. After, it makes it through its typed identity mode (match on entra_object_id_match_values). Limit: the typed identity mode runs only when the service provider declares no account-resolution rule. The GitHub service provider declares none (rule_count 0). If it declares rules later, this identity shape must be checked again.

assert_conformant: passes, no failure, no warnings.

Known items not changed

  • uv.lock also has small changes from the local uv version: 5 zensical wheel entries for unsupported platforms are removed, and 2 resolution markers are reordered. uv lock --check passes.
  • edge_defs also registers SAML_HasAccountResolutionRule and SAML_HasAccountResolutionValue, which GitHub never writes, and SAML_HasAccount is registered twice. Registry metadata only.
  • The issuer and ACS input models keep fields that the new code does not read.
  • The library requires Python below 3.15.
  • The identity provider lookup is keyed by organization name only (see BED-9185: add enterprise GitHub runner support #29 pull request). This was already so and is not changed.

GitHub Issue

Refs SpecterOps/saml-og-research#79

Validation

  • Full suite at the top of the stack (44ab331, after the rebase on main): 1488 passed with openhound 0.5.1.
  • ruff check on the changed files: pass (2 F401 errors in resources/__init__.py were already on main).
  • Independent review: no blocking findings; the fixes for its should-fix findings are in this pull request.
  • No range, BloodHound, or live check was done. A range check gives the live proof.
  • CI: the library comes from PyPI, so CI needs no credential.

@JimSycurity
JimSycurity added this pull request to stack #118 November 24, 2026 02:24
@coderabbitai

coderabbitai Bot commented Nov 24, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 25f27e62-f83e-453c-adbd-68a317bfef9e

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@JimSycurity
JimSycurity force-pushed the feature/79-github-saml-producer-port branch from 8414e15 to 4b8298e Compare December 2, 2026 21:15
@JimSycurity JimSycurity self-assigned this Dec 2, 2026
@JimSycurity
JimSycurity merged commit 6476d22 into feature/saml-v0.4 Dec 2, 2026
1 check passed
@JimSycurity
JimSycurity deleted the feature/79-github-saml-producer-port branch December 2, 2026 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant