Skip to content

Commit

Permalink
go: API Tagger (#331)
Browse files Browse the repository at this point in the history
* go: API Tagger

* added internal api rule

* added do method

---------

Co-authored-by: “Hitesh <hitesh.bedre@privado.com>
  • Loading branch information
hiteshbedre and “Hitesh authored Oct 30, 2023
1 parent 6abc40e commit 03f880a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -246,4 +246,6 @@ dist
# files
privado
notes.md

#Directory created by IDE
workspace
9 changes: 9 additions & 0 deletions config/systemConfig/go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
systemConfig:
- key: apiHttpLibraries
value: ^(?i)(net/http|github.com/parnurzeal/gorequest|gopkg.in/resty|github.com/gojektech/heimdall/v\\d/httpclient|github.com/levigross/grequests|github.com/PuerkitoBio/rehttp|github.com/machinebox/graphql).*

- key: apiSinks
value: (?i)(?:url|client|open|request|execute|newCall|load|host|access|list|set|put|post|proceed|trace|patch|Path|send|remove|delete|write|read|postForEntity|call|createCall|createEndpoint|dispatch|invoke|getInput|getOutput|getResponse|do)

- key: apiIdentifier
value: (?i).*((hook|base|auth|prov|endp|install|request|service|gateway|route|resource)(.){0,12}url|(slack|web)(.){0,4}hook|(rest|api|request|service)(.){0,4}(endpoint|gateway|route)).*
6 changes: 6 additions & 0 deletions rules/sinks/internal_apis/api/go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
sinks:
- id: Sinks.API.InternalAPI
name: Internal APIs
patterns:
- "((http|https|ftp|ssh):\\/\\/){0,1}(((25[0-5]|(2[0-4]|1\\d|[1-9]|)\\d)\\.?\\b){4}|(localhost))(:[0-9]{2,4}){0,1}(\\/([a-z]){0,1}){0,1}.*"
tags:
8 changes: 8 additions & 0 deletions rules/sinks/third_parties/api/go.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
sinks:

- id: Sinks.ThirdParties.API
name: Third Party API
patterns:
- "(?i)((?:http|https):\\/\\/[a-zA-Z0-9_-][^)\\/(#|,!>\\s]{1,50}\\.(?:com|net|org|de|in|uk|us|io|gov|cn|ml|ai|ly|dev|cloud|me|icu|ru|info|top|tk|tr|cn|ga|cf|nl)).*(?<!png|jpeg|jpg|txt|blob|css|html|js|svg)"
- "(?i).*((hook|base|auth|prov|endp|install|request|service|gateway|route|resource)(.){0,12}url|(slack|web)(.){0,4}hook|(rest|api|request|service)(.){0,4}(endpoint|gateway|route)).*"
tags:

0 comments on commit 03f880a

Please sign in to comment.