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

feat(arm): ARM FunctionAppHttpVersionLatest policy #6244

Merged
merged 10 commits into from
May 19, 2024

Conversation

RachelBorzi
Copy link
Contributor

@RachelBorzi RachelBorzi commented May 5, 2024

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Description

Added new policies for -
FunctionAppHttpVersionLatest - CKV_AZURE_67
and AppServiceDisallowCORS - CKV_AZURE_57

Description

I added a test that checks whether a value with a value of true is found under a certain field

Fix

How does someone fix the issue in code and/or in runtime?

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my feature, policy, or fix is effective and works
  • New and existing tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@ChanochShayner ChanochShayner changed the title ARM FunctionAppHttpVersionLatest policy feat(arm): ARM FunctionAppHttpVersionLatest policy May 5, 2024
Copy link
Contributor

@ChanochShayner ChanochShayner left a comment

Choose a reason for hiding this comment

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

Great Job!
Please update the PR description with the relevent info, and fix the failing jobs.

name = "Ensure that 'HTTP Version' is the latest, if used to run the Function app"
id = "CKV_AZURE_67"
supported_resources = ("Microsoft.Web/sites/slots",)
categories = [CheckCategories.GENERAL_SECURITY]
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use a tuple instead of a list.

Copy link
Contributor

@ChanochShayner ChanochShayner left a comment

Choose a reason for hiding this comment

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

💯

Copy link
Collaborator

@tsmithv11 tsmithv11 left a comment

Choose a reason for hiding this comment

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

Looks good! One suggestion

def __init__(self) -> None:
name = "Ensure that 'HTTP Version' is the latest, if used to run the Function app"
id = "CKV_AZURE_67"
supported_resources = ("Microsoft.Web/sites/slots",)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
supported_resources = ("Microsoft.Web/sites/slots",)
supported_resources = ("Microsoft.Web/sites/slots", "Microsoft.Web/sites")

Sites can also have this set: https://learn.microsoft.com/en-us/azure/templates/microsoft.web/sites?pivots=deployment-language-arm-template#siteconfig-1

Can you add a UT for this?

@RachelBorzi
Copy link
Contributor Author

RachelBorzi commented May 8, 2024 via email

@ChanochShayner ChanochShayner merged commit ab4c5de into bridgecrewio:main May 19, 2024
41 checks passed
ChanochShayner pushed a commit to tehila86127/checkov that referenced this pull request May 19, 2024
* app cors test

* function app version latest

* function app version latest

* function app version latest update validate

* function app version latest update validate

* function app version latest add supported resource

---------

Co-authored-by: Rachel <bb50305030@gmail.com>
ChanochShayner pushed a commit to tehila86127/checkov that referenced this pull request May 19, 2024
* app cors test

* function app version latest

* function app version latest

* function app version latest update validate

* function app version latest update validate

* function app version latest add supported resource

---------

Co-authored-by: Rachel <bb50305030@gmail.com>
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.

5 participants