Implement constrained extensions in RCv2#74
Merged
Conversation
…ommandIds, script types, and runasuser
D1v38om83r
reviewed
May 5, 2026
D1v38om83r
approved these changes
May 5, 2026
D1v38om83r
left a comment
Collaborator
There was a problem hiding this comment.
Approved with suggestions.
D1v38om83r
reviewed
Jun 2, 2026
D1v38om83r
approved these changes
Jun 2, 2026
D1v38om83r
left a comment
Collaborator
There was a problem hiding this comment.
Approved with comment.
jscalev
reviewed
Jun 5, 2026
D1v38om83r
reviewed
Jun 22, 2026
jscalev
reviewed
Jun 26, 2026
jscalev
reviewed
Jun 26, 2026
jscalev
reviewed
Jun 26, 2026
jscalev
approved these changes
Jun 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As per this spec , for Constrained extensions, customers can specify what kinds of script are and are not allowed to run. Customers may want to limit their run command to only run gallery scripts, only inline scripts or only run certain allow listed scripts.
This PR implements that logic using allowlists of hashes. The RCv2 behavior changes are as follows:
When there's a policy present, RCv2 can
Limit scripts it runs based on script type
Limit command IDs it runs based on an allowlist
Limit downloaded scripts it runs based on a hash allowlist (RCv2 validates the scripts after downloading it)
Validate that the user in the RunAsUser settings property is permitted by policy.
The code changes required to support this behavior are:
The changes in this PR do not affect RC's existing behavior from a customer perspective, but accurately fetch information from CRP and initialize extension policy as desired. The behavior change that depends on different policy configurations is covered in UTs.