@@ -43,7 +43,7 @@ class SensitivePrivateInfo extends SensitiveDataType, TPrivateInfo {
43
43
44
44
override string getRegexp ( ) {
45
45
result =
46
- ".*(" +
46
+ "(?is) .*(" +
47
47
// Inspired by the list on https://cwe.mitre.org/data/definitions/359.html
48
48
// Government identifiers, such as Social Security Numbers
49
49
"social.?security|national.?insurance|" +
@@ -82,7 +82,7 @@ private string regexpProbablySafe() {
82
82
private class SensitiveVarDecl extends VarDecl {
83
83
SensitiveDataType sensitiveType ;
84
84
85
- SensitiveVarDecl ( ) { this .getName ( ) .toLowerCase ( ) . regexpMatch ( sensitiveType .getRegexp ( ) ) }
85
+ SensitiveVarDecl ( ) { this .getName ( ) .regexpMatch ( sensitiveType .getRegexp ( ) ) }
86
86
87
87
predicate hasInfo ( string label , SensitiveDataType type ) {
88
88
label = this .getName ( ) and
@@ -99,7 +99,7 @@ private class SensitiveFunction extends Function {
99
99
100
100
SensitiveFunction ( ) {
101
101
name = this .getName ( ) .splitAt ( "(" , 0 ) and
102
- name .toLowerCase ( ) . regexpMatch ( sensitiveType .getRegexp ( ) )
102
+ name .regexpMatch ( sensitiveType .getRegexp ( ) )
103
103
}
104
104
105
105
predicate hasInfo ( string label , SensitiveDataType type ) {
@@ -114,7 +114,7 @@ private class SensitiveFunction extends Function {
114
114
private class SensitiveArgument extends Argument {
115
115
SensitiveDataType sensitiveType ;
116
116
117
- SensitiveArgument ( ) { this .getLabel ( ) .toLowerCase ( ) . regexpMatch ( sensitiveType .getRegexp ( ) ) }
117
+ SensitiveArgument ( ) { this .getLabel ( ) .regexpMatch ( sensitiveType .getRegexp ( ) ) }
118
118
119
119
predicate hasInfo ( string label , SensitiveDataType type ) {
120
120
label = this .getLabel ( ) and
@@ -147,7 +147,7 @@ class SensitiveExpr extends Expr {
147
147
)
148
148
) and
149
149
// do not mark as sensitive it if it is probably safe
150
- not label .toLowerCase ( ) . regexpMatch ( regexpProbablySafe ( ) )
150
+ not label .regexpMatch ( regexpProbablySafe ( ) )
151
151
}
152
152
153
153
/**
@@ -165,7 +165,7 @@ class SensitiveExpr extends Expr {
165
165
* A function that is likely used to encrypt or hash data.
166
166
*/
167
167
private class EncryptionFunction extends Function {
168
- EncryptionFunction ( ) { this .getName ( ) .regexpMatch ( ".*(crypt|hash|encode|protect).*" ) }
168
+ EncryptionFunction ( ) { this .getName ( ) .regexpMatch ( "(?is) .*(crypt|hash|encode|protect).*" ) }
169
169
}
170
170
171
171
/**
0 commit comments