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

security - refactor azure test code to not use insecure tempfile methods. #6985

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

Conversation

kennethkaane
Copy link

SonarQube scan reports five vulnerabilities with critical severity in the Cloud Custodian code. They arise from the use of the insecure 'tempfile.mktemp' function. Creating temporary files using insecure methods exposes the application to race conditions on filenames: a malicious user can try to create a file with a predictable name before the application does. A successful attack can result in other files being accessed, modified, corrupted, or deleted. This risk is even higher if the application runs with elevated permissions.

In the past, it has led to the following vulnerabilities:

The resolution is to use 'tempfile.TemporaryFile' function instead.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Nov 7, 2021

CLA Not Signed

@kapilt kapilt changed the title security - refactor code to prevent insecure temporary file creation methods security - refactor azure test code to not use insecure tempfile methods. Nov 7, 2021
@kapilt
Copy link
Collaborator

kapilt commented Nov 7, 2021

most of this appears related to the azure provider test code, aka not an issue in practice, but scanners gonna scan.

ie zero of this is runtime operational.

that said, i agree these are poor uses of tempfile in this provider, and should be replaced

@kapilt
Copy link
Collaborator

kapilt commented Nov 7, 2021

@kennethkaane can you please go through the cncf contributor agreement process.

[update] direct link https://api.easycla.lfx.linuxfoundation.org/v2/repository-provider/github/sign/14202841/52837350/6985/#/?version=2

@kennethkaane
Copy link
Author

the cncf contributor agreement process.

Hi @kapilt, I have completed the CNCF contributor agreement process.

@kapilt
Copy link
Collaborator

kapilt commented Nov 9, 2021

it looks like some of the earlier commits were done with a github user which the cla bot doesn't recognize, can you rebase those or amend those commits?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants