-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updates to Lean validator spec #210
Conversation
Before I review in detail, one comment about the description: You say that we're weakening the strict-validation-drt property from
to
Why not a middle ground,
|
In particular, the middle property would be satisfied by a spec validator that always passes |
Two quick clarifications:
The code is not adding the Unspecified entity type to the spec but rather to the diff testing harness ( The code is preventing actions from having attributes. They can still have ancestors. I'm guessing this is a typo in the description.
I think this is quite reasonable. It gives us the freedom to eventually make the Rust validator as precise as the Lean validator, which seems more desirable than making Lean less precise to match Rust. If we instead make the Lean validator less precise to force equivalence with Rust today, then we'd have to change both Rust and Lean to recover that precision in the future. |
Unfortunately precision differences affect more than just So in general, the additional precision in Lean will result in fewer non- |
Yes, I should have been more clear. This PR adds a special unspecified entity when parsing in the schema to match how the parser currently handles an unspecified principal/resource in requests. It does not add unspecified entities to the core formalization. |
Last comment for now: the |
I don't understand why it should not be part of the formalization. Rust Cedar's semantics includes the notion of an "unspecified" entity. I don't think it's going anywhere. Not having it in the Lean spec implies it's not part of the "essence" of Cedar, e.g., a different implementation would not have to support it. Maybe that's fine, but then we miss an opportunity to vet the design of the Rust code via proof in Lean, to make sure that it's sensible, e.g., that validation is still sound in the presence of Unspecified entities in requests. |
Issue #, if available:
Description of changes:
The Lean formalization of strict validation has been out of sync with the Rust definition since release. This PR aims to resolve this by
ancestorsattributes.strict-validation-drt-*
targets. Now instead of testing whether the spec returns a validation error iff the Rust does, it will check that if the Rust validates, then the spec also validates (ignoringimpossiblePolicy
errors). This allows the Lean spec to be more precise than the Rust, which means that it may return the errorimpossiblePolicy
where the Rust successfully validates, or may successfully validate when the Rust returns an error (e.g., because short-circuiting determined that some invalid code is unreachable).The second change is the controversial one: we're weakening the property tested. See my comments in the code for why I think this is reasonable.
It may be possible to further edit the Lean to make it match the Rust, though some work is required. I've found at lease two other issues (listed below) through DRT. There are likely others.
==
is more precise than Rust (fixed in this branch).HierarchyNotRespected
for somein
expressions that the Lean successfully validates. Appears to be related to unspecified entities.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.