src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Security/Checks/awsHardcodedPassword.py

branch
eric7
changeset 11147
dee6e106b4d3
parent 11090
f5f5f5803935
equal deleted inserted replaced
11146:59e04f7003e9 11147:dee6e106b4d3
31 list of codes 31 list of codes
32 @rtype dict 32 @rtype dict
33 """ 33 """
34 return { 34 return {
35 "Str": [ 35 "Str": [
36 (checkHardcodedAwsKey, ("S801", "S802")), 36 (checkHardcodedAwsKey, ("S-801", "S-802")),
37 ], 37 ],
38 } 38 }
39 39
40 40
41 AWS_ACCESS_KEY_ID_SYMBOLS = string.ascii_uppercase + string.digits 41 AWS_ACCESS_KEY_ID_SYMBOLS = string.ascii_uppercase + string.digits
88 entropy = shannonEntropy(node.value, AWS_ACCESS_KEY_ID_SYMBOLS) 88 entropy = shannonEntropy(node.value, AWS_ACCESS_KEY_ID_SYMBOLS)
89 if entropy > AWS_ACCESS_KEY_ID_MAX_ENTROPY: 89 if entropy > AWS_ACCESS_KEY_ID_MAX_ENTROPY:
90 reportError( 90 reportError(
91 context.node.lineno - 1, 91 context.node.lineno - 1,
92 context.node.col_offset, 92 context.node.col_offset,
93 "S801", 93 "S-801",
94 "L", 94 "L",
95 "M", 95 "M",
96 node.value, 96 node.value,
97 ) 97 )
98 98
100 entropy = shannonEntropy(node.value, AWS_SECRET_ACCESS_KEY_SYMBOLS) 100 entropy = shannonEntropy(node.value, AWS_SECRET_ACCESS_KEY_SYMBOLS)
101 if entropy > AWS_SECRET_ACCESS_KEY_MAX_ENTROPY: 101 if entropy > AWS_SECRET_ACCESS_KEY_MAX_ENTROPY:
102 reportError( 102 reportError(
103 context.node.lineno - 1, 103 context.node.lineno - 1,
104 context.node.col_offset, 104 context.node.col_offset,
105 "S802", 105 "S-802",
106 "M", 106 "M",
107 "M", 107 "M",
108 node.value, 108 node.value,
109 ) 109 )

eric ide

mercurial