Skip to content

test: deny Cedar eval errors even when a permit fired - #39

Merged
araujof merged 3 commits into
praxis-proxy:mainfrom
mkoushni:test/cedar-fail-closed-override
Aug 26, 2026
Merged

test: deny Cedar eval errors even when a permit fired#39
araujof merged 3 commits into
praxis-proxy:mainfrom
mkoushni:test/cedar-fail-closed-override

Conversation

@mkoushni

Copy link
Copy Markdown
Contributor

Summary

Cedar can still Allow when a policy in the set errored, as long as another permit fired. We override that to Deny. This pins it.

One test through evaluate(): an unconditional permit next to a when on principal.department. Cedar errors, still Allows on the permit, and we have to Deny with a reason that says fail-closed and names the error.

Closes #2

Test plan

  • cargo test -p praxis-policy-pdp-cedar-direct --test basic_allow_deny evaluation_error_denies_even_when_a_permit_fired

Cedar still Allows if a sibling permit matched. The override must
Deny with a fail-closed reason, or the gate is untrusted.

Signed-off-by: mkoushni <mkoushni@redhat.com>

@praxis-bot praxis-bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review of test for fail-closed Cedar evaluation error override.

Two findings -- both about missing assertions that the rest of this file consistently applies to every deny path.

Comment thread builtins/pdps/cedar-direct/tests/basic_allow_deny.rs Outdated
Comment thread builtins/pdps/cedar-direct/tests/basic_allow_deny.rs
The other deny tests in this file pin rule_source and diagnostics.
Without those checks, an error-path attribution regression would pass.

Signed-off-by: mkoushni <mkoushni@redhat.com>
Signed-off-by: mkoushni <mkoushni@redhat.com>

@araujof araujof left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

The new test reproduces the exact failure case in #2 and fails with Allow when the fail-closed override is disabled. It also checks the denial reason, attribution, and diagnostics.

@araujof
araujof merged commit e74f76e into praxis-proxy:main Aug 26, 2026
7 checks passed
@araujof araujof self-assigned this Aug 26, 2026
@araujof araujof added the tests label Aug 26, 2026
@araujof araujof added this to the 0.1.1 milestone Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Development

Successfully merging this pull request may close these issues.

test(Cedar PDP): fail-closed-on-error override has zero test coverage

3 participants