-
Notifications
You must be signed in to change notification settings - Fork 852
hrw4u: Adds sandbox protection feature for the compiler #12950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
zwoop
wants to merge
3
commits into
apache:master
Choose a base branch
from
zwoop:Hrw4uSandbox
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,177
−58
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| build/ | ||
| dist/ | ||
| uv.lock | ||
| *.spec |
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,136 @@ | ||
| { | ||
| "$schema": "http://json-schema.org/draft-07/schema#", | ||
| "$id": "https://trafficserver.apache.org/schemas/hrw4u-sandbox.schema.json", | ||
| "title": "HRW4U Sandbox Configuration", | ||
| "description": "Policy deny-list and warn-list for the hrw4u compiler (--sandbox FILE).", | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "required": ["sandbox"], | ||
| "properties": { | ||
| "sandbox": { | ||
| "type": "object", | ||
zwoop marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| "additionalProperties": false, | ||
| "properties": { | ||
| "message": { | ||
| "type": "string", | ||
| "description": "Free-form text appended once after all denial errors and warnings. Use this to explain the policy and provide a contact or ticket link." | ||
| }, | ||
| "deny": { | ||
| "$ref": "#/$defs/categoryBlock", | ||
| "description": "Features listed here are denied: compilation fails with an error." | ||
| }, | ||
| "warn": { | ||
| "$ref": "#/$defs/categoryBlock", | ||
| "description": "Features listed here produce warnings but compilation succeeds." | ||
| } | ||
| } | ||
| } | ||
| }, | ||
| "$defs": { | ||
| "categoryBlock": { | ||
| "type": "object", | ||
| "additionalProperties": false, | ||
| "properties": { | ||
| "sections": { | ||
| "type": "array", | ||
| "description": "HRW4U section names. A denied section rejects the entire block; a warned section emits a warning.", | ||
| "items": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "TXN_START", | ||
| "PRE_REMAP", | ||
| "REMAP", | ||
| "READ_REQUEST", | ||
| "SEND_REQUEST", | ||
| "READ_RESPONSE", | ||
| "SEND_RESPONSE", | ||
| "TXN_CLOSE", | ||
| "VARS" | ||
| ] | ||
| }, | ||
| "uniqueItems": true | ||
| }, | ||
| "functions": { | ||
| "type": "array", | ||
| "description": "Statement function names.", | ||
| "items": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "add-header", | ||
| "counter", | ||
| "keep_query", | ||
| "no-op", | ||
| "remove_query", | ||
| "run-plugin", | ||
| "set-body-from", | ||
| "set-config", | ||
| "set-debug", | ||
| "set-plugin-cntl", | ||
| "set-redirect", | ||
| "skip-remap" | ||
| ] | ||
| }, | ||
| "uniqueItems": true | ||
| }, | ||
| "conditions": { | ||
| "type": "array", | ||
| "description": "Condition keys. Entries ending with '.' use prefix matching (e.g. 'geo.' matches all geo.* lookups).", | ||
| "items": { | ||
| "type": "string" | ||
| }, | ||
| "uniqueItems": true, | ||
| "examples": [ | ||
| ["geo.", "tcp.info", "inbound.conn.", "outbound.conn."] | ||
| ] | ||
| }, | ||
| "operators": { | ||
| "type": "array", | ||
| "description": "Operator (assignment target) keys. Entries ending with '.' use prefix matching.", | ||
| "items": { | ||
| "type": "string" | ||
| }, | ||
| "uniqueItems": true, | ||
| "examples": [ | ||
| ["inbound.conn.dscp", "inbound.conn.mark", "outbound.conn.dscp", "outbound.conn.mark"] | ||
| ] | ||
| }, | ||
| "language": { | ||
| "type": "array", | ||
| "description": "Language constructs.", | ||
| "items": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "break", | ||
| "variables", | ||
| "in", | ||
| "else", | ||
| "elif" | ||
| ] | ||
| }, | ||
| "uniqueItems": true | ||
| }, | ||
| "modifiers": { | ||
| "type": "array", | ||
| "description": "Condition and operator modifiers.", | ||
| "items": { | ||
| "type": "string", | ||
| "enum": [ | ||
| "AND", | ||
| "OR", | ||
| "NOT", | ||
| "NOCASE", | ||
| "PRE", | ||
| "SUF", | ||
| "EXT", | ||
| "MID", | ||
| "I", | ||
| "L", | ||
| "QSA" | ||
| ] | ||
| }, | ||
| "uniqueItems": true | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs say “An empty or missing sandbox file permits everything,” but
SandboxConfig.load()requires the YAML to contain a top-levelsandboxmapping and will raise if the file is empty or lacks that key. Consider rewording to clarify that omitting--sandboxpermits everything, and that an empty policy still must be expressed assandbox: {}(or equivalent) when a file is provided.