sonic-buildimage/platform/broadcom/sonic-platform-modules-ruijie/b6510-48vs8cq/sonic_platform
Mai Bui 35c4e9912d
[ruijie] Replace os.system and remove subprocess with shell=True (#12107)
Signed-off-by: maipbui <maibui@microsoft.com>
Dependency: [https://github.com/sonic-net/sonic-buildimage/pull/12065](https://github.com/sonic-net/sonic-buildimage/pull/12065)
#### Why I did it
1. `getstatusoutput` is used without a static string and it uses `shell=True`
2. `subprocess()` - when using with `shell=True` is dangerous. Using subprocess function without a static string can lead to command injection.
3. `os` - not secure against maliciously constructed input and dangerous if used to evaluate dynamic content.
#### How I did it
1. use `getstatusoutput` without shell=True
2. `subprocess()` - use `shell=False` instead. use an array string. Ref: [https://semgrep.dev/docs/cheat-sheets/python-command-injection/#mitigation](https://semgrep.dev/docs/cheat-sheets/python-command-injection/#mitigation)
3. `os` - use with `subprocess`
2022-11-28 12:43:43 -05:00
..
__init__.py [ruijie] Fix show version error info (#7541) 2021-05-06 14:53:20 -07:00
chassis.py [ruijie] Replace os.system and remove subprocess with shell=True (#12107) 2022-11-28 12:43:43 -05:00
common.py [ruijie] Replace os.system and remove subprocess with shell=True (#12107) 2022-11-28 12:43:43 -05:00
component.py [ruijie] Replace os.system and remove subprocess with shell=True (#12107) 2022-11-28 12:43:43 -05:00
config.py [Ruijie] Add ruijie platform & device (#4954) 2021-02-24 16:45:27 -08:00
eeprom.py [Ruijie] Add ruijie platform & device (#4954) 2021-02-24 16:45:27 -08:00
fan_drawer.py [Ruijie] Add ruijie platform & device (#4954) 2021-02-24 16:45:27 -08:00
fan.py [Ruijie] Add ruijie platform & device (#4954) 2021-02-24 16:45:27 -08:00
logger.py [Ruijie] Add ruijie platform & device (#4954) 2021-02-24 16:45:27 -08:00
pcie.py [Ruijie] Add ruijie platform & device (#4954) 2021-02-24 16:45:27 -08:00
platform.py [Ruijie] Add ruijie platform & device (#4954) 2021-02-24 16:45:27 -08:00
psu.py [Ruijie] Add ruijie platform & device (#4954) 2021-02-24 16:45:27 -08:00
regutil.py [Ruijie] Add ruijie platform & device (#4954) 2021-02-24 16:45:27 -08:00
rotor.py [Ruijie] Add ruijie platform & device (#4954) 2021-02-24 16:45:27 -08:00
sfp.py [SFP-Refactor] Modify transceiver key name (#9447) 2021-12-09 12:38:45 +05:30
thermal.py [Ruijie] Add ruijie platform & device (#4954) 2021-02-24 16:45:27 -08:00
watchdog.py [Ruijie] Add ruijie platform & device (#4954) 2021-02-24 16:45:27 -08:00