Repository navigation
feat(dir): add OPA validators - #2204
Conversation
75bdf9b to
ab5ffd5
Compare
|
The latest Buf updates on your PR. Results from workflow Buf CI / verify-proto (pull_request).
|
40aadb4 to
2fc3acc
Compare
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
2fc3acc to
6a9752f
Compare
6a9752f to
b68a68c
Compare
|
@csirmazbendeguz Please check this. The reconciler will crash-loop whenever an opa validator is configured. The chart now injects |
|
And this one also. A policy without an allow rule silently denies everything. A module containing only |
|
|
tkircsi
left a comment
There was a problem hiding this comment.
Please check the issues mentioned in the PR comments.
f7fd244 to
c2fe799
Compare
|
Thanks @tkircsi ! Very helpful.
I think this is expected - users should always include an |
c2fe799 to
430fa95
Compare
ramizpolic
left a comment
There was a problem hiding this comment.
an extra provider alongside CEL is good, users can opt-in to decide which to use. LGTM
|
Thanks @ramizpolic. Ok, we can merge it then 👍 By the way, we can also do inline OPA policies if you think that's better. We just discussed these file-based ones earlier, that's why this PR adds those only... but if you find this too complex, then we can discard this and do it inline instead. I think if we're not going to re-use the OPA policies, then no need to store them in files @tkircsi I wanted to answer this:
Yes, my idea here was that it's better to fail early. If config depends on a file that doesn't exist it should crash on startup |
a495900
a495900 to
50060a4
Compare
Signed-off-by: Bendegúz Csirmaz <[email protected]>
50060a4 to
7f08cb2
Compare
#2204 gave the reconciler a policy section for the directory OPA policy files are loaded from, the same one the server has, and the chart fills it from config.policy. Rebased onto it, this branch declared a second Policy field and policy import for the evaluation task's settings, and the reconciler stopped compiling. The task's settings move to policy_evaluation: RECONCILER_POLICY_EVALUATION_* in the environment, reconciler.config.policy_evaluation in Helm, and reconciler.policy_evaluation in the daemon configuration. Refs #2207 Signed-off-by: Luca Muscariello <[email protected]>
Brings in the fix that moves the reconciler's policy evaluation settings to policy_evaluation (#2229), which the rebase onto main had left clashing with #2204's policy section. Signed-off-by: Luca Muscariello <[email protected]>
Brings in the fix that moves the reconciler's policy evaluation settings to policy_evaluation (#2229), which the rebase onto main had left clashing with #2204's policy section. Signed-off-by: Luca Muscariello <[email protected]>
Brings in the fix that moves the reconciler's policy evaluation settings to policy_evaluation (#2229), which the rebase onto main had left clashing with #2204's policy section. Signed-off-by: Luca Muscariello <[email protected]>
Brings in the fix that moves the reconciler's policy evaluation settings to policy_evaluation (#2229), which the rebase onto main had left clashing with #2204's policy section. Signed-off-by: Luca Muscariello <[email protected]>
…eers Brings in the fix that moves the reconciler's policy evaluation settings to policy_evaluation (#2229), which the rebase onto main had left clashing with #2204's policy section. Signed-off-by: Luca Muscariello <[email protected]>
…cement-modes Brings in main's #2204, which rewrote the policy config this branch extends and moved its OPA directory into the reconciler's policy section, and the policy_evaluation rename from #2229. The policy config keeps main's struct, without enabled or Validate, plus this branch's enforcement settings; its test file, which main deleted, keeps only the enforcement tests. # Conflicts: # cli/cmd/daemon/daemon.config.yaml # install/charts/dir/apiserver/values.yaml # install/docker/reconciler.env # reconciler/config/config.go # reconciler/config/config_test.go # reconciler/service/service.go # server/config/config_test.go # server/database/gorm/gorm.go # server/database/gorm/policy_gate.go # server/database/gorm/policy_gate_test.go # server/policy/config/config.go # server/policy/config/config_test.go # server/server.go # server/types/database.go
…ment-backfill Brings in main's #2204, the policy_evaluation rename from #2229, and #2248's merge of both. The policy config keeps main's struct plus this branch's refresh interval and previous_version. Signed-off-by: Luca Muscariello <[email protected]>
…t-bypass Brings in main's #2204, the policy_evaluation rename from #2229, and the merges below. The runbook now names the evaluation task's Helm key, reconciler.config.policy_evaluation. Signed-off-by: Luca Muscariello <[email protected]>
#2204 gave the reconciler a policy section for the directory OPA policy files are loaded from, the same one the server has, and the chart fills it from config.policy. Rebased onto it, this branch declared a second Policy field and policy import for the evaluation task's settings, and the reconciler stopped compiling. The task's settings move to policy_evaluation: RECONCILER_POLICY_EVALUATION_* in the environment, reconciler.config.policy_evaluation in Helm, and reconciler.policy_evaluation in the daemon configuration. Refs #2207 Signed-off-by: Luca Muscariello <[email protected]>
#2204 gave the reconciler a policy section for the directory OPA policy files are loaded from, the same one the server has, and the chart fills it from config.policy. Rebased onto it, this branch declared a second Policy field and policy import for the evaluation task's settings, and the reconciler stopped compiling. The task's settings move to policy_evaluation: RECONCILER_POLICY_EVALUATION_* in the environment, reconciler.config.policy_evaluation in Helm, and reconciler.policy_evaluation in the daemon configuration. Refs #2207 Signed-off-by: Luca Muscariello <[email protected]>
#2204 gave the reconciler a policy section for the directory OPA policy files are loaded from, the same one the server has, and the chart fills it from config.policy. Rebased onto it, this branch declared a second Policy field and policy import for the evaluation task's settings, and the reconciler stopped compiling. The task's settings move to policy_evaluation: RECONCILER_POLICY_EVALUATION_* in the environment, reconciler.config.policy_evaluation in Helm, and reconciler.policy_evaluation in the daemon configuration. Refs #2207 Signed-off-by: Luca Muscariello <[email protected]>
#2157
This PR adds the ability to configure validators like this:
Where
filerefers to a file uploaded to the policies directory