Datasets:
Clarification on Policy Exemptions in ITBench-Lite CISO Scenarios 5.1.1 and 5.1.3
Clarify exemption rules in ITBench-Lite CISO 5.1.1 and 5.1.3
Hello ITBench-Lite maintainers,
I'm a researcher at PatchONE. While reviewing the ITBench-Lite CISO scenarios, I noticed two cases where clarifying the intended policy exemptions would be helpful.
I reproduced the snapshot evaluation at dataset revision e6927683b14c77c3bbf540ced914eb0ed5d37cb4 using OPA 1.23.0. CISO dataset contribution
5.1.1 ServiceAccount exemption scope
The task names benchmark-admin-sa as the exempt ServiceAccount. The published reference exempts any name beginning with benchmark-. The compliant snapshot contains a binding for benchmark-sa to a Role with wildcards in apiGroups, resources, and verbs in the same rule. The reproduction below shows how the two exemption rules change the verdict on the same input. Task instructions · Reference policy · RoleBinding · Role
Question. Should the exemption cover the exact account benchmark-admin-sa or the whole benchmark- prefix? Which behavior should submissions follow for benchmark-sa?
5.1.3 Conditions for exempting a benchmark Role
The task gives app: benchmark as an example. The published reference accepts that app label, a component: benchmark-service label, or a name containing benchmark. The exempt Role in each supplied snapshot has all three markers. In OPA, the published reference and a version using only the app-label condition returned the same Boolean on both supplied snapshots. The component-only input below isolates one difference between those implementations. Task instructions · Reference policy · Compliant snapshot Role · Violation snapshot Role
Question. Is each of the three markers intended to establish the exemption independently? If so, could the task state those conditions and include fixtures that exercise them individually?
Minimal reproduction
Save the 5.1.1 input as input-511.json.
{
"rolebindings": [
{
"roleRef": {"kind": "Role", "name": "wildcard-role"},
"subjects": [{"kind": "ServiceAccount", "name": "benchmark-sa"}]
}
],
"roles": [
{
"metadata": {"name": "wildcard-role"},
"rules": [{"apiGroups": ["*"], "resources": ["*"], "verbs": ["*"]}]
}
]
}
Save the 5.1.3 component-only input as input-513.json.
{
"roles": [
{
"metadata": {"name": "application-role", "labels": {"component": "benchmark-service"}},
"rules": [{"apiGroups": ["*"], "resources": ["*"], "verbs": ["*"]}]
}
]
}
base='https://huggingface.co/datasets/ibm-research/ITBench-Lite/resolve/e6927683b14c77c3bbf540ced914eb0ed5d37cb4/snapshots/ciso/v0.1'
curl -fsSL "$base/k8s-opa-static-cis-5.1.1/ground-truth/policy.rego" -o policy-511.rego
curl -fsSL "$base/k8s-opa-static-cis-5.1.3/ground-truth/policy.rego" -o policy-513.rego
opa eval --format raw --data policy-511.rego --input input-511.json 'data.check.result'
sed 's/not startswith(subject.name, "benchmark-")/subject.name != "benchmark-admin-sa"/g' policy-511.rego > policy-511-single-name.rego
opa eval --format raw --data policy-511-single-name.rego --input input-511.json 'data.check.result'
opa eval --format raw --data policy-513.rego --input input-513.json 'data.check.result'
For the app-label-only comparison, copy policy-513.rego to policy-513-app-only.rego and remove the two is_benchmark_role rules for the component label and Role name. Keep the app-label rule and evaluate the same input.
opa eval --format raw --data policy-513-app-only.rego --input input-513.json 'data.check.result'
| Input and policy | data.check.result |
|---|---|
5.1.1 benchmark-sa with the published prefix rule |
true |
5.1.1 benchmark-sa with the exact-name comparison |
false |
| 5.1.3 component-only Role with the published policy | true |
| 5.1.3 component-only Role with the app-label-only comparison | false |
Best regards,
Jimin Yang
Researcher, PatchONE
Hi @yjm080821
Thanks for the detailed report and the reproduction steps.
5.1.1
You're right. problem.md exempts only benchmark-admin-sa, but the ground-truth policy and the compliant data also allowed benchmark-sa. The problem.md is intended the behavior, so the policy should exempt only benchmark-admin-sa. I fixed it in the PR #6.
5.1.3
Yes, each of the three conditions exempts a Role on its own. The PR #6 adds them to problem.md.
If so, could the task state those conditions and include fixtures that exercise them individually?
Thanks for suggesting fixtures for each condition. To test the exemption rules properly, we need to change eval.py and the test framework, and that affects all scenarios, so we'll handle it separately.