Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlin poc #344

Merged
merged 5 commits into from
Nov 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions config/systemConfig/kotlin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
systemConfig:
- key: apiHttpLibraries
value: ^(?i)(org.apache.http|okhttp|org.glassfish.jersey|com.mashape.unirest|java.net.http|java.net.URL|org.springframework.(web|core.io)|groovyx.net.http|org.asynchttpclient|kong.unirest.java|org.concordion.cubano.driver.http|javax.net.ssl|javax.xml.soap|org.apache.axis2|com.sun.xml.messaging.saaj|org.springframework.ws.client|com.eviware.soapui|org.apache.cxf|org.jboss.ws|com.ibm.websphere.sca.extensions.soap|com.sun.xml.ws|org.apache.camel.component.cxf|org.codehaus.xfire|org.apache.synapse|org.apache.wink.client|com.oracle.webservices.internal.api.databinding.Databinding|com.sap.engine.interfaces.webservices.runtime.client).*

- key: ignoredSinks
value: (?i).*(?<=map|list|jsonobject|json|array|arrays|jsonnode|objectmapper|objectnode).*(put:|get:).*

- key: apiSinks
value: (?i)(?:url|client|openConnection|request|execute|newCall|load|host|access|fetch|get|getInputStream|getApod|getForObject|getForEntity|list|set|put|post|proceed|trace|patch|Path|send|sendAsync|remove|delete|write|read|assignment|provider|exchange|postForEntity|call|createCall|createEndpoint|dispatch|invoke|newMessage|getInput|getOutput|getResponse|marshall|unmarshall|send|asyncSend)

- 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)).*
31 changes: 31 additions & 0 deletions rules/sinks/leakages/logs/kotlin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
sinks:

- id: Leakages.Log.Error
name: Log Error
patterns:
- "(?i)(?:io.github.microutils.kotlin-logging.Logger).*(?:wtf|error|severe|fatal|[.]e[:]).*"
tags:

- id: Leakages.Log.Warn
name: Log Warn
patterns:
- "(?i)(?:io.github.microutils.kotlin-logging.Logger).*(warn|warning|[.]w[:]).*"
tags:

- id: Leakages.Log.Debug
name: Log Debug
patterns:
- "(?i)(?:io.github.microutils.kotlin-logging.Logger).*(debug|trace|[.](log|d|v|t)[:]).*"
tags:

- id: Leakages.Log.Info
name: Log Info
patterns:
- "(?i)(?:io.github.microutils.kotlin-logging.Logger).*(info|[.]i[:]).*"
tags:

- id: Leakages.Log.Console
name: Log Console
patterns:
- "(?i)(kotlin.io).(?:print|println|write)[:].*"
tags:
4 changes: 2 additions & 2 deletions rules/sinks/storages/couchdb/java.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sinks:
- couchdb.apache.org
- apache.org
patterns:
- "(?i).*(?:com[.]fourspaces[.]couchdb|org[.]ektorp[.].*couchdb|org[.]lightcouch[.]couchdb|org.*jnosql.*couch.*|com[.]couchbase[.]client).*(?:get|list|head|select|view|find|search|match).*"
- "(?i).*(?:com[.]fourspaces[.]couchdb|org[.]ektorp[.].*couchdb|org[.]lightcouch[.]couchdb|org.*jnosql.*couch.*|com[.]couchbase[.]client|com[.]couchbase[.]lite).*(?:get|list|head|select|view|find|search|match).*"
tags:

- id: Storages.ApacheCouchDb.Write
Expand All @@ -18,5 +18,5 @@ sinks:
- couchdb.apache.org
- apache.org
patterns:
- "(?i).*(?:com[.]fourspaces[.]couchdb|.*org[.]ektorp[.].*couchdb|.*org[.]lightcouch[.]CouchDb|org.*jnosql.*couch.*|com[.]couchbase[.]client).*(?:add|copy|apply|create|delete|modify|remove|reset|restore|insert|drop|rename|save|set|update|bulkWrite).*"
- "(?i).*(?:com[.]fourspaces[.]couchdb|.*org[.]ektorp[.].*couchdb|.*org[.]lightcouch[.]CouchDb|org.*jnosql.*couch.*|com[.]couchbase[.]clientcom[.]couchbase[.]lite).*(?:add|copy|apply|create|delete|modify|remove|reset|restore|insert|drop|rename|save|set|update|bulkWrite).*"
tags:
24 changes: 24 additions & 0 deletions rules/sinks/storages/firebase/kotlin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
sinks:
- id: Storages.Firebase.Read
name: Firebase
domains:
- "firebase.google.com"
patterns:
- "(?i)(com[.]google[.]firebase)[.](database).*(?:find|get|select|search|load).*"
- "(?i)(com[.]firebase)[.](database).*(?:find|get|select|search|load).*"
- "(?i)(io[.]firebase)[.](database).*(?:find|get|select|search|load).*"
tags:

- id: Storages.Firebase.Write
name: Firebase
domains:
- "firebase.google.com"
patterns:
- "(?i)(com[.]google[.]firebase)[.](database).*(?:set|save|delete|insert|update).*"
- "(?i)(com[.]firebase)[.](database).*(?:set|save|delete|insert|update).*"
- "(?i)(io[.]firebase)[.](database).*(?:set|save|delete|insert|update).*"
tags:




4 changes: 2 additions & 2 deletions rules/sinks/storages/mongodb/java.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ sinks:
domains:
- mongodb.com
patterns:
- "(?i)(org.springframework.data.mongodb.core.ReactiveMongoTemplate)[.]((find|get|getByKey|getByKeys|getCount|createAggregation|createQuery|queryByExample|exists).*)"
- "(?i)(org.springframework.data.mongodb.core).*[.]((find|get|getByKey|getByKeys|getCount|createAggregation|createQuery|queryByExample|exists).*)"
tags:

- id: Storages.MongoDB.SpringRepository.Write
name: MongoDB(Write)
domains:
- mongodb.com
patterns:
- "(?i)(org.springframework.data.mongodb.core.ReactiveMongoTemplate)[.]((save|update|updateFirst|createUpdateOperations|delete|findAnd(Delete|Modify)).*)"
- "(?i)(org.springframework.data.mongodb.core).*[.]((save|update|updateFirst|createUpdateOperations|delete|findAnd(Delete|Modify)).*)"
tags:
16 changes: 16 additions & 0 deletions rules/sinks/storages/realm/kotlin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
sinks:
- id: Storages.Realm.Read
name: Realm(Read)
domains:
- realm.io
patterns:
- (?i)(io.realm.Realm)[.].*(?:find|get|select|search|load)(.*)
tags:

- id: Storages.Realm.Write
name: Realm(Write)
domains:
- realm.io
patterns:
- (?i)(io.realm.Realm)[.].*(?:save|delete|insert|update)(.*)
tags:
10 changes: 10 additions & 0 deletions rules/sinks/third_parties/sdk/google/kotlin.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
sinks:
- id: ThirdParties.SDK.Google.Firebase
name: Firebase
domains:
- "firebase.google.com"
patterns:
- "(?i)(com[.]google[.]firebase)[.](?!(database)).*"
- "(?i)(com[.]firebase)[.](?!(database)).*"
- "(?i)(io[.]firebase)[.](?!(database)).*"
tags:
Loading