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): AppServicePythonVersion - 82 check the 'python version' is the latest, if used to run the web app #6282

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

RachelBorzi
Copy link
Contributor

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

Description

feat(arm): add CKV_AZURE_82 to ensure that 'Python version' is the latest, if used to run the web app

Description

I added a test that verifies whether the python version is latest if used to run the web app

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

return "properties/siteConfig/pythonVersion"

def get_expected_value(self) -> str:
return "3.4"
Copy link
Contributor

Choose a reason for hiding this comment

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

@tsmithv11 Should we use 3.12 here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

We should accept 3.9-3.12 here (all not EOL or close to EOL). The TF policy is on a deprecated resource that can only go up to 3.4, but this one appears to be able to go up to 3.12.

Copy link
Contributor

Choose a reason for hiding this comment

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

So, @tsmithv11 correct me if I'm wrong, but it can be a Py check but a Yaml check, right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

@ChanochShayner this is a single attribute inside a single resource, so a Python check will probably be better so we can have auto-fixes for it.

Comment on lines +22 to +23
def get_expected_value(self) -> str:
return "3.10"
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
def get_expected_value(self) -> str:
return "3.10"
def get_expected_values(self) -> List[Any]:
return ["3.9", "3.10", "3.11", "3.12"]

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.

None yet

4 participants