diff --git a/.gitignore b/.gitignore index f5e2afc9..a973bfc7 100644 --- a/.gitignore +++ b/.gitignore @@ -246,3 +246,4 @@ dist # files privado notes.md +workspace \ No newline at end of file diff --git a/config/systemConfig/default.yaml b/config/systemConfig/default.yaml new file mode 100644 index 00000000..8a0696e1 --- /dev/null +++ b/config/systemConfig/default.yaml @@ -0,0 +1,3 @@ +systemConfig: + - key: maxSocketCount + value: "4096" diff --git a/rules/sinks/leakages/logs/go.yaml b/rules/sinks/leakages/logs/go.yaml new file mode 100644 index 00000000..4b2b3a09 --- /dev/null +++ b/rules/sinks/leakages/logs/go.yaml @@ -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: diff --git a/rules/sinks/storages/amazonS3/go.yaml b/rules/sinks/storages/amazonS3/go.yaml new file mode 100644 index 00000000..bbe0c41e --- /dev/null +++ b/rules/sinks/storages/amazonS3/go.yaml @@ -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: \ No newline at end of file diff --git a/rules/sinks/storages/arangodb/go.yaml b/rules/sinks/storages/arangodb/go.yaml new file mode 100644 index 00000000..2747f7bf --- /dev/null +++ b/rules/sinks/storages/arangodb/go.yaml @@ -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: \ No newline at end of file diff --git a/rules/sinks/storages/bigtable/go.yaml b/rules/sinks/storages/bigtable/go.yaml new file mode 100644 index 00000000..9a4ab782 --- /dev/null +++ b/rules/sinks/storages/bigtable/go.yaml @@ -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: \ No newline at end of file diff --git a/rules/sinks/storages/cassandra/go.yaml b/rules/sinks/storages/cassandra/go.yaml new file mode 100644 index 00000000..3ed03176 --- /dev/null +++ b/rules/sinks/storages/cassandra/go.yaml @@ -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: \ No newline at end of file diff --git a/rules/sinks/storages/cognito/go.yaml b/rules/sinks/storages/cognito/go.yaml new file mode 100644 index 00000000..dc2189c6 --- /dev/null +++ b/rules/sinks/storages/cognito/go.yaml @@ -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: diff --git a/rules/sinks/storages/cosmosdb/go.yaml b/rules/sinks/storages/cosmosdb/go.yaml new file mode 100644 index 00000000..4010a0a0 --- /dev/null +++ b/rules/sinks/storages/cosmosdb/go.yaml @@ -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: \ No newline at end of file diff --git a/rules/sinks/storages/dynamodb/go.yaml b/rules/sinks/storages/dynamodb/go.yaml new file mode 100644 index 00000000..763ca3f2 --- /dev/null +++ b/rules/sinks/storages/dynamodb/go.yaml @@ -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: \ No newline at end of file diff --git a/rules/sinks/storages/elasticsearch/go.yaml b/rules/sinks/storages/elasticsearch/go.yaml new file mode 100644 index 00000000..a0a92422 --- /dev/null +++ b/rules/sinks/storages/elasticsearch/go.yaml @@ -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: \ No newline at end of file diff --git a/rules/sinks/storages/kinesis/go.yaml b/rules/sinks/storages/kinesis/go.yaml new file mode 100644 index 00000000..2750df08 --- /dev/null +++ b/rules/sinks/storages/kinesis/go.yaml @@ -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: \ No newline at end of file diff --git a/rules/sinks/storages/mongodb/go.yaml b/rules/sinks/storages/mongodb/go.yaml new file mode 100644 index 00000000..6a957690 --- /dev/null +++ b/rules/sinks/storages/mongodb/go.yaml @@ -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: \ No newline at end of file diff --git a/rules/sinks/storages/neo4j/go.yaml b/rules/sinks/storages/neo4j/go.yaml new file mode 100644 index 00000000..febd4fee --- /dev/null +++ b/rules/sinks/storages/neo4j/go.yaml @@ -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: \ No newline at end of file diff --git a/rules/sinks/storages/oracleDatabase/go.yaml b/rules/sinks/storages/oracleDatabase/go.yaml new file mode 100644 index 00000000..b21a5e08 --- /dev/null +++ b/rules/sinks/storages/oracleDatabase/go.yaml @@ -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: diff --git a/rules/sinks/storages/pouchdb/go.yaml b/rules/sinks/storages/pouchdb/go.yaml new file mode 100644 index 00000000..20911f1b --- /dev/null +++ b/rules/sinks/storages/pouchdb/go.yaml @@ -0,0 +1,21 @@ + +# Sink rule for ThirdParty SDK +# The id follows a format : "ThirdParties.SDK.." + +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: diff --git a/rules/sinks/storages/prestodb/go.yaml b/rules/sinks/storages/prestodb/go.yaml new file mode 100644 index 00000000..facb25a6 --- /dev/null +++ b/rules/sinks/storages/prestodb/go.yaml @@ -0,0 +1,13 @@ + +# Sink rule for ThirdParty SDK +# The id follows a format : "ThirdParties.SDK.." + +sinks: + + - id: Storages.Prestodb.ReadAndWrite + name: Prestodb(ReadAndWrite) + domains: + - "prestodb.io" + patterns: + - "(?i)(github.com/prestodb/presto-go-client/presto).*(Query)" + tags: diff --git a/rules/sinks/storages/redis/go.yaml b/rules/sinks/storages/redis/go.yaml new file mode 100644 index 00000000..d5713350 --- /dev/null +++ b/rules/sinks/storages/redis/go.yaml @@ -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: diff --git a/rules/sinks/storages/relationaldatabase/go.yaml b/rules/sinks/storages/relationaldatabase/go.yaml new file mode 100644 index 00000000..816487ff --- /dev/null +++ b/rules/sinks/storages/relationaldatabase/go.yaml @@ -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: \ No newline at end of file diff --git a/rules/sinks/storages/scylladb/go.yaml b/rules/sinks/storages/scylladb/go.yaml new file mode 100644 index 00000000..fdfd7073 --- /dev/null +++ b/rules/sinks/storages/scylladb/go.yaml @@ -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: diff --git a/rules/sinks/storages/snowflake/go.yaml b/rules/sinks/storages/snowflake/go.yaml new file mode 100644 index 00000000..3a62c174 --- /dev/null +++ b/rules/sinks/storages/snowflake/go.yaml @@ -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: diff --git a/rules/sinks/storages/sqlalchemy/python.yaml b/rules/sinks/storages/sqlalchemy/python.yaml deleted file mode 100644 index 1da8f4a4..00000000 --- a/rules/sinks/storages/sqlalchemy/python.yaml +++ /dev/null @@ -1,12 +0,0 @@ - -# Sink Rules for storage database Android SQLite - https://developer.android.com/ - -sinks: - - - id: Storages.SQLAlchemy - name: SQLAlchemy - domains: - - sqlalchemy.org - patterns: - - "(?i)(.*sqlalchemy.*)" - tags: diff --git a/rules/sinks/storages/sqlite/go.yaml b/rules/sinks/storages/sqlite/go.yaml new file mode 100644 index 00000000..fe56ec05 --- /dev/null +++ b/rules/sinks/storages/sqlite/go.yaml @@ -0,0 +1,20 @@ + +# Sink Rules for storage database Android SQLite - https://developer.android.com/ + +sinks: + + - id: Storages.Android.SQLite.Read + name: SQLite(Read) + domains: + - android.com + patterns: + - "(?i)(github.com/mattn/go-sqlite).*(Query|QueryRow)" + tags: + + - id: Storages.Android.SQLite.ReadAndWrite + name: SQLite(ReadAndWrite) + domains: + - android.com + patterns: + - "(?i)(github.com/mattn/go-sqlite).*(Exec|Prepare|Stmt)" + tags: \ No newline at end of file diff --git a/rules/sinks/storages/sqlx/go.yaml b/rules/sinks/storages/sqlx/go.yaml new file mode 100644 index 00000000..f82c1dc3 --- /dev/null +++ b/rules/sinks/storages/sqlx/go.yaml @@ -0,0 +1,9 @@ +sinks: + + - id: Storages.SQLX.ReadAndWrite + name: SQLX + domains: + - sqlx.com + patterns: + - "(?i)(github.com/jmoiron/sqlx).*(Exec|Select|Get)" + tags: \ No newline at end of file diff --git a/rules/sinks/storages/timestream/go.yaml b/rules/sinks/storages/timestream/go.yaml new file mode 100644 index 00000000..dc0e67bc --- /dev/null +++ b/rules/sinks/storages/timestream/go.yaml @@ -0,0 +1,22 @@ + +# Sink Rules for storage database Amazon Timestream - https://aws.amazon.com/timestream/ + +sinks: + + - id: Storages.AmazonTimestream.Read + name: Amazon Timestream(Read) + domains: + - aws.amazon.com + - amazon.com + patterns: + - "(?i)(github.com/aws/aws-sdk-go/service/timestreamquery).*(QueryInput)" + tags: + + - id: Storages.AmazonTimestream.Write + name: Amazon Timestream(Write) + domains: + - aws.amazon.com + - amazon.com + patterns: + - "(?i)(github.com/aws/aws-sdk-go/service/timestreamwrite).*(WriteRecordsInput)" + tags: diff --git a/rules/sinks/storages/vaticleTypedb/go.yaml b/rules/sinks/storages/vaticleTypedb/go.yaml new file mode 100644 index 00000000..4edbaa80 --- /dev/null +++ b/rules/sinks/storages/vaticleTypedb/go.yaml @@ -0,0 +1,12 @@ + +# Sink Rules for storage database Vaticle TypeDB - https://vaticle.com/typedb + +sinks: + + - id: Storages.VaticleTypeDB.ReadAndWrite + name: Vaticle TypeDB + domains: + - vaticle.com + patterns: + - "(?i)(github.com/vaticle/tcd-go-client).*(Query)" + tags: diff --git a/rules/sinks/storages/weaviate/go.yaml b/rules/sinks/storages/weaviate/go.yaml new file mode 100644 index 00000000..ace642a6 --- /dev/null +++ b/rules/sinks/storages/weaviate/go.yaml @@ -0,0 +1,20 @@ + +# Sink Rules for storage database Vaticle TypeDB - https://vaticle.com/typedb + +sinks: + + - id: Storages.Weaviate.ReadAndWrite + name: Weaviate VectorDB + domains: + - weaviate.io + patterns: + - "(?i)(github.com/semi-technologies/weaviate-go-client).*(ObjectsBatcher)" + tags: + + - id: Storages.Weaviate.Read + name: Weaviate VectorDB(Read) + domains: + - weaviate.io + patterns: + - "(?i)(github.com/semi-technologies/weaviate-go-client).*(Get|GetSearch)" + tags: