Generic HTTP-primitive policy rules for Gate#455
Merged
Conversation
Replace bespoke per-service operation-name scope checking with a general-purpose HTTP rule matcher. Rules are defined as method+host+path globs, grouped into named rule sets, and referenced by security profiles. - New generic policy engine (internal/gate/policy.go) with path glob matching (* = one segment, ** = zero or more) and host wildcard matching (*.example.com) - Named rule sets synced from .alcove/policy-rules/*.yml to database - Security profiles gain a rules: key alongside existing tools: key - Dispatcher resolves named rule refs to flat PolicyRule list, passes as GATE_POLICY_RULES env var to Gate - Gate MITM handler checks PolicyRules first, falls back to old scope - Ships with named rule sets for GitHub (28), GitLab (19), Jira (20), Splunk (6) covering all operations from scope.go - Full backward compatibility: profiles with only tools: still work Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
.alcove/policy-rules/*.yml, synced to DB, referenced by security profilesrules:key for named rule references and inline HTTP rulestools:profiles still work unchangedArchitecture
Test plan
go build ./...passesgo test ./...— all packages pass (including 60+ new policy tests)🤖 Generated with Claude Code