-
Notifications
You must be signed in to change notification settings - Fork 174
/
.semgrep.yml
94 lines (94 loc) · 2.96 KB
/
.semgrep.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
rules:
- id: resolveparams-passed-nil-context
patterns:
- pattern: |
$FUNC(..., graphql.ResolveParams{...}, ...)
- pattern-not-inside: |
$FUNC(..., graphql.ResolveParams{..., Context: $X, ...,}, ...)
message: graphql.ResolveParams literal with nil context passed to function
languages: [go]
severity: ERROR
- id: resolveparams-nil-context-var
patterns:
- pattern: var $X graphql.ResolveParams
- pattern-not-inside: |
var $X graphql.ResolveParams
...
$X.Context = $Y
message: graphql.ResolveParams created with nil context
languages: [go]
severity: ERROR
- id: resolveparams-nil-context-var-2
patterns:
- pattern: $X := graphql.ResolveParams{}
- pattern-not-inside: |
$X := graphql.ResolveParams{}
...
$X.Context = $Y
message: graphql.ResolveParams created with nil context
languages: [go]
severity: ERROR
- id: params-passed-nil-context
patterns:
- pattern: |
$FUNC(..., graphql.Params{...}, ...)
- pattern-not-inside: |
$FUNC(..., graphql.Params{..., Context: $X, ...,}, ...)
message: graphql.Params literal with nil context passed to function
languages: [go]
severity: ERROR
- id: params-nil-context-var
patterns:
- pattern: var $X graphql.Params
- pattern-not-inside: |
var $X graphql.Params
...
$X.Context = $Y
message: graphql.Params created with nil context
languages: [go]
severity: ERROR
- id: params-nil-context-var-2
patterns:
- pattern: $X := graphql.Params{}
- pattern-not-inside: |
$X := graphql.Params{}
...
$X.Context = $Y
message: graphql.Params created with nil context
languages: [go]
severity: ERROR
- id: relay-params-passed-nil-context
patterns:
- pattern: |
$FUNC(..., NodeResolverParams{...}, ...)
- pattern-not-inside: |
$FUNC(..., NodeResolverParams{..., Context: $X, ...,}, ...)
message: NodeResolverParams literal with nil context passed to function
languages: [go]
severity: ERROR
- id: relay-params-nil-context-var
patterns:
- pattern: var $X NodeResolverParams
- pattern-not-inside: |
var $X NodeResolverParams
...
$X.Context = $Y
message: NodeResolverParams created with nil context
languages: [go]
severity: ERROR
- id: relay-params-nil-context-var-2
patterns:
- pattern: $X := NodeResolverParams{}
- pattern-not-inside: |
$X := NodeResolverParams{}
...
$X.Context = $Y
message: NodeResolverParams created with nil context
languages: [go]
severity: ERROR
- id: generic-resolver-params-nil-context
patterns:
- pattern-regex: .*ResolverParams\{\}
message: ResolverParams created with nil context
languages: [go]
severity: ERROR