Skip to content

Enable RHSM certguard tests under domains - #7964

Open
dralley wants to merge 2 commits into
pulp:mainfrom
dralley:certguard-domains
Open

Enable RHSM certguard tests under domains#7964
dralley wants to merge 2 commits into
pulp:mainfrom
dralley:certguard-domains

Conversation

@dralley

@dralley dralley commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

📜 Checklist

  • Commits are cleanly separated with meaningful messages (simple features and bug fixes should be squashed to one commit)
  • A changelog entry or entries has been added for any significant changes
  • Follows the Pulp policy on AI Usage
  • (For new features) - User documentation and test coverage has been added

See: Pull Request Walkthrough

Comment thread pulp_certguard/tests/functional/api/test_rhsm_certguard.py
Comment thread pulp_certguard/app/models.py Outdated
# Strip the /{domain} segment: /domain/rest... -> /rest...
path_without_content_path_prefix = (
"/" + path_without_content_path_prefix.lstrip("/").split("/", 1)[1]
)

@dralley dralley Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'm not 100% sure this is correct? In theory this would match paths across different domains - which seems like it would be wrong - but then perhaps there are other guards preventing users from accessing those other domains?

The entitlements are created externally though so changing the entitlements to include a domain is not something we can decide ourselves. And it seems like at the moment certguards and domains are incompatible.

@dralley dralley Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Claude says

RHSM entitlement certificates are issued by Candlepin/Katello, which is external to Pulp and has no concept of Pulp domains. The paths embedded in the cert look like /Default_Organization/Library/content/dist/rhel/... — they describe the subscription content hierarchy, not Pulp's URL routing structure.

edit: per project discussion, we think this might be OK, because the certguard itself exists only within a given domain, so you cannot really have a situation where a user can re-use an entitlement certificate across domains unless the certguard on both domains was explicitly configured to trust the same issuer.

We already strip off the content path prefix here, and anything before it e.g. fqdn is ignored.

With that said I guess you could say that inability to issue domain-specific entitlements could be an issue, but maybe not a common one? Would it even be a good idea to share the same issuing CA for certguards across domains? Certainly not with this limitation, but in general too, perhaps?

@dralley
dralley requested a review from mdellweg August 20, 2026 15:18
@dralley
dralley marked this pull request as ready for review August 20, 2026 15:18
The RHSM certguard strips CONTENT_PATH_PREFIX from request.path to
match against entitlement paths in the certificate. With domains, the
path includes a /{domain}/ segment after the prefix that was not being
stripped, causing all RHSM path checks to fail.

Limitation: the domain cannot be used to scope an entitlement to a
specific domain via the path. If the same issuer CA is trusted by content
guards in two domains, an entitlement certificate is honored in both. For
per-domain isolation, trust a distinct issuer (CA) per domain rather than
relying on domain-specific entitlement certificates.

Assisted-By: Claude Opus 4.6
@dralley
dralley force-pushed the certguard-domains branch from d198d64 to a957d78 Compare August 20, 2026 16:02
@dralley
dralley requested a review from ggainey August 20, 2026 16:02

@ggainey ggainey 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.

Looks good, based on our current understanding and discussions.

@dralley

dralley commented Aug 20, 2026

Copy link
Copy Markdown
Contributor Author

Awaiting a 2nd review from Matthias, don't merge plz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants