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

Bump Regula dependency to latest git. #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

evan-fugue
Copy link
Contributor

This is so we make use of HuJSON to parse the JSON in Rego metadoc
blocks, which allows trailing commas and comments.

For example, you can test with the rule:

__rego__metadoc__ := {
  "id": "FG_R00011",
  "title": "CloudFront viewer protocol policy should be set to https-only or redirect-to-https",
  "description": "CloudFront viewer protocol policy should be set to https-only or redirect-to-https. CloudFront connections should be encrypted during transmission over networks that can be accessed by malicious individuals. A CloudFront distribution should only use HTTPS or Redirect HTTP to HTTPS for communication between viewers and CloudFront.",
  "custom": {
    "severity": "Medium",
    "families": [
      "More rules",
      "e6f9b788-1841-4466-8db7-28d2f08da2ff"
    ],
    "provider": "AWS",
  }
}

resource_type = "AWS.EC2.Instance"

approved_amis = {
  "ami-04b762b4289fba92b"
}

allow {
    ami = input.ami  # Pull out AMIs
    approved_amis[ami]  # Assert
}

Note the comma after "provider": "AWS" at the end of the metadoc block.

This is so we make use of HuJSON to parse the JSON in Rego metadoc
blocks, which allows trailing commas and comments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant