Skip to content
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

Policy JSON format does not error for spaces in annotations #994

Closed
3 tasks done
john-h-kastner-aws opened this issue Jun 17, 2024 · 0 comments · Fixed by #1004
Closed
3 tasks done

Policy JSON format does not error for spaces in annotations #994

john-h-kastner-aws opened this issue Jun 17, 2024 · 0 comments · Fixed by #1004
Labels
bug Something isn't working. This is as high priority issue.

Comments

@john-h-kastner-aws
Copy link
Contributor

john-h-kastner-aws commented Jun 17, 2024

Before opening, please confirm:

Bug Category

Cedar Parser

Describe the bug

The following policy is accepted by the JSON policy parse, but it defines an annotation containing a space, which is not possible in the Cedar policy syntax. The JSON policy parser should instead return an error.

{
    "annotations": {
      " ": ""
    },
    "effect": "permit",
    "principal": { "op": "All" },
    "action": { "op": "All" },
    "resource": { "op": "All" },
    "conditions": [ ]
}

The most straightforward fix is to check for spaces in annotations in try_into_ast_template.

@john-h-kastner-aws john-h-kastner-aws added bug Something isn't working. This is as high priority issue. backlog labels Jun 17, 2024
john-h-kastner-aws added a commit that referenced this issue Jun 18, 2024
Fixes #994

Signed-off-by: John Kastner <jkastner@amazon.com>
john-h-kastner-aws added a commit that referenced this issue Jun 18, 2024
Fixes #994

Signed-off-by: John Kastner <jkastner@amazon.com>
john-h-kastner-aws added a commit that referenced this issue Jun 18, 2024
Fixes #994

Signed-off-by: John Kastner <jkastner@amazon.com>
john-h-kastner-aws added a commit that referenced this issue Jun 18, 2024
Fixes #994

Signed-off-by: John Kastner <jkastner@amazon.com>
@john-h-kastner-aws john-h-kastner-aws changed the title Policy JSON format does not error for spaces in annoations Policy JSON format does not error for spaces in annotations Jun 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. This is as high priority issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant