Skip to content

Commit

Permalink
Add inline comments to suppress a security analysis (bandit) rule for…
Browse files Browse the repository at this point in the history
… Folly (#1291)

Co-authored-by: Danny van Velzen <[email protected]>
  • Loading branch information
Saadnajmi and dannyvv authored Jul 25, 2022
1 parent 01027af commit d3de93c
Showing 1 changed file with 5 additions and 1 deletion.
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

0 comments on commit d3de93c

Please sign in to comment.