Skip to content

Commit

Permalink
Merge pull request #319 from Privado-Inc/dev
Browse files Browse the repository at this point in the history
Go: Alpha support
  • Loading branch information
pandurangpatil authored Oct 9, 2023
2 parents 7e70bb8 + 7a2535c commit 2d7f2af
Show file tree
Hide file tree
Showing 27 changed files with 437 additions and 12 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -246,3 +246,4 @@ dist
# files
privado
notes.md
workspace
3 changes: 3 additions & 0 deletions config/systemConfig/default.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
systemConfig:
- key: maxSocketCount
value: "4096"
68 changes: 68 additions & 0 deletions rules/sinks/leakages/logs/go.yaml
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:
17 changes: 17 additions & 0 deletions rules/sinks/storages/amazonS3/go.yaml
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:
17 changes: 17 additions & 0 deletions rules/sinks/storages/arangodb/go.yaml
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:
9 changes: 9 additions & 0 deletions rules/sinks/storages/bigtable/go.yaml
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:
10 changes: 10 additions & 0 deletions rules/sinks/storages/cassandra/go.yaml
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:
19 changes: 19 additions & 0 deletions rules/sinks/storages/cognito/go.yaml
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:
19 changes: 19 additions & 0 deletions rules/sinks/storages/cosmosdb/go.yaml
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:
19 changes: 19 additions & 0 deletions rules/sinks/storages/dynamodb/go.yaml
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:
17 changes: 17 additions & 0 deletions rules/sinks/storages/elasticsearch/go.yaml
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:
19 changes: 19 additions & 0 deletions rules/sinks/storages/kinesis/go.yaml
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:
17 changes: 17 additions & 0 deletions rules/sinks/storages/mongodb/go.yaml
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:
20 changes: 20 additions & 0 deletions rules/sinks/storages/neo4j/go.yaml
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:
12 changes: 12 additions & 0 deletions rules/sinks/storages/oracleDatabase/go.yaml
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:
21 changes: 21 additions & 0 deletions rules/sinks/storages/pouchdb/go.yaml
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:
13 changes: 13 additions & 0 deletions rules/sinks/storages/prestodb/go.yaml
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:
17 changes: 17 additions & 0 deletions rules/sinks/storages/redis/go.yaml
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:
12 changes: 12 additions & 0 deletions rules/sinks/storages/relationaldatabase/go.yaml
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:
12 changes: 12 additions & 0 deletions rules/sinks/storages/scylladb/go.yaml
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:
12 changes: 12 additions & 0 deletions rules/sinks/storages/snowflake/go.yaml
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:
Loading

0 comments on commit 2d7f2af

Please sign in to comment.