Skip to content

Conversation

@hardbyte
Copy link
Contributor

Summary

  • add a SecurityRuleMetadata helper and expose it from the Policy trait so policies can describe their semantic attributes
  • emit tracing events that populate the OpenTelemetry security rule fields when policies are evaluated
  • cover the metadata helper with a unit test to ensure all semantic fields are preserved

Testing

  • cargo test

https://chatgpt.com/codex/tasks/task_b_68f196a675448329a69008f3a079048c

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds OpenTelemetry security rule instrumentation to the permission checking framework. It introduces a metadata system for policies to describe their semantic attributes and emits structured tracing events during policy evaluation.

  • Adds SecurityRuleMetadata helper to expose OpenTelemetry semantic fields
  • Integrates tracing events into the policy evaluation process with security rule attributes
  • Includes unit test coverage for the metadata builder functionality

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@hardbyte
Copy link
Contributor Author

     Running benches/permission_checker.rs (target/release/deps/permission_checker-0c945ef4500025a5)
Gnuplot not found, using plotters backend
permission_checker_evaluate_access/trailing_allow/1
                        time:   [374.21 ns 394.24 ns 413.61 ns]
permission_checker_evaluate_access/all_deny/1
                        time:   [426.20 ns 465.38 ns 524.00 ns]
Found 5 outliers among 100 measurements (5.00%)
  4 (4.00%) high mild
  1 (1.00%) high severe
permission_checker_evaluate_access/trailing_allow/4
                        time:   [1.1045 µs 1.1531 µs 1.2027 µs]
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) high mild
  1 (1.00%) high severe
permission_checker_evaluate_access/all_deny/4
                        time:   [989.76 ns 1.0377 µs 1.0904 µs]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild
permission_checker_evaluate_access/trailing_allow/16
                        time:   [3.4887 µs 3.7212 µs 3.9558 µs]
Found 1 outliers among 100 measurements (1.00%)
  1 (1.00%) high mild
permission_checker_evaluate_access/all_deny/16
                        time:   [3.5392 µs 3.6936 µs 3.8537 µs]
Found 2 outliers among 100 measurements (2.00%)
  2 (2.00%) high mild
permission_checker_evaluate_access/trailing_allow/64
                        time:   [14.755 µs 15.321 µs 15.859 µs]
Found 4 outliers among 100 measurements (4.00%)
  4 (4.00%) low mild
permission_checker_evaluate_access/all_deny/64
                        time:   [15.003 µs 15.799 µs 16.594 µs]
Found 12 outliers among 100 measurements (12.00%)
  3 (3.00%) low mild
  9 (9.00%) high mild

@hardbyte hardbyte merged commit 9462cb7 into main Oct 20, 2025
2 checks passed
@hardbyte hardbyte deleted the update-gatehouse-for-semantic-security-rules branch October 20, 2025 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants