Skip to content

Permit client CA and infra CA to use UUID serial numbers#287

Draft
jcpunk wants to merge 1 commit into
OpenVoxProject:mainfrom
jcpunk:ca-sign-with-uuid
Draft

Permit client CA and infra CA to use UUID serial numbers#287
jcpunk wants to merge 1 commit into
OpenVoxProject:mainfrom
jcpunk:ca-sign-with-uuid

Conversation

@jcpunk
Copy link
Copy Markdown

@jcpunk jcpunk commented Apr 29, 2026

Pull Request (PR) description

Permit client CA and infra CA to use UUID serial numbers

Assisted-by: Claude noreply@anthropic.com
Assisted-by: Qwen noreply@litellm.ai

While I'm not a clojure programmer, the code looks sane to me.

This Pull Request (PR) fixes the following issues

Fixes #284

@jcpunk jcpunk force-pushed the ca-sign-with-uuid branch 2 times, most recently from 83cc4a8 to 15b0167 Compare April 29, 2026 17:50
@corporate-gadfly
Copy link
Copy Markdown
Contributor

@jcpunk : Could you feed the LLM this error on your feature branch please?

Syntax error compiling at (puppetlabs/services/ca/ca_testutils.clj:121:22).
No such namespace: str

@jcpunk jcpunk force-pushed the ca-sign-with-uuid branch 2 times, most recently from 026bbce to 3cb5abd Compare April 29, 2026 17:58
@jcpunk
Copy link
Copy Markdown
Author

jcpunk commented Apr 29, 2026

I fed the linting and compiler errors into the tooling. Hopefully this looks better.

@corporate-gadfly
Copy link
Copy Markdown
Contributor

corporate-gadfly commented Apr 29, 2026

Also, some linting errors:

test/unit/puppetlabs/puppetserver/certificate_authority_test.clj:2565:7: warning: Redundant let expression. [:redundant-let]
test/unit/puppetlabs/puppetserver/certificate_authority_test.clj:2585:7: warning: Redundant let expression. [:redundant-let]
test/unit/puppetlabs/puppetserver/certificate_authority_test.clj:2601:8: warning: Redundant let expression. [:redundant-let]
test/unit/puppetlabs/puppetserver/certificate_authority_test.clj:2892:7: warning: Redundant let expression. [:redundant-let]

@jcpunk jcpunk force-pushed the ca-sign-with-uuid branch from 3cb5abd to 06adece Compare April 29, 2026 18:00
@nmburgan
Copy link
Copy Markdown
Member

This needs some very careful human inspection. Please don't merge until we can do some due diligence on reviewing and testing, since this is a critical foundational piece of the whole OpenVox infrastructure.

@corporate-gadfly corporate-gadfly marked this pull request as draft April 29, 2026 18:02
@corporate-gadfly
Copy link
Copy Markdown
Contributor

This needs some very careful human inspection. Please don't merge until we can do some due diligence on reviewing and testing, since this is a critical foundational piece of the whole OpenVox infrastructure.

Agreed. Converted to draft.

@nmburgan
Copy link
Copy Markdown
Member

Moving to UUIDs is definitely a good move. But this may be a really tricky change.

  1. Need a Clojure expert to review this (@austb ?)
  2. Need to test upgrades and ensure that existing installs that are using sequential serial numbers combined with new certs that have UUIDs work seamlessly.
  3. Need to audit all OpenVox code (agent, server, db, what else?) to ensure they handle certs with UUIDs correctly.
  4. Not only OpenVox uses the certs. Apps like Foreman also do. So we have to make sure we don't break those critical apps as well.
  5. We've also talked about either ripping out the CA entirely or leaving the current one as legacy and helping people migrate to an off-the-shelf CA. I don't know that we necessarily have to decide that now, but this change has the potential to cause chaos, so if we end up with chaos either way, perhaps moving to a different CA is the useful chaos. Or maybe not.

@jcpunk jcpunk force-pushed the ca-sign-with-uuid branch 2 times, most recently from 2e2b908 to f88256e Compare April 29, 2026 18:35
@corporate-gadfly
Copy link
Copy Markdown
Contributor

With 2 failures, 12 errors., it would have to be a clean run before we can attempt to look at the changes introduced in the src tree.

Personally, I'm inclined to defer, for now.

@jcpunk jcpunk force-pushed the ca-sign-with-uuid branch from f88256e to 5349728 Compare April 29, 2026 19:08
@jcpunk
Copy link
Copy Markdown
Author

jcpunk commented Apr 29, 2026

I wouldn't necessarily mind an external CA only on OpenVox9, but I'm heavily dependent on my custom autosign.rb for getting clients registered.

@jcpunk jcpunk force-pushed the ca-sign-with-uuid branch 6 times, most recently from 3292b2d to 27dc0a1 Compare April 30, 2026 14:21
@jcpunk
Copy link
Copy Markdown
Author

jcpunk commented Apr 30, 2026

Regretfully, this is as far as I can get fixing up the tests. The LLMs seem to get stuck in a loop where they insist the tests are right and my runtime is wrong...

@jcpunk jcpunk force-pushed the ca-sign-with-uuid branch 2 times, most recently from 69881ad to 302bf2f Compare April 30, 2026 15:19
Fixes: OpenVoxProject#284

Signed-off-by: Pat Riehecky <riehecky@fnal.gov>
Assisted-by: Claude <noreply@anthropic.com>
Assisted-by: Qwen <noreply@litellm.ai>
@jcpunk jcpunk force-pushed the ca-sign-with-uuid branch from 302bf2f to 25acbc1 Compare April 30, 2026 15:37
@Sharpie
Copy link
Copy Markdown
Member

Sharpie commented May 5, 2026

I started looking through this and one thing that jumped out immediately is that the first chunk of diff is changing a bunch of type signatures and defaults that seem unrelated to toggling the type of serial number that is used.

These might be good changes, but when mixed into a single commit there just isn't the context to understand why lines are being changed.

At a minimum, this PR needs to be narrowed in focus and broken up into logical commits that provide context as to why changes are being made. The Certificate Authority is the single most critical load-bearing structure in an OpenVox installation, so having well-presented context on what is changing and why is a hard requirement for me to 👍 any changes here.

(ks-file/atomic-write-string serial initial-serial serial-file-permissions)
(when (and infra-serial (not= serial-type infra-serial-type))
(let [initial-infra-serial (if (= :uuid infra-serial-type)
(uuid->serial-hex (UUID/randomUUID))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I don't think we want to use v4 "random" UUIDs. For example, something that has namespaces, like UUID v5, allows us to definitively run separate issuing CA instances guaranteed to produce separate identifiers rather than just relying on a collision in v4 being "statistically improbable".

I took a look at the Boulder CA used by Let's Encrypt and they are using a namespaced identifier, but also not a UUID variant.

Moving away from a sequential integer is very likely a choice we will only be able to easily make once. So, the choice of algorithm should start off with a survey of what existing CA implementations use, recommendations from RFCs and CA/B standards, and then an algorithm chosen from a group of identified alternatives based on weighing the pros and cons.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also, we should carefully consider if there are any alternatives that fit into the 64-bit size provided by the existing Int. I suspect a change that preserved compatibility with Int would dramatically reduce the amount of churn in test cases and code paths outside of serial number generation, which would be a very weighty "pro" when compared to other alternatives.

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.

[Feature request]: CA use UUID rather than incrementing serial

4 participants