1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- # Usage: semgrep scan -f semgrep.yml
- rules:
- - id: rule-0
- message: "find http requests made not with *fiber.Ctx available"
- languages: [go]
- severity: WARNING
- patterns:
- - pattern-either:
- - pattern: |
- http.UnwrapWebAPIRequest(...)
- - pattern: |
- http.WebAPIRequest(...)
- - pattern-not-inside: |
- func $FUNC(c *fiber.Ctx, ...) $RET {
- ...
- }
- - id: rule-1
- message: "find http requests made (limiter should be installed at all places)"
- languages: [go]
- # severity: INFO
- severity: INVENTORY
- patterns:
- - pattern-either:
- - pattern: |
- http.UnwrapWebAPIRequest(...)
- - pattern: |
- http.WebAPIRequest(...)
- - id: rule-2
- message: "gjson.Get without gjson.Valid"
- languages: [go]
- severity: ERROR
- patterns:
- # - pattern-inside: |
- # func $FUNC(...) $RET {
- # ...
- # }
- - pattern: |
- gjson.Get($X, ...)
- - pattern-not-inside: |
- if !gjson.Valid($X) {
- $...DISCARD
- }
- ...
|