Skip to content

scanner/plugins/opensslconf: record Groups (TLS 1.3 key-exchange groups) - #237

Open
SemyonAndreyev wants to merge 1 commit into
cbomkit:mainfrom
q2quantum:openssl-conf-groups-212
Open

SemyonAndreyev wants to merge 1 commit into
cbomkit:mainfrom
q2quantum:openssl-conf-groups-212

Conversation

@SemyonAndreyev

@SemyonAndreyev SemyonAndreyev commented Oct 29, 2026 •

Copy link
Copy Markdown

Part of #212.

Problem

extractRelevantProperties() already extracts MinProtocol, MaxProtocol,
CipherString, Options, CAfile, CApath, default_md from an OpenSSL
config file (openssl.cnf) into CBOM component properties -- but not
Groups.

Groups is the directive that carries the negotiated key-exchange groups for
TLS 1.3, including post-quantum and hybrid groups (e.g. X25519MLKEM768,
X25519Kyber768Draft00). A config that pins PQC/hybrid key exchange via this
directive currently produces a CBOM with no trace of that choice -- exactly
the kind of crypto-asset visibility this scanner exists to provide.

Fix

  • Added getFirstKeyCI()/lookupKeyCI() helpers for case-insensitive
    directive lookup (OpenSSL itself matches config directive names
    case-insensitively).
  • Groups is extracted the same way the existing directives are, from the
    "Groups" directive or its legacy alias "Curves", both matched
    case-insensitively, with "Groups" preferred when a config sets both in the
    same section.
  • Section priority still takes precedence over name priority: the new
    Test_parseOpenSSLConf_SectionPriorityOverNamePriority verifies that
    Curves in the earlier preferred system_default_sect wins over Groups
    in the later preferred req section.
  • Groups/Curves are recorded as a plain string property; not yet modelled as
    cryptographic-asset components or linked to the TLS protocol component --
    left as a follow-up, same as the other directives this plugin already
    extracts.

Scope: Groups/Curves are recorded as a plain string property (theia:openssl:Groups). They are not yet modelled as cryptographic-asset components or linked to the TLS protocol component, and case-insensitive matching covers these two names only. Both are left for follow-ups. Part of #212.

Testing

go build ./..., go vet ./..., go test ./... -- all clean, 0 regressions,
including the new section-priority test.

Note on this PR

This replaces PR #236, which was accidentally closed by GitHub's
force-push/branch-takeover protection during a local rebase incident (an
amend on a shallow clone silently dropped the real parent commit). The
branch content here is unchanged in substance from #236's last reviewed
state, plus the requested review fixes from that thread (case-insensitive
"legacy alias" wording, the added section-priority test, and a tightened
commit message/scope note). #236 itself could not be reopened through the
GitHub API once closed this way.


Signed-off-by: Semyon Andreev q2quantum.app@gmail.com

@SemyonAndreyev
SemyonAndreyev requested a review from a team as a code owner October 29, 2026 13:43
@SemyonAndreyev

Copy link
Copy Markdown
Author

Hi @san-zrl, GitHub closed #236 automatically after a branch rewrite on our side, so this PR replaces it. Thanks for the careful review — here is what changed:

  1. Kept case-insensitive matching to Groups/Curves so this PR stays focused, and noted the other directives as a follow-up in the description. Happy to send that as a separate PR.
  2. The code comment now describes what the code does.
  3. "pre-3.0 alias" → "legacy alias" in the comment and the commit message.
  4. Added a test where Curves in system_default_sect wins over Groups in a non-preferred section, plus a line on this in the plugin explanation.
  5. Agreed — the description now says this only partly addresses OpenSSL config plugin records MinProtocol and CipherString but not Groups (post-quantum key exchange not inventoried) #212.
  6. Rewrote the commit without the co-author trailer and the session link; kept a single Assisted-by line for disclosure.

@san-zrl san-zrl left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @SemyonAndreyev - Thanks a lot for the renewed PR. This is better than #236 but still has two small issues. Please correct problems 1 and 2. Tx.

PR #237 evaluation

Verdict: request changes. The code and tests are correct. Two items remain: the stacked branch history, and one inaccurate sentence in the description.

What the description gets right

  • go build, go vet and go test oss. pass on pr-237.
  • The "legacy alias" wording is in the code comment, the test doc, and the commit message.
  • The plugin explanation mentions the section-priority rule.
  • Only one Assisted-by trailer remains, plus Signed-off-by. The co-author trailer and session link are gone.
  • The Groups/Curves limitations and the follow-ups are stated clearly.

Problems

  1. Inaccurate test description (must fix). Point 4 says the test has Curves in system_default_sect winning over Groups in a "non-preferred section". In the test, Groups is in [req], and req is in the preferred list (opensslconf.go line 340: system_default_sect, default, openssl_init, req, ca_default). The test still checks section priority between two preferred sections, so it is valid, but the description and the test comment at line 107 should say "later preferred section" instead.

  2. Stacked commits are not mentioned (blocker). The description says the content is "unchanged in substance" from #236, but main..pr-237 still has 6 commits. The diff against main touches 13 files (+225/−282), including go.mod/go.sum bumps, Go 1.26.8, removal of .idea/ and .junie/, and a new AGENTS.md. None of these are related to Groups. Rebase onto main or cherry-pick 8364561 onto a fresh branch, so the PR diff contains only the opensslconf change and openssl.cnf.

  3. Non-blocking: case-insensitive scope. This is handled as a follow-up, as the description says. The other directives (MinProtocol, CipherString, Options, …) remain case-sensitive. That is acceptable for this PR.

Status of the earlier pr-236 findings

  • Addressed: comment describes current behavior, "legacy alias" wording, section-priority test, plugin explanation, AI trailers removed.
  • Not addressed in code, by design: other directives' case sensitivity, and Groups not modelled as crypto-asset components (both explicitly deferred).
  • Not addressed: the stacked branch (point 2 above).

Next steps

Once the branch is rebased to a single commit and the test wording in the description is corrected, approve. Mapping Groups to algorithm components can be tracked as a follow-up for #212.

MinProtocol/MaxProtocol/CipherString/Options/CAfile/CApath/default_md
were already extracted from openssl.cnf into CBOM properties, but
Groups was not -- so a post-quantum or hybrid key exchange configured
via this directive (e.g. X25519MLKEM768) never reached the CBOM.

"Curves" is the legacy alias for the same directive, and OpenSSL
matches directive names case-insensitively, so both spellings are
matched case-insensitively here (Groups preferred when a config sets
both in the same section). Section priority still takes precedence
over name priority: a match in an earlier preferred section wins even
when a later section has the otherwise-preferred name.

Groups/Curves are recorded as a plain string property; they are not
yet modelled as cryptographic-asset components or linked to the TLS
protocol component, and case-insensitive matching covers only these
two names. Both are left as follow-ups. Part of cbomkit-theia#212.

Signed-off-by: Semyon Andreev <q2quantum.app@gmail.com>

Assisted-by: Claude Sonnet 5 <noreply@anthropic.com>
@SemyonAndreyev
SemyonAndreyev force-pushed the openssl-conf-groups-212 branch from 8364561 to dd9a525 Compare November 6, 2026 11:19
@SemyonAndreyev

Copy link
Copy Markdown
Author

Hi @san-zrl — sorry for the four-working-day delay. Both requested blockers are now addressed.

  1. The PR description now says exactly what the test covers: Curves in the earlier preferred system_default_sect wins over Groups in the later preferred req section. The test comment uses the same “later preferred section” wording.
  2. I rebuilt openssl-conf-groups-212 from the current upstream main and force-pushed it with a lease. main..HEAD is now one commit (dd9a525) touching only:
    • scanner/plugins/opensslconf/opensslconf.go
    • scanner/plugins/opensslconf/opensslconf_test.go
    • testdata/openssl/dir/openssl.cnf

The clean commit has the same stable patch-id as the previously tested commit 8364561; no code/test content changed during the history cleanup. DCO passes. The new upstream Build run is currently action_required and has no jobs yet, so it appears to be waiting for maintainer approval: https://github.com/cbomkit/cbomkit-theia/actions/runs/42209429925

Could you please approve that run and re-review when convenient? Thank you.

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.

2 participants