fromyamlimportloadload("string")# should use safe_load
importyamlyaml.load("string")# should use safe_load
Compliant Code Examples
importosfrompathlibimportPathfromglobimportglobfromtypingimportList# Rule is not for ruamelfromruamel.yamlimportYAMLyaml=YAML()withopen("/path/to/file.yaml","r")asf:values=yaml.load(f)
importyamlyaml.load("string",Loader=yaml.SafeLoader)# uses SafeLoader, so load is okay
yaml.load("string")
シームレスな統合。 Datadog Code Security をお試しください
Datadog Code Security
このルールを試し、Datadog Code Security でコードを解析する
このルールの使用方法
1
2
rulesets:- python-security # Rules to enforce Python security.