Browse Source

Eliminate possible insecure usage of temp file/directory

This patch is a fix for the issue B108: hardcoded_tmp_directory
found by bandit scanner.

The main reasoning for that is the need for safely creating
a temporary file or directory.

Change-Id: I4277e9196b9b707b83bb298faeccb59f07d6f10b
Related-Bug: #1759250
changes/71/563971/1
Max Pavlukhin 3 years ago
parent
commit
f6b0f7635c
2 changed files with 2 additions and 3 deletions
  1. +1
    -1
      neutron/agent/linux/keepalived.py
  2. +1
    -2
      tox.ini

+ 1
- 1
neutron/agent/linux/keepalived.py View File

@ -366,7 +366,7 @@ class KeepalivedManager(object):
"""
def __init__(self, resource_id, config, process_monitor, conf_path='/tmp',
def __init__(self, resource_id, config, process_monitor, conf_path,
namespace=None, throttle_restart_value=None):
self.resource_id = resource_id
self.config = config


+ 1
- 2
tox.ini View File

@ -165,11 +165,10 @@ local-check-factory = neutron.hacking.checks.factory
[testenv:bandit]
# B104: Possible binding to all interfaces
# B108: Probable insecure usage of temp file/directory
# B111: Execute with run_as_root=True identified, possible security issue
# B311: Standard pseudo-random generators are not suitable for security/cryptographic purpose
deps = -r{toxinidir}/test-requirements.txt
commands = bandit -r neutron -x tests -n5 -s B104,B108,B111,B311
commands = bandit -r neutron -x tests -n5 -s B104,B111,B311
[testenv:bashate]
commands = bash -c "find {toxinidir} \


Loading…
Cancel
Save