-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #316 from Privado-Inc/go
Go: Leakage and storage rules
- Loading branch information
Showing
25 changed files
with
434 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -246,3 +246,4 @@ dist | |
# files | ||
privado | ||
notes.md | ||
workspace |
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,68 @@ | ||
sinks: | ||
|
||
- id: Leakages.Log.Error | ||
name: Log Error | ||
patterns: | ||
- "(?i)(github.com/rs/zerolog/log).*[.](Error).*(Msg)" | ||
- "(?i)(github.com/sirupsen/logrus).*[.](error)(f?)" | ||
- "(?i)(go.uber.org/zap).*[.](error)(f|ln|w)?" | ||
- "(?i)(github.com/golang/glog).*[.](error)(depth|depthf|f|ln)?" | ||
- "(?i)(gopkg.in/inconshreveable/log15).*[.](error)" | ||
tags: | ||
|
||
- id: Leakages.Log.Warn | ||
name: Log Warn | ||
patterns: | ||
- "(?i)(github.com/rs/zerolog/log).*[.](Warn).*(Msg)" | ||
- "(?i)(github.com/sirupsen/logrus).*[.](warn)(f?)" | ||
- "(?i)(go.uber.org/zap).*[.](warn)(f|ln|w)?" | ||
- "(?i)(github.com/golang/glog).*[.](warn)(depth|depthf|f|ln)?" | ||
- "(?i)(gopkg.in/inconshreveable/log15).*[.](warn)" | ||
tags: | ||
|
||
- id: Leakages.Log.Debug | ||
name: Log Debug | ||
patterns: | ||
- "(?i)(github.com/rs/zerolog/log).*[.](Debug).*(Msg)" | ||
- "(?i)(github.com/sirupsen/logrus).*[.](debug)(f?)" | ||
- "(?i)(go.uber.org/zap).*[.](debug)(f|ln|w)?" | ||
- "(?i)(github.com/golang/glog).*[.](debug)(depth|depthf|f|ln)?" | ||
- "(?i)(gopkg.in/inconshreveable/log15).*[.](debug)" | ||
tags: | ||
|
||
- id: Leakages.Log.Info | ||
name: Log Info | ||
patterns: | ||
- "(?i)(github.com/rs/zerolog/log).*[.](Info).*(Msg)" | ||
- "(?i)(github.com/sirupsen/logrus).*[.](info)(f?)" | ||
- "(?i)(go.uber.org/zap).*[.](info)(f|ln|w)?" | ||
- "(?i)(github.com/golang/glog).*[.](info)(depth|depthf|f|ln)?" | ||
- "(?i)(gopkg.in/inconshreveable/log15).*[.](info)" | ||
tags: | ||
|
||
- id: Leakages.Log.Fatal | ||
name: Log Fatal | ||
patterns: | ||
- "(?i)(github.com/sirupsen/logrus).*[.](fatal)(f?)" | ||
- "(?i)(go.uber.org/zap).*[.](fatal)(f|ln|w)?" | ||
- "(?i)(github.com/golang/glog).*[.](fatal)(depth|depthf|f|ln)?" | ||
tags: | ||
|
||
- id: Leakages.Log.Panic | ||
name: Log Panic | ||
patterns: | ||
- "(?i)(github.com/sirupsen/logrus).*[.](panic)(f?)" | ||
- "(?i)(go.uber.org/zap).*[.](panic)(f|ln|w)?" | ||
tags: | ||
|
||
- id: Leakages.Log.Console | ||
name: Log Console | ||
patterns: | ||
- "(?i)(fmt)[.](Println|Print)(f?)" | ||
tags: | ||
|
||
- id: Leakages.Log.Trace | ||
name: Log Trace | ||
patterns: | ||
- "(?i)(github.com/rs/zerolog/log).*[.](Trace).*(Msg)" | ||
tags: |
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 @@ | ||
sinks: | ||
|
||
- id: Storages.AmazonS3.Write | ||
name: Amazon S3(Write) | ||
domains: | ||
- s3.amazon.com | ||
patterns: | ||
- "(?i)(github.com/aws/aws-sdk-go).*(s3).*(PutObject|HeadObject|DeleteObject)" | ||
tags: | ||
|
||
- id: Storage.AmazonS3.Read | ||
name: Amazon S3(Read) | ||
domains: | ||
- s3.amazon.com | ||
patterns: | ||
- "(?i)(github.com/aws/aws-sdk-go).*(s3).*(ListObjects|GetObject|CopyObject)" | ||
tags: |
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 @@ | ||
sinks: | ||
|
||
- id: Storages.ArangoDB.ReadAndWrite | ||
name: ArangoDB(Read) | ||
domains: | ||
- arangodb.com | ||
patterns: | ||
- "(?i)(github.com/arangodb/go-driver).*(Query|Execute)" | ||
tags: | ||
|
||
- id: Storages.ArangoDB.Write | ||
name: ArangoDB(Write) | ||
domains: | ||
- arangodb.com | ||
patterns: | ||
- "(?i)(github.com/arangodb/go-driver).*(CreateDocument|UpdateDocument|RemoveDocument)" | ||
tags: |
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,9 @@ | ||
sinks: | ||
|
||
- id: Storages.CloudBigtable.ReadAndWrite | ||
name: Google Cloud Bigtable | ||
domains: | ||
- cloud.google.com/bigquery | ||
patterns: | ||
- "(?i)(cloud.google.com/go/bigtable).*(Apply|ReadRow)" | ||
tags: |
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,10 @@ | ||
sinks: | ||
|
||
- id: Storages.ApacheCassandra.ReadAndWrite | ||
name: Apache Cassandra | ||
domains: | ||
- cassandra.apache.org | ||
- apache.org | ||
patterns: | ||
- "(?i)(github.com/gocql/gocql).*(Query)" | ||
tags: |
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,19 @@ | ||
sinks: | ||
|
||
- id: Storages.AmazonCognito.Read | ||
name: Amazon Cognito(Read) | ||
domains: | ||
- aws.amazon.com | ||
- amazon.com | ||
patterns: | ||
- "(?i)(github.com/aws/aws-sdk-go/service/cognitoidentityprovider).*(GetItem)" | ||
tags: | ||
|
||
- id: Storages.AmazonCognito.Write | ||
name: Amazon Cognito(Write) | ||
domains: | ||
- aws.amazon.com | ||
- amazon.com | ||
patterns: | ||
- "(?i)(github.com/aws/aws-sdk-go/service/cognitoidentityprovider).*(PutItem|UpdateItem|DeleteItem)" | ||
tags: |
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,19 @@ | ||
sinks: | ||
|
||
- id: Storages.AzureCosmosDb.Read | ||
name: Azure Cosmos DB(Read) | ||
domains: | ||
- azure.microsoft.com | ||
- microsoft.com | ||
patterns: | ||
- "(?i)(github.com/Azure/azure-sdk-for-go/sdk/data/cosmos).*(ReadItem|QueryItems)" | ||
tags: | ||
|
||
- id: Storages.AzureCosmosDb.Write | ||
name: Azure Cosmos DB(Write) | ||
domains: | ||
- azure.microsoft.com | ||
- microsoft.com | ||
patterns: | ||
- "(?i)(github.com/Azure/azure-sdk-for-go/sdk/data/cosmos).*(UpsertItem|DeleteItem)" | ||
tags: |
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,19 @@ | ||
sinks: | ||
|
||
- id: Storages.AmazonDynamoDB.Write | ||
name: Amazon Dynamo DB(Write) | ||
domains: | ||
- aws.amazon.com | ||
- amazon.com | ||
patterns: | ||
- "(?i)(github.com/aws/aws-sdk-go/service/dynamodb).*(PutItem|UpdateItem|DeleteItem)" | ||
tags: | ||
|
||
- id: Storages.AmazonDynamoDB.Read | ||
name: Amazon Dynamo DB(Read) | ||
domains: | ||
- aws.amazon.com | ||
- amazon.com | ||
patterns: | ||
- "(?i)(github.com/aws/aws-sdk-go/service/dynamodb).*(GetItem)" | ||
tags: |
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 @@ | ||
sinks: | ||
|
||
- id: Storages.Elasticsearch.Read | ||
name: Elasticsearch(Read) | ||
domains: | ||
- elastic.co | ||
patterns: | ||
- "(?i)(github.com/olivere/elastic).*(Search)" | ||
tags: | ||
|
||
- id: Storages.Elasticsearch.Write | ||
name: Elasticsearch(Write) | ||
domains: | ||
- elastic.co | ||
patterns: | ||
- "(?i)(github.com/olivere/elastic).*(CreateIndex|Delete|Update)" | ||
tags: |
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,19 @@ | ||
sinks: | ||
|
||
- id: Storages.AmazonKinesis.Read | ||
name: Amazon Kinesis(Read) | ||
domains: | ||
- aws.amazon.com | ||
- amazon.com | ||
patterns: | ||
- "(?i)(github.com/aws/aws-sdk-go/service/kinesis).*(GetRecords)" | ||
tags: | ||
|
||
- id: Storages.AmazonKinesis.Write | ||
name: Amazon Kinesis(Read) | ||
domains: | ||
- aws.amazon.com | ||
- amazon.com | ||
patterns: | ||
- "(?i)(github.com/aws/aws-sdk-go/service/kinesis).*(PutRecords)" | ||
tags: |
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 @@ | ||
sinks: | ||
|
||
- id: Storages.MongoDB.Read | ||
name: MongoDB(Read) | ||
domains: | ||
- mongodb.com | ||
patterns: | ||
- "(?i)(go.mongodb.org/mongo-driver/mongo).*(Find)" | ||
tags: | ||
|
||
- id: Storages.MongoDB.Write | ||
name: MongoDB(Write) | ||
domains: | ||
- mongodb.com | ||
patterns: | ||
- "(?i)(go.mongodb.org/mongo-driver/mongo).*(InsertOne|DeleteOne|UpdateOne)" | ||
tags: |
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,20 @@ | ||
|
||
# Sink Rules for storage database Neo4j Graph Database - https://neo4j.com/ | ||
|
||
sinks: | ||
|
||
- id: Storages.Neo4jGraphDatabase.ReadAndWrite | ||
name: Neo4j Graph Database(ReadAndWrite) | ||
domains: | ||
- neo4j.com | ||
patterns: | ||
- "(?i)(github.com/neo4j/neo4j-go-driver).*(ExecuteQuery)" | ||
tags: | ||
|
||
- id: Storages.Neo4jGraphDatabase.Read | ||
name: Neo4j Graph Database(Read) | ||
domains: | ||
- neo4j.com | ||
patterns: | ||
- "(?i)(github.com/neo4j/neo4j-go-driver).*(ExecuteRead)" | ||
tags: |
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,12 @@ | ||
|
||
# Sink Rules for storage database Oracle Database - https://www.oracle.com/database/ | ||
|
||
sinks: | ||
|
||
- id: Storages.OracleDatabase.ReadAndWrite | ||
name: Oracle Database | ||
domains: | ||
- oracle.com | ||
patterns: | ||
- "(?i)(github.com/sijms/go-ora).*(Exec|Query)" | ||
tags: |
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,21 @@ | ||
|
||
# Sink rule for ThirdParty SDK | ||
# The id follows a format : "ThirdParties.SDK.<THIRD_PARTY_ORGANISATION>.<SUB_ORGANISATION_IF_APPLICABLE>" | ||
|
||
sinks: | ||
|
||
- id: Storages.PouchDb.Write | ||
name: Pouch DB(Write) | ||
domains: | ||
- pouchdb.com | ||
patterns: | ||
- "(?i)(github.com/go-kivik/pouchdb).*(Put|BulkDocs)" | ||
tags: | ||
|
||
- id: Storages.PouchDb.Read | ||
name: Pouch DB(Read) | ||
domains: | ||
- pouchdb.com | ||
patterns: | ||
- "(?i)(github.com/go-kivik/pouchdb).*(Get|BulkGet)" | ||
tags: |
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,13 @@ | ||
|
||
# Sink rule for ThirdParty SDK | ||
# The id follows a format : "ThirdParties.SDK.<THIRD_PARTY_ORGANISATION>.<SUB_ORGANISATION_IF_APPLICABLE>" | ||
|
||
sinks: | ||
|
||
- id: Storages.Prestodb.ReadAndWrite | ||
name: Prestodb(ReadAndWrite) | ||
domains: | ||
- "prestodb.io" | ||
patterns: | ||
- "(?i)(github.com/prestodb/presto-go-client/presto).*(Query)" | ||
tags: |
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 @@ | ||
sinks: | ||
|
||
- id: Storages.Redis.Read | ||
name: Redis DB(Read) | ||
domains: | ||
- redis.io | ||
patterns: | ||
- "(?i)(github.com/go-redis).*[.](Get|HGet|HGetAll)" | ||
tags: | ||
|
||
- id: Storages.Redis.Write | ||
name: Redis DB(Write) | ||
domains: | ||
- redis.io | ||
patterns: | ||
- "(?i)(github.com/go-redis).*[.](Set|HSet|Del)" | ||
tags: |
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,12 @@ | ||
|
||
#In Go lang "database/sql" is a common package to connect any relational database | ||
|
||
sinks: | ||
|
||
- id: Storages.SQL.ReadAndWrite | ||
name: SQL DB(ReadAndWrite) | ||
domains: | ||
- pkg.go.dev/database/sql | ||
patterns: | ||
- "(?i)(database/sql).*(Prepare|Query|Stmt)(Context|Row)?" | ||
tags: |
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,12 @@ | ||
|
||
# Sink Rules for storage database ScyllaDB - https://www.scylladb.com/ | ||
|
||
sinks: | ||
|
||
- id: Storages.ScyllaDB.ReadAndWrite | ||
name: ScyllaDB(ReadAndWrite) | ||
domains: | ||
- scylladb.com | ||
patterns: | ||
- "(?i)(goapp/internal/scylla).*(Query)" | ||
tags: |
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,12 @@ | ||
|
||
# Sink Rules for storage database Android SQLite - https://developer.android.com/ | ||
|
||
sinks: | ||
|
||
- id: Storages.Snowflake.ReadAndWrite | ||
name: Snowflake(ReadAndWrite) | ||
domains: | ||
- "snowflake.com" | ||
patterns: | ||
- "(?i)(github.com/snowflakedb/gosnowflake).*(Exec|Query|mustExec|Prepare)" | ||
tags: |
Oops, something went wrong.