feat(report): allow user-defined templates (#1650)

This commit is contained in:
Richard Gomez authored and GitHub committed 2024-12-10 18:56:11 -06:00
1 parent e393d299bc
commit 83e99bacf1
72 files changed
+586 -549

No files matched your search

-23
View File
@@ -1,23 +0,0 @@
[
{
"Description": "",
"StartLine": 1,
"EndLine": 2,
"StartColumn": 1,
"EndColumn": 2,
"Line": "whole line containing secret",
"Match": "line containing secret",
"Secret": "a secret",
"File": "auth.py",
"SymlinkFile": "",
"Commit": "0000000000000000",
"Entropy": 0,
"Author": "John Doe",
"Email": "johndoe@gmail.com",
"Date": "10-19-2003",
"Message": "opps",
"Tags": [],
"RuleID": "test-rule",
"Fingerprint": ""
}
]
-204
View File
@@ -15,210 +15,6 @@
"text": "AWS Access Key"
}
},
{
"id": "aws-secret-key",
"shortDescription": {
"text": "AWS Secret Key"
}
},
{
"id": "aws-mws-key",
"shortDescription": {
"text": "AWS MWS key"
}
},
{
"id": "facebook-secret-key",
"shortDescription": {
"text": "Facebook Secret Key"
}
},
{
"id": "facebook-client-id",
"shortDescription": {
"text": "Facebook Client ID"
}
},
{
"id": "twitter-secret-key",
"shortDescription": {
"text": "Twitter Secret Key"
}
},
{
"id": "twitter-client-id",
"shortDescription": {
"text": "Twitter Client ID"
}
},
{
"id": "github-pat",
"shortDescription": {
"text": "Github Personal Access Token"
}
},
{
"id": "github-oauth",
"shortDescription": {
"text": "Github OAuth Access Token"
}
},
{
"id": "github-app",
"shortDescription": {
"text": "Github App Token"
}
},
{
"id": "github-refresh",
"shortDescription": {
"text": "Github Refresh Token"
}
},
{
"id": "linkedin-client",
"shortDescription": {
"text": "LinkedIn Client ID"
}
},
{
"id": "linkedin-secret",
"shortDescription": {
"text": "LinkedIn Secret Key"
}
},
{
"id": "slack",
"shortDescription": {
"text": "Slack"
}
},
{
"id": "apkey",
"shortDescription": {
"text": "Asymmetric Private Key"
}
},
{
"id": "google",
"shortDescription": {
"text": "Google (GCP) Service Account"
}
},
{
"id": "google",
"shortDescription": {
"text": "Google (GCP) Service Account"
}
},
{
"id": "heroku",
"shortDescription": {
"text": "Heroku API key"
}
},
{
"id": "mailchimp",
"shortDescription": {
"text": "MailChimp API key"
}
},
{
"id": "mailgun",
"shortDescription": {
"text": "Mailgun API key"
}
},
{
"id": "paypal",
"shortDescription": {
"text": "PayPal Braintree access token"
}
},
{
"id": "piacatic",
"shortDescription": {
"text": "Picatic API key"
}
},
{
"id": "sendgrid",
"shortDescription": {
"text": "SendGrid API Key"
}
},
{
"id": "sidekiq-secret",
"shortDescription": {
"text": "Sidekiq Secret"
}
},
{
"id": "sidekiq-sensitive-url",
"shortDescription": {
"text": "Sidekiq Sensitive URL"
}
},
{
"id": "slack-webhook",
"shortDescription": {
"text": "Slack Webhook"
}
},
{
"id": "stripe",
"shortDescription": {
"text": "Stripe API key"
}
},
{
"id": "square",
"shortDescription": {
"text": "Square access token"
}
},
{
"id": "square-oauth",
"shortDescription": {
"text": "Square OAuth secret"
}
},
{
"id": "twilio",
"shortDescription": {
"text": "Twilio API key"
}
},
{
"id": "dynatrace",
"shortDescription": {
"text": "Dynatrace ttoken"
}
},
{
"id": "shopify",
"shortDescription": {
"text": "Shopify shared secret"
}
},
{
"id": "shopify-access",
"shortDescription": {
"text": "Shopify access token"
}
},
{
"id": "shopify-custom",
"shortDescription": {
"text": "Shopify custom app access token"
}
},
{
"id": "shopify-private",
"shortDescription": {
"text": "Shopify private app access token"
}
},
{
"id": "pypi",
"shortDescription": {
+23
View File
@@ -0,0 +1,23 @@
[
{
"Description": "A test rule",
"StartLine": 1,
"EndLine": 2,
"StartColumn": 1,
"EndColumn": 2,
"Line": "whole line containing secret",
"Match": "line containing secret",
"Secret": "a secret",
"File": "auth.py",
"SymlinkFile": "",
"Commit": "0000000000000000",
"Entropy": 0,
"Author": "John Doe",
"Email": "johndoe@gmail.com",
"Date": "10-19-2003",
"Message": "opps",
"Tags": ["tag1","tag2","tag3"],
"RuleID": "test-rule",
"Fingerprint": ""
}
]
+3
View File
@@ -0,0 +1,3 @@
| File | Line | Secret |
|:-----|-----:|--------|
| auth.py | 1 | "a secret" |
+25
View File
@@ -0,0 +1,25 @@
[{{ $lastFinding := (sub (len . ) 1) }}
{{- range $i, $finding := . }}{{with $finding}}
{
"Description": {{ quote .Description }},
"StartLine": {{ .StartLine }},
"EndLine": {{ .EndLine }},
"StartColumn": {{ .StartColumn }},
"EndColumn": {{ .EndColumn }},
"Line": {{ quote .Line }},
"Match": {{ quote .Match }},
"Secret": {{ quote .Secret }},
"File": "{{ .File }}",
"SymlinkFile": {{ quote .SymlinkFile }},
"Commit": {{ quote .Commit }},
"Entropy": {{ .Entropy }},
"Author": {{ quote .Author }},
"Email": {{ quote .Email }},
"Date": {{ quote .Date }},
"Message": {{ quote .Message }},
"Tags": [{{ $lastTag := (sub (len .Tags ) 1) }}{{ range $j, $tag := .Tags }}{{ quote . }}{{ if ne $j $lastTag }},{{ end }}{{ end }}],
"RuleID": {{ quote .RuleID }},
"Fingerprint": {{ quote .Fingerprint }}
}{{ if ne $i $lastFinding }},{{ end }}
{{- end}}{{ end }}
]
+5
View File
@@ -0,0 +1,5 @@
| File | Line | Secret |
|:-----|-----:|--------|
{{ range . -}}
| {{ .File }} | {{ .StartLine }} | {{ quote .Secret }} |
{{ end -}}