Skip to content

Commit 249bbc7

Browse files
author
Sakshis
committed
modification in system-setproperty-hardcoded-secret-java
1 parent a9d1f42 commit 249bbc7

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

rules/java/security/system-setproperty-hardcoded-secret-java.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,31 @@ utils:
2121
inside:
2222
stopBy: end
2323
kind: argument_list
24+
has:
25+
kind: string_literal
26+
any:
27+
- has:
28+
kind: string_fragment
29+
regex: "^javax.net.ssl.keyStorePassword$"
30+
- has:
31+
kind: string_fragment
32+
regex: "^javax.net.ssl.trustStorePassword$"
2433
inside:
2534
stopBy: end
2635
kind: method_invocation
2736
all:
2837
- has:
2938
stopBy: end
39+
field: object
3040
kind: identifier
41+
regex: "^System$"
3142
- has:
3243
stopBy: end
44+
field: name
3345
kind: identifier
3446
regex: "^setProperty$"
3547
inside:
3648
kind: expression_statement
3749
rule:
3850
any:
3951
- matches: match_string_literal
40-

tests/__snapshots__/system-setproperty-hardcoded-secret-java-snapshot.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ snapshots:
2323
style: secondary
2424
start: 0
2525
end: 64
26+
- source: javax.net.ssl.keyStorePassword
27+
style: secondary
28+
start: 20
29+
end: 50
30+
- source: '"javax.net.ssl.keyStorePassword"'
31+
style: secondary
32+
start: 19
33+
end: 51
2634
- source: ("javax.net.ssl.keyStorePassword", "password")
2735
style: secondary
2836
start: 18
@@ -50,6 +58,14 @@ snapshots:
5058
style: secondary
5159
start: 0
5260
end: 66
61+
- source: javax.net.ssl.trustStorePassword
62+
style: secondary
63+
start: 20
64+
end: 52
65+
- source: '"javax.net.ssl.trustStorePassword"'
66+
style: secondary
67+
start: 19
68+
end: 53
5369
- source: ("javax.net.ssl.trustStorePassword", "password")
5470
style: secondary
5571
start: 18

0 commit comments

Comments
 (0)