sonic-buildimage/platform/broadcom/sonic-platform-modules-inventec
Mai Bui 92d25be08f
[inventec] Replace os.system and remove subprocess with shell=True (#12108)
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-10-14 10:21:44 -04:00
..
common/utils [inventec] Replace os.system and remove subprocess with shell=True (#12108) 2022-10-14 10:21:44 -04:00
d6254qs [platform-modules]: fix compile issues for platform driver under 4.19 2020-04-17 04:51:51 +00:00
d6332 [inventec] Replace os.system and remove subprocess with shell=True (#12108) 2022-10-14 10:21:44 -04:00
d6356 [inventec] Replace os.system and remove subprocess with shell=True (#12108) 2022-10-14 10:21:44 -04:00
d6556 [platform-modules]: fix compile issues for platform driver under 4.19 2020-04-17 04:51:51 +00:00
d7032q28b [platform-modules]: fix compile issues for platform driver under 4.19 2020-04-17 04:51:51 +00:00
d7054q28b [inventec] Replace os.system and remove subprocess with shell=True (#12108) 2022-10-14 10:21:44 -04:00
d7264q28b [platform-modules]: fix compile issues for platform driver under 4.19 2020-04-17 04:51:51 +00:00
debian [sonic-linux-kernel]: security update to kernel 4.19.152 (#6490) 2021-02-06 21:02:06 -08:00
systemd [Inventec] Add support for D6332 platform (#5304) 2020-10-20 11:37:16 -07:00
.gitignore [build]: add .gitignore for cel, delta and inventec 2018-08-11 09:09:03 +00:00
LICENSE Inventec platform support (#811) 2017-07-18 11:21:24 -07:00