-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* trial * added a check * Update README.md * Update README.md * Update README.md * add - handle more case * skip already tagged api sinks * add - api by inference rule * fix - missing flow * use kotlin and java language as one in flows filtering * create new rule per ruleId only once * minor refactor * fix failing build * fix * added test case for retrofit * add test cases for inference api
- Loading branch information
1 parent
ff4fe73
commit bf592ab
Showing
28 changed files
with
939 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
src/main/resources/ai/privado/rulevalidator/schema/inferences.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
{ | ||
"definitions": {}, | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"$id": "https://github.com/Privado-Inc/privado-core/tree/main/src/main/resources/ai/privado/rulevalidator/schema/inferences.json", | ||
"title": "Root", | ||
"type": "object", | ||
"required": [ | ||
"inferences" | ||
], | ||
"additionalProperties": false, | ||
"properties": { | ||
"inferences": { | ||
"$id": "#root/inferences", | ||
"title": "Inferences", | ||
"type": "array", | ||
"default": [], | ||
"items":{ | ||
"$id": "#root/inferences/items", | ||
"title": "Items", | ||
"type": "object", | ||
"required": [ | ||
"id", | ||
"name", | ||
"domains", | ||
"patterns" | ||
], | ||
"additionalProperties": false, | ||
"properties": { | ||
"id": { | ||
"$id": "#root/inferences/items/id", | ||
"title": "Id", | ||
"type": "string", | ||
"default": "", | ||
"examples": [ | ||
"Storages.AmazonS3.Read" | ||
], | ||
"pattern": "^.*$" | ||
}, | ||
"name": { | ||
"$id": "#root/inferences/items/name", | ||
"title": "Name", | ||
"type": "string", | ||
"default": "", | ||
"examples": [ | ||
"Amazon S3(Read)" | ||
], | ||
"pattern": "^.*$" | ||
}, | ||
"filterProperty": { | ||
"$id": "#root/inferences/items/filterProperty", | ||
"title": "FilterProperty", | ||
"type": "string", | ||
"default": "method_full_name", | ||
"examples": [ | ||
"code", | ||
"method_full_name" | ||
], | ||
"pattern": "^(code|method_full_name|method_full_name_with_literal|method_full_name_with_property_name)$" | ||
}, | ||
"domains": { | ||
"$id": "#root/inferences/items/domains", | ||
"title": "Domains", | ||
"type": "array", | ||
"default": [], | ||
"items":{ | ||
"$id": "#root/inferences/items/domains/items", | ||
"title": "Items", | ||
"type": "string", | ||
"default": "", | ||
"examples": [ | ||
"aws.amazon.com" | ||
], | ||
"pattern": "^.*$" | ||
} | ||
}, | ||
"patterns": { | ||
"$id": "#root/inferences/items/patterns", | ||
"title": "Patterns", | ||
"type": "array", | ||
"default": [], | ||
"items":{ | ||
"$id": "#root/inferences/items/patterns/items", | ||
"title": "Items", | ||
"type": "string", | ||
"format": "regex", | ||
"default": "", | ||
"examples": [ | ||
".*(AmazonS3).*" | ||
], | ||
"pattern": "^.*$" | ||
} | ||
}, | ||
"tags": { | ||
"$id": "#root/inferences/items/tags", | ||
"title": "Tags", | ||
"type": ["object", "null"], | ||
"default": null | ||
} | ||
} | ||
} | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/main/scala/ai/privado/languageEngine/go/tagger/sink/GoAPISinkTagger.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package ai.privado.languageEngine.go.tagger.sink | ||
|
||
import ai.privado.cache.{AppCache, RuleCache} | ||
import ai.privado.entrypoint.PrivadoInput | ||
import ai.privado.tagger.sink.api.APISinkTagger | ||
import io.shiftleft.codepropertygraph.generated.Cpg | ||
|
||
object GoAPISinkTagger extends APISinkTagger { | ||
|
||
override def applyTagger(cpg: Cpg, ruleCache: RuleCache, privadoInput: PrivadoInput, appCache: AppCache): Unit = { | ||
|
||
super.applyTagger(cpg, ruleCache, privadoInput, appCache) | ||
|
||
new GoAPITagger(cpg, ruleCache, privadoInput, appCache).createAndApply() | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.