mirror of
https://github.com/microsoft/regorus.git
synced 2026-08-05 02:16:11 +00:00
d561531613
This commit introduces a complete multi-threaded evaluation benchmark suite for both Rust and C# implementations of Regorus. - Implemented engine evaluation benchmark with input and engine cloning strategies - Implemented compiled policy evaluation benchmark with input cloning and shared compiled policy strategies. - Created EngineEvaluationBenchmark.cs and CompiledPolicyEvaluationBenchmark.cs with time-based execution (3s warmup + 3s evaluation) - Implemented configuration options matching Rust implementation (useClonedEngines, useSharedPolicies parameters) - Created markdown analysis documentation with cross-platform performance analysis - C# seems to achieve 58-89% of Rust performance on test machine. Signed-off-by: Anand Krishnamoorthi <anakrish@microsoft.com>
29 lines
834 B
Rego
29 lines
834 B
Rego
package bench
|
|
|
|
default allow := false
|
|
|
|
# Azure Key Vault access policy
|
|
valid_operations := [
|
|
"Microsoft.KeyVault/vaults/keys/read",
|
|
"Microsoft.KeyVault/vaults/secrets/read",
|
|
"Microsoft.KeyVault/vaults/certificates/read"
|
|
]
|
|
|
|
vault_admins := ["admin@company.com", "security@company.com"]
|
|
|
|
allow if {
|
|
input.operation in valid_operations
|
|
input.principal.type == "ServicePrincipal"
|
|
input.principal.appId != ""
|
|
input.resource.properties.enableSoftDelete == true
|
|
input.resource.properties.enablePurgeProtection == true
|
|
time.now_ns() - input.principal.createdTime < 31536000000000000 # Less than 1 year old
|
|
}
|
|
|
|
allow if {
|
|
input.operation in valid_operations
|
|
input.principal.type == "User"
|
|
input.principal.userPrincipalName in vault_admins
|
|
input.context.conditionalAccess.compliant == true
|
|
}
|