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

[0.66] Add inline comments to suppress a security analysis (bandit) rule for Folly #1291

Merged
merged 1 commit into from
Jul 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Folly/build/fbcode_builder/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ def read_fbcode_builder_config(filename):
scope = {'read_fbcode_builder_config': _inner_read_config}
with open(filename) as config_file:
code = compile(config_file.read(), filename, mode='exec')
exec(code, scope)
# Exec is generally unsafe. See B102 (exec_used). https://bandit.readthedocs.io/en/latest/plugins/b102_exec_used.html
# This is not shipping code, but build code that is part of folly.
# After reviewing the code in tis repo, this is only called with config files that are part of this repo,
# so no 3rd party code is evaluated.
exec(code, scope) # nosec
return scope['config']


Expand Down