From 5884833fd7c36e0021ddc7e50d06fe3374e90c15 Mon Sep 17 00:00:00 2001 From: rajdip-b Date: Tue, 15 Oct 2024 18:54:00 +0530 Subject: [PATCH] chore(secret-scan): Formatted files --- .../environment/create.environment.ts | 6 +- .../environment/delete.environment.ts | 11 +- .../environment/update.environment.ts | 6 +- apps/web/src/components/hero/index.tsx | 5 +- packages/secret-scan/package.json | 4 +- packages/secret-scan/src/rules/age.ts | 12 +- packages/secret-scan/src/rules/airtable.ts | 2 +- packages/secret-scan/src/rules/asana.ts | 48 ++--- packages/secret-scan/src/rules/atlassian.ts | 112 +++++------ packages/secret-scan/src/rules/authress.ts | 180 +++++++++--------- packages/secret-scan/src/rules/beamer.ts | 58 +++--- packages/secret-scan/src/rules/bitbucket.ts | 42 ++-- packages/secret-scan/src/rules/bittrex.ts | 8 +- packages/secret-scan/src/rules/clojars.ts | 61 +++--- packages/secret-scan/src/rules/cloudflare.ts | 123 ++++++------ packages/secret-scan/src/rules/codecov.ts | 12 +- packages/secret-scan/src/rules/coinbase.ts | 59 +++--- packages/secret-scan/src/rules/confluent.ts | 96 +++++----- packages/secret-scan/src/rules/contentful.ts | 60 +++--- packages/secret-scan/src/rules/databricks.ts | 60 +++--- packages/secret-scan/src/rules/datadog.ts | 60 +++--- .../src/rules/definednetworking.ts | 71 +++---- .../secret-scan/src/rules/digitalocean.ts | 73 +++---- packages/secret-scan/src/rules/doppler.ts | 66 +++---- packages/secret-scan/src/rules/dropbox.ts | 71 +++---- packages/secret-scan/src/rules/duffel.ts | 66 +++---- packages/secret-scan/src/rules/dynatrace.ts | 69 +++---- packages/secret-scan/src/rules/easypost.ts | 68 +++---- packages/secret-scan/src/rules/facebook.ts | 86 +++++---- packages/secret-scan/src/rules/flutterwave.ts | 62 +++--- packages/secret-scan/src/rules/frameio.ts | 69 +++---- packages/secret-scan/src/rules/gitlab.ts | 78 ++++---- packages/secret-scan/src/rules/grafana.ts | 157 +++++++-------- packages/secret-scan/src/rules/harness.ts | 88 +++++---- packages/secret-scan/src/rules/hashicorp.ts | 38 ++-- packages/secret-scan/src/rules/heroku.ts | 60 +++--- packages/secret-scan/src/rules/hubspot.ts | 60 +++--- packages/secret-scan/src/rules/huggingface.ts | 64 +++---- packages/secret-scan/src/rules/index.ts | 46 ++--- packages/secret-scan/src/rules/infracost.ts | 44 ++--- packages/secret-scan/src/rules/intra42.ts | 63 +++--- packages/secret-scan/src/rules/linear.ts | 44 ++--- packages/secret-scan/src/rules/lob.ts | 60 +++--- packages/secret-scan/src/rules/planetscale.ts | 69 +++---- packages/secret-scan/src/rules/postman.ts | 44 ++--- packages/secret-scan/src/rules/prefect.ts | 44 ++--- packages/secret-scan/src/rules/pulumi.ts | 44 ++--- packages/secret-scan/src/rules/readme.ts | 46 ++--- packages/secret-scan/src/rules/rubygems.ts | 44 ++--- packages/secret-scan/src/rules/scalingo.ts | 44 ++--- packages/secret-scan/src/rules/sendinblue.ts | 46 ++--- packages/secret-scan/src/rules/shippo.ts | 44 ++--- packages/secret-scan/src/rules/shopify.ts | 88 ++++----- packages/secret-scan/src/rules/sidekiq.ts | 49 ++--- 54 files changed, 1576 insertions(+), 1514 deletions(-) diff --git a/apps/cli/src/commands/environment/create.environment.ts b/apps/cli/src/commands/environment/create.environment.ts index 504a1864..87a4a97c 100644 --- a/apps/cli/src/commands/environment/create.environment.ts +++ b/apps/cli/src/commands/environment/create.environment.ts @@ -56,10 +56,8 @@ export class CreateEnvironment extends BaseCommand { data: environment, error, success - } = await ControllerInstance - .getInstance() - .environmentController.createEnvironment( - {name, description, projectSlug}, + } = await ControllerInstance.getInstance().environmentController.createEnvironment( + { name, description, projectSlug }, this.headers ) diff --git a/apps/cli/src/commands/environment/delete.environment.ts b/apps/cli/src/commands/environment/delete.environment.ts index 71d2db22..34cce544 100644 --- a/apps/cli/src/commands/environment/delete.environment.ts +++ b/apps/cli/src/commands/environment/delete.environment.ts @@ -34,12 +34,11 @@ export class DeleteEnvironment extends BaseCommand { Logger.info('Deleting Environment...') - const { success, error } = await ControllerInstance - .getInstance() - .environmentController.deleteEnvironment( - { id: environmentId }, - this.headers - ) + const { success, error } = + await ControllerInstance.getInstance().environmentController.deleteEnvironment( + { id: environmentId }, + this.headers + ) if (success) { Logger.info('Environment deleted successfully') diff --git a/apps/cli/src/commands/environment/update.environment.ts b/apps/cli/src/commands/environment/update.environment.ts index 239cf2b9..fde63f4c 100644 --- a/apps/cli/src/commands/environment/update.environment.ts +++ b/apps/cli/src/commands/environment/update.environment.ts @@ -55,10 +55,8 @@ export class UpdateEnvironment extends BaseCommand { success, error, data: environment - } = await ControllerInstance - .getInstance(). - environmentController.updateEnvironment( - {name, description, slug: environmentSlug}, + } = await ControllerInstance.getInstance().environmentController.updateEnvironment( + { name, description, slug: environmentSlug }, this.headers ) diff --git a/apps/web/src/components/hero/index.tsx b/apps/web/src/components/hero/index.tsx index 8159e87a..bb4cc14b 100644 --- a/apps/web/src/components/hero/index.tsx +++ b/apps/web/src/components/hero/index.tsx @@ -44,9 +44,8 @@ function Hero(): React.JSX.Element { launch

- )) - setEmail(''); - + )) + setEmail('') } catch (error) { // eslint-disable-next-line no-console -- chill console.error(error) diff --git a/packages/secret-scan/package.json b/packages/secret-scan/package.json index d8405298..6d5d0583 100644 --- a/packages/secret-scan/package.json +++ b/packages/secret-scan/package.json @@ -6,7 +6,9 @@ "scripts": { "genKey": "tsx src/generateKey.ts", "build": "tsup", - "test": "mocha" + "test": "mocha", + "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", + "lint": "eslint \"{src,tests}/**/*.ts\" --fix" }, "publishConfig": { "access": "public" diff --git a/packages/secret-scan/src/rules/age.ts b/packages/secret-scan/src/rules/age.ts index 5670040f..b8490f90 100644 --- a/packages/secret-scan/src/rules/age.ts +++ b/packages/secret-scan/src/rules/age.ts @@ -10,11 +10,13 @@ export default function age(): RegExp[] { const testcase: TestCase[] = [ { - input: 'AGE-SECRET-KEY-17TWAXMPDQAJV0RH43E5FJH5F0LUTFR3JTCM999XEF70QA57SZGXFJ3NQZK', + input: + 'AGE-SECRET-KEY-17TWAXMPDQAJV0RH43E5FJH5F0LUTFR3JTCM999XEF70QA57SZGXFJ3NQZK', expected: true }, { - input: 'AGE-SECRET-KEY-1QZRY9X8GF2TVDW0S3JN54KHCE6MUA7L1QZRY9X8GF2TVDW0S3JN54KHCE6MUA7L1QZRY9X8GF2TVDW0S3JN54KHCE6MUA7L', + input: + 'AGE-SECRET-KEY-1QZRY9X8GF2TVDW0S3JN54KHCE6MUA7L1QZRY9X8GF2TVDW0S3JN54KHCE6MUA7L1QZRY9X8GF2TVDW0S3JN54KHCE6MUA7L', expected: false }, { @@ -22,13 +24,13 @@ const testcase: TestCase[] = [ expected: false }, { - input: "AGE-SECRET-KEY", + input: 'AGE-SECRET-KEY', expected: false }, { - input: "AGE", + input: 'AGE', expected: false } ] -age.testcases = testcase \ No newline at end of file +age.testcases = testcase diff --git a/packages/secret-scan/src/rules/airtable.ts b/packages/secret-scan/src/rules/airtable.ts index 6580cc6a..bb777498 100644 --- a/packages/secret-scan/src/rules/airtable.ts +++ b/packages/secret-scan/src/rules/airtable.ts @@ -31,4 +31,4 @@ const testcase: TestCase[] = [ } ] -airtable.testcases = testcase \ No newline at end of file +airtable.testcases = testcase diff --git a/packages/secret-scan/src/rules/asana.ts b/packages/secret-scan/src/rules/asana.ts index 89f37def..36135aca 100644 --- a/packages/secret-scan/src/rules/asana.ts +++ b/packages/secret-scan/src/rules/asana.ts @@ -2,33 +2,33 @@ import type { TestCase } from '@/types' export default function asana(): RegExp[] { - return [ - // Asana API key regex - /asana(?:[0-9]{16}|[a-zA-Z0-9]{32})/i - ] + return [ + // Asana API key regex + /asana(?:[0-9]{16}|[a-zA-Z0-9]{32})/i + ] } const testcase: TestCase[] = [ - { - input: 'asana7127506407697088', - expected: true - }, - { - input: 'asanauqojiVXgDOUXY33pSof0IHG0wQAInfRX', - expected: true - }, - { - input: 'asana', - expected: false - }, - { - input: 'asana123', - expected: false - }, - { - input: 'asanahsdiu3nniwoien', - expected: false - } + { + input: 'asana7127506407697088', + expected: true + }, + { + input: 'asanauqojiVXgDOUXY33pSof0IHG0wQAInfRX', + expected: true + }, + { + input: 'asana', + expected: false + }, + { + input: 'asana123', + expected: false + }, + { + input: 'asanahsdiu3nniwoien', + expected: false + } ] asana.testcases = testcase diff --git a/packages/secret-scan/src/rules/atlassian.ts b/packages/secret-scan/src/rules/atlassian.ts index eb17af6a..cbf56a81 100644 --- a/packages/secret-scan/src/rules/atlassian.ts +++ b/packages/secret-scan/src/rules/atlassian.ts @@ -2,65 +2,65 @@ import type { TestCase } from '@/types' export default function atlassian(): RegExp[] { - return [ - // Atlassian API key starts with atlassian, confluence and jira - /(?:atlassian|confluence|jira)[a-zA-Z0-9]{24}/i - ] + return [ + // Atlassian API key starts with atlassian, confluence and jira + /(?:atlassian|confluence|jira)[a-zA-Z0-9]{24}/i + ] } const testcase: TestCase[] = [ - { - input: 'confluenceojqhLdXTkuq6evzHPAxG4Gec', - expected: true - }, - { - input: 'jirai2rfog2lrLrchssWRvvqcAak', - expected: true - }, - { - input: 'jiraStCBHh8bkPREl880xgj2c5Pr', - expected: true - }, - { - input: 'atlassianruJGQgh186T1VsJj92Zevl4g', - expected: true - }, - { - input: 'confluencePVupYYBa4jwjTLGPbH0uc6re', - expected: true - }, - { - input: 'atlassianfokyIISToCvOLu37Ghwgmg9B', - expected: true - }, - { - input: 'confluencebzql7VAKbEZIa4sPHe9oAd8x', - expected: true - }, - { - input: 'jiraYEsx1YgYlJhx7PZWiL45BnuP', - expected: true - }, - { - input: 'jiraZsWvU6UYKj40x1JT7L8k3kFS', - expected: true - }, - { - input: 'confluence27GqJEFNkhUqkNLti86QUBX0', - expected: true - }, - { - input: 'atlassian', - expected: false - }, - { - input: 'confluence', - expected: false - }, - { - input: 'jira', - expected: false - } + { + input: 'confluenceojqhLdXTkuq6evzHPAxG4Gec', + expected: true + }, + { + input: 'jirai2rfog2lrLrchssWRvvqcAak', + expected: true + }, + { + input: 'jiraStCBHh8bkPREl880xgj2c5Pr', + expected: true + }, + { + input: 'atlassianruJGQgh186T1VsJj92Zevl4g', + expected: true + }, + { + input: 'confluencePVupYYBa4jwjTLGPbH0uc6re', + expected: true + }, + { + input: 'atlassianfokyIISToCvOLu37Ghwgmg9B', + expected: true + }, + { + input: 'confluencebzql7VAKbEZIa4sPHe9oAd8x', + expected: true + }, + { + input: 'jiraYEsx1YgYlJhx7PZWiL45BnuP', + expected: true + }, + { + input: 'jiraZsWvU6UYKj40x1JT7L8k3kFS', + expected: true + }, + { + input: 'confluence27GqJEFNkhUqkNLti86QUBX0', + expected: true + }, + { + input: 'atlassian', + expected: false + }, + { + input: 'confluence', + expected: false + }, + { + input: 'jira', + expected: false + } ] atlassian.testcases = testcase diff --git a/packages/secret-scan/src/rules/authress.ts b/packages/secret-scan/src/rules/authress.ts index eb9ecb1d..35d23c53 100644 --- a/packages/secret-scan/src/rules/authress.ts +++ b/packages/secret-scan/src/rules/authress.ts @@ -2,97 +2,107 @@ import type { TestCase } from '@/types' export default function authress(): RegExp[] { - /* + /* Authress API key regex reference: https://authress.io/knowledge-base/docs/authorization/service-clients/secrets-scanning/#1-detection */ - return [ - /(?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\.[a-z0-9]{4,6}\.acc[_-][a-z0-9-]{10,32}\.[a-z0-9+/_=-]{30,120}/i - ] + return [ + /(?:sc|ext|scauth|authress)_[a-z0-9]{5,30}\.[a-z0-9]{4,6}\.acc[_-][a-z0-9-]{10,32}\.[a-z0-9+/_=-]{30,120}/i + ] } const testcase: TestCase[] = [ - { - input: 'authress_cq4l7vgvljx.qaby.acc_lakpdsidyhj8vax65r.o-c+4qkjwxphlw127i61yx2=b80_i5ntl4-v6msljbe3byg-qrclhj+z8xi4/7k44eggxhq3s/xhqq_gebbcn30', - expected: true - }, - { - input: 'ext_0pvh07lxyp5.27xvn.acc_36z1ljwo-a.w5i8+a44eldg/rpwftte0lbz65w+1/iv03rh34806avq912hi=k36bihcwip55uizytt8tumzw-eri+a/8-/70_y', - expected: true - }, - { - input: 'authress_eu61hvi5ya0blyssax3o8d3jo.t0v24.acc-l1w7hnjpehqhpab5lhkb.hkgj6q57tiwfo-k_2j-nxs4twnn6vhfmj9qiusk', - expected: true - }, - { - input: 'sc_m2ue9panmg89f65xox6tzy.pu3q.acc_rtzskra-wa061t-0cyic9st.a1m/87ffz8f1bjg8-esv0b3gciyskefl', - expected: true - }, - { - input: 'authress_xme04dm9jxknhtsm8rtjbqkdbbe.wp0zo.acc_r3yvcifffw21nrzivzut.z5ks9/wem41yup21c7-w4_d4rcnvdm/n=+yi+ipoxszw1+6_qtgg_tl8/9ac8tv6+d', - expected: true - }, - { - input: 'ext_jovb0t8eio0g9i.b6c3.acc-5ys8gxhc4966u3i3d2kszi7dkdim.kvm=9=06068=375id3p8kq8kq8b-m9k', - expected: true - }, - { - input: 'ext_k7vh1dqads9bwz.w2do38.acc_4d3l3c9l42xgjmponm4t.nd6qlsi7gl/k1gli3f7osbrhwwa0_bdgiiybg7iijfg+5589fqdfgv-', - expected: true - }, - { - input: 'scauth_11hawttghpfqac8etxwupjo26bb9q.tr6i.acc_kw7ot9unhg65f.d-=60z7ugbdh=cv5m5av-ug0gunbrvfz8ls484v_w97sser2bss6x/xu8s0zoa7ly-kn994ifj_ktebwd2z6_5y3/5w7ujgb7k=_', - expected: true - }, - { - input: 'ext_hsxf9loqwm6gcagmsa3bd5f9.wtadhc.acc_c--dx75fnms1htfw03.s_bck7=37a__7y9uqruz4uwl3-jw3s4o50hhsqmkair+9/6ny3bczw0mn/vadmv_mwo9a/2k_xlkfso1k6j61fzp59b_utpj2', - expected: true - }, - { - input: 'scauth_ol3j5c7k.ur8aox.acc_8uxa-qc1-03ny3dd3mp8l0be.yy0ulnk0s9=13h2q934zdptue9mw4jlic1su8u2q8+4drjz3=1ot', - expected: true - }, - { - input: 'authress_invalid_key', - expected: false - }, - { - input: 'ext_12345.invalid.acc_1234567890.invalid', - expected: false - }, - { - input: 'scauth_12345.1234.acc_1234567890.1234567890', - expected: false - }, - { - input: 'sc_12345.1234.acc_1234567890.1234567890', - expected: false - }, - { - input: 'authress_12345.1234.acc_1234567890.1234567890', - expected: false - }, - { - input: 'ext_12345.1234.acc_1234567890.1234567890', - expected: false - }, - { - input: 'scauth_12345.1234.acc_1234567890.1234567890', - expected: false - }, - { - input: 'authress_12345.1234.acc_1234567890.1234567890', - expected: false - }, - { - input: 'ext_12345.1234.acc_1234567890.1234567890', - expected: false - }, - { - input: 'scauth_12345.1234.acc_1234567890.1234567890', - expected: false - } + { + input: + 'authress_cq4l7vgvljx.qaby.acc_lakpdsidyhj8vax65r.o-c+4qkjwxphlw127i61yx2=b80_i5ntl4-v6msljbe3byg-qrclhj+z8xi4/7k44eggxhq3s/xhqq_gebbcn30', + expected: true + }, + { + input: + 'ext_0pvh07lxyp5.27xvn.acc_36z1ljwo-a.w5i8+a44eldg/rpwftte0lbz65w+1/iv03rh34806avq912hi=k36bihcwip55uizytt8tumzw-eri+a/8-/70_y', + expected: true + }, + { + input: + 'authress_eu61hvi5ya0blyssax3o8d3jo.t0v24.acc-l1w7hnjpehqhpab5lhkb.hkgj6q57tiwfo-k_2j-nxs4twnn6vhfmj9qiusk', + expected: true + }, + { + input: + 'sc_m2ue9panmg89f65xox6tzy.pu3q.acc_rtzskra-wa061t-0cyic9st.a1m/87ffz8f1bjg8-esv0b3gciyskefl', + expected: true + }, + { + input: + 'authress_xme04dm9jxknhtsm8rtjbqkdbbe.wp0zo.acc_r3yvcifffw21nrzivzut.z5ks9/wem41yup21c7-w4_d4rcnvdm/n=+yi+ipoxszw1+6_qtgg_tl8/9ac8tv6+d', + expected: true + }, + { + input: + 'ext_jovb0t8eio0g9i.b6c3.acc-5ys8gxhc4966u3i3d2kszi7dkdim.kvm=9=06068=375id3p8kq8kq8b-m9k', + expected: true + }, + { + input: + 'ext_k7vh1dqads9bwz.w2do38.acc_4d3l3c9l42xgjmponm4t.nd6qlsi7gl/k1gli3f7osbrhwwa0_bdgiiybg7iijfg+5589fqdfgv-', + expected: true + }, + { + input: + 'scauth_11hawttghpfqac8etxwupjo26bb9q.tr6i.acc_kw7ot9unhg65f.d-=60z7ugbdh=cv5m5av-ug0gunbrvfz8ls484v_w97sser2bss6x/xu8s0zoa7ly-kn994ifj_ktebwd2z6_5y3/5w7ujgb7k=_', + expected: true + }, + { + input: + 'ext_hsxf9loqwm6gcagmsa3bd5f9.wtadhc.acc_c--dx75fnms1htfw03.s_bck7=37a__7y9uqruz4uwl3-jw3s4o50hhsqmkair+9/6ny3bczw0mn/vadmv_mwo9a/2k_xlkfso1k6j61fzp59b_utpj2', + expected: true + }, + { + input: + 'scauth_ol3j5c7k.ur8aox.acc_8uxa-qc1-03ny3dd3mp8l0be.yy0ulnk0s9=13h2q934zdptue9mw4jlic1su8u2q8+4drjz3=1ot', + expected: true + }, + { + input: 'authress_invalid_key', + expected: false + }, + { + input: 'ext_12345.invalid.acc_1234567890.invalid', + expected: false + }, + { + input: 'scauth_12345.1234.acc_1234567890.1234567890', + expected: false + }, + { + input: 'sc_12345.1234.acc_1234567890.1234567890', + expected: false + }, + { + input: 'authress_12345.1234.acc_1234567890.1234567890', + expected: false + }, + { + input: 'ext_12345.1234.acc_1234567890.1234567890', + expected: false + }, + { + input: 'scauth_12345.1234.acc_1234567890.1234567890', + expected: false + }, + { + input: 'authress_12345.1234.acc_1234567890.1234567890', + expected: false + }, + { + input: 'ext_12345.1234.acc_1234567890.1234567890', + expected: false + }, + { + input: 'scauth_12345.1234.acc_1234567890.1234567890', + expected: false + } ] -authress.testcases = testcase \ No newline at end of file +authress.testcases = testcase diff --git a/packages/secret-scan/src/rules/beamer.ts b/packages/secret-scan/src/rules/beamer.ts index bc8e03ac..e6d8b06b 100644 --- a/packages/secret-scan/src/rules/beamer.ts +++ b/packages/secret-scan/src/rules/beamer.ts @@ -2,37 +2,37 @@ import type { TestCase } from '@/types' export default function beamer(): RegExp[] { - return [ - // Beamer API key regex - /b_[a-z0-9=_\-]{44}/i - ] + return [ + // Beamer API key regex + /b_[a-z0-9=_\-]{44}/i + ] } const testcase: TestCase[] = [ - { - input: 'b_m8lv5nnp021yblkx7y_1vbcb2anqlsh_rkn4i2chhl0r', - expected: true - }, - { - input: 'b_u9b1=i7pmk7w7_hsqkj_tse4k8y260x34709dipjp9tt', - expected: true - }, - { - input: 'b_0pm01o0ypb0p76uul9w07q8zzae-6iytk3p4kejlsxza', - expected: true - }, - { - input: 'beamer_0pm01o0ypb0p76uul9w07q8zzae-6iytk3p4kejlsxza', - expected: false - }, - { - input: 'beamereerrrereerrrrere', - expected: false - }, - { - input: 'b_', - expected: false - } + { + input: 'b_m8lv5nnp021yblkx7y_1vbcb2anqlsh_rkn4i2chhl0r', + expected: true + }, + { + input: 'b_u9b1=i7pmk7w7_hsqkj_tse4k8y260x34709dipjp9tt', + expected: true + }, + { + input: 'b_0pm01o0ypb0p76uul9w07q8zzae-6iytk3p4kejlsxza', + expected: true + }, + { + input: 'beamer_0pm01o0ypb0p76uul9w07q8zzae-6iytk3p4kejlsxza', + expected: false + }, + { + input: 'beamereerrrereerrrrere', + expected: false + }, + { + input: 'b_', + expected: false + } ] -beamer.testcases = testcase \ No newline at end of file +beamer.testcases = testcase diff --git a/packages/secret-scan/src/rules/bitbucket.ts b/packages/secret-scan/src/rules/bitbucket.ts index 064c1bef..5fcbe083 100644 --- a/packages/secret-scan/src/rules/bitbucket.ts +++ b/packages/secret-scan/src/rules/bitbucket.ts @@ -2,10 +2,10 @@ import type { TestCase } from '@/types' export default function bitbucket(): RegExp[] { - return [ - // BitBucket key regex - /bitbucket[a-zA-Z0-9]{32}|bitbucket[a-zA-Z0-9=_\-]{64}/i - ] + return [ + // BitBucket key regex + /bitbucket[a-zA-Z0-9]{32}|bitbucket[a-zA-Z0-9=_\-]{64}/i + ] } const testcase: TestCase[] = [ @@ -14,23 +14,28 @@ const testcase: TestCase[] = [ expected: true }, { - input: 'bitbucketI8rtKWnU-hHJuFNaY_cVrPlFulcTFQT=qYwSXLwW9-69XzdR1ivUSmtop1b6mrCX', + input: + 'bitbucketI8rtKWnU-hHJuFNaY_cVrPlFulcTFQT=qYwSXLwW9-69XzdR1ivUSmtop1b6mrCX', expected: true }, { - input: 'bitbucketOi=XuIk3yALKtwdNMJBoyaG3nJ0AQDL5Hr-9bN9eh0J_W4818YHGIPLWCu3TVYyB', + input: + 'bitbucketOi=XuIk3yALKtwdNMJBoyaG3nJ0AQDL5Hr-9bN9eh0J_W4818YHGIPLWCu3TVYyB', expected: true }, { - input: 'bitbuckete7fg_=_gOBjbbqJgDGDWyUG8e38a2StbEvllkc6d3_QxKAYdcq5EVZTY4TANrAkw', + input: + 'bitbuckete7fg_=_gOBjbbqJgDGDWyUG8e38a2StbEvllkc6d3_QxKAYdcq5EVZTY4TANrAkw', expected: true }, { - input: 'bitbucket1TNov1LIYBgHTwLzvjQSByUV5Xux3mFZWO38dwIHy98l_5EfAIVB=AHVzQiKyG4Z', + input: + 'bitbucket1TNov1LIYBgHTwLzvjQSByUV5Xux3mFZWO38dwIHy98l_5EfAIVB=AHVzQiKyG4Z', expected: true }, { - input: 'bitbucketAyBGxwkWYcb26PxsNSAu5siG5XT=Jgb__FDPVxC-PCAJT2T57YqhkvWRjKKxALwi', + input: + 'bitbucketAyBGxwkWYcb26PxsNSAu5siG5XT=Jgb__FDPVxC-PCAJT2T57YqhkvWRjKKxALwi', expected: true }, { @@ -38,7 +43,8 @@ const testcase: TestCase[] = [ expected: true }, { - input: 'bitbucket1O_2D5VrXBcD-IEOyBn_KvAUYuKFxHYMEjlBf9l1pJS=27KlFUPWVD1eQ9eOwJw5', + input: + 'bitbucket1O_2D5VrXBcD-IEOyBn_KvAUYuKFxHYMEjlBf9l1pJS=27KlFUPWVD1eQ9eOwJw5', expected: true }, { @@ -49,14 +55,14 @@ const testcase: TestCase[] = [ input: 'bitbucketRSsSg2xwRDgT4PjJXMA5mJgfQKG8Z6lT', expected: true }, - { - input: 'bitbucket2343283kjsgdfj', - expected: false - }, - { - input: 'bitbucket', - expected: false - } + { + input: 'bitbucket2343283kjsgdfj', + expected: false + }, + { + input: 'bitbucket', + expected: false + } ] bitbucket.testcases = testcase diff --git a/packages/secret-scan/src/rules/bittrex.ts b/packages/secret-scan/src/rules/bittrex.ts index 6307eb01..a02686df 100644 --- a/packages/secret-scan/src/rules/bittrex.ts +++ b/packages/secret-scan/src/rules/bittrex.ts @@ -2,10 +2,10 @@ import type { TestCase } from '@/types' export default function bittrex(): RegExp[] { - return [ - // Bittrex key regex - /bittrex[a-zA-Z0-9]{32}/i - ] + return [ + // Bittrex key regex + /bittrex[a-zA-Z0-9]{32}/i + ] } const testcase: TestCase[] = [ diff --git a/packages/secret-scan/src/rules/clojars.ts b/packages/secret-scan/src/rules/clojars.ts index c860bed3..cb99f435 100644 --- a/packages/secret-scan/src/rules/clojars.ts +++ b/packages/secret-scan/src/rules/clojars.ts @@ -2,37 +2,40 @@ import type { TestCase } from '@/types' export default function clojars(): RegExp[] { - return [ - // Clojars key regex - /CLOJARS_[a-z0-9]{60}/i - ] + return [ + // Clojars key regex + /CLOJARS_[a-z0-9]{60}/i + ] } const testcase: TestCase[] = [ - { - input: 'CLOJARS_j6qt9h47zes979orwhr7fk8fhm1wdwwkefd1lm1tf0z8tly3l434quseqq7r', - expected: true - }, - { - input: 'CLOJARS_e0t9cba83kvg9fh1toqt5euuppqh6lz4dsk3xocd00vc2n58q400ez34uuzr', - expected: true - }, - { - input: 'CLOJARS_juyzrsdpxlmiqwsjemyudcdh63dll3wlluatf51zeb6s8oj7y9uhnkive91j', - expected: true - }, - { - input: 'closure27bdubysrbf348yb23-sbdufbsj8983rhy', - expected: false - }, - { - input: 'clojars', - expected: false - }, - { - input: 'closure', - expected: false - } + { + input: + 'CLOJARS_j6qt9h47zes979orwhr7fk8fhm1wdwwkefd1lm1tf0z8tly3l434quseqq7r', + expected: true + }, + { + input: + 'CLOJARS_e0t9cba83kvg9fh1toqt5euuppqh6lz4dsk3xocd00vc2n58q400ez34uuzr', + expected: true + }, + { + input: + 'CLOJARS_juyzrsdpxlmiqwsjemyudcdh63dll3wlluatf51zeb6s8oj7y9uhnkive91j', + expected: true + }, + { + input: 'closure27bdubysrbf348yb23-sbdufbsj8983rhy', + expected: false + }, + { + input: 'clojars', + expected: false + }, + { + input: 'closure', + expected: false + } ] -clojars.testcases = testcase \ No newline at end of file +clojars.testcases = testcase diff --git a/packages/secret-scan/src/rules/cloudflare.ts b/packages/secret-scan/src/rules/cloudflare.ts index 0f9cdeed..4377f2ec 100644 --- a/packages/secret-scan/src/rules/cloudflare.ts +++ b/packages/secret-scan/src/rules/cloudflare.ts @@ -1,70 +1,73 @@ // keyshade-ignore-all -//TODO: Fix this regex, it's breaking almost other rules +// TODO: Fix this regex, it's breaking almost other rules import type { TestCase } from '@/types' export default function cloudflare(): RegExp[] { - /* - * It covers three keys - * 1. CLOUDFLARE_GLOBAL_API_KEY - * 2. CLOUDFLARE_API_KEY - * 3. CLOUDFLARE_ORIGIN_CA - * */ - return [ - // Cloudflare key regex - /(?:[a-z0-9]{37}|[a-zA-Z0-9=_\-]{40}|v1\.0-[a-f0-9]{24}-[a-f0-9]{146})/i - ] + /* + * It covers three keys + * 1. CLOUDFLARE_GLOBAL_API_KEY + * 2. CLOUDFLARE_API_KEY + * 3. CLOUDFLARE_ORIGIN_CA + * */ + return [ + // Cloudflare key regex + /(?:[a-z0-9]{37}|[a-zA-Z0-9=_\-]{40}|v1\.0-[a-f0-9]{24}-[a-f0-9]{146})/i + ] } const testcase: TestCase[] = [ - { - input: 'bXuvOa1eAdlEhLcdwb30p3ypndgekbi8a2X2jqqo', - expected: true - }, - { - input: '5p7tz9ttp5whouvauplfl2w46iusgu17yw9k7', - expected: true - }, - { - input: 'v1.0-d9fb3ee37d05dc93c20517cb-0a18e97249c3d60d8654a94361a4b22272f0fdfca7d5238b319844a522929b878286e10fc117346650476342d6c585f2d215ad22153bcb9b0a65269823db7dc2b478773e998cc58015', - expected: true - }, - { - input: '6v2uj0uq3vk2k1v3xeb5xjqkzmy7h5tmbrene', - expected: true - }, - { - input: 'v1.0-f7a670bb0f7de7e321da97ad-1d267bba798374e71ee0172a2c375325147f8c92da44a078fe82d431bfb2a329ce82e50bff94cec987c56a363af69dc08d175090a9ce4dd949af63ab75515e5acba1870a154eb3108b', - expected: true - }, - { - input: 'q7l080tpm9bqgo1crrfczvvul1tcn0sktliry', - expected: true - }, - { - input: 'c2357643gjhdwgufjebsaiydfjkdsyufkefsdfjdsgkfgegfuefjhgeufjewbfewhvfhgfygeygfyu7ndvsgfjsevfvsdjfjvfvhgwghvejsuvuisdgfhvjffsdbfhgfhsberhwegurggefjvwefhrenbuy8er8u8uworu9euw9herhfbuyegfbsggehgerhiyerhrbhiwpwoerueh83u20--13u3r982834yreufy9p2--213883hr73230u201239ui3482hih2y4h', - expected: false - }, - { - input: 'ca', - expected: false - }, - { - input: 'CLOUDFLARE_GLOBAL_API_KEY', - expected: false - }, - { - input: 'CLOUDFLARE_API_KEY', - expected: false - }, - { - input: 'CLOUDFLARE_ORIGIN_CA', - expected: false - }, - { - input: 'CLOUDFLARE', - expected: false - } + { + input: 'bXuvOa1eAdlEhLcdwb30p3ypndgekbi8a2X2jqqo', + expected: true + }, + { + input: '5p7tz9ttp5whouvauplfl2w46iusgu17yw9k7', + expected: true + }, + { + input: + 'v1.0-d9fb3ee37d05dc93c20517cb-0a18e97249c3d60d8654a94361a4b22272f0fdfca7d5238b319844a522929b878286e10fc117346650476342d6c585f2d215ad22153bcb9b0a65269823db7dc2b478773e998cc58015', + expected: true + }, + { + input: '6v2uj0uq3vk2k1v3xeb5xjqkzmy7h5tmbrene', + expected: true + }, + { + input: + 'v1.0-f7a670bb0f7de7e321da97ad-1d267bba798374e71ee0172a2c375325147f8c92da44a078fe82d431bfb2a329ce82e50bff94cec987c56a363af69dc08d175090a9ce4dd949af63ab75515e5acba1870a154eb3108b', + expected: true + }, + { + input: 'q7l080tpm9bqgo1crrfczvvul1tcn0sktliry', + expected: true + }, + { + input: + 'c2357643gjhdwgufjebsaiydfjkdsyufkefsdfjdsgkfgegfuefjhgeufjewbfewhvfhgfygeygfyu7ndvsgfjsevfvsdjfjvfvhgwghvejsuvuisdgfhvjffsdbfhgfhsberhwegurggefjvwefhrenbuy8er8u8uworu9euw9herhfbuyegfbsggehgerhiyerhrbhiwpwoerueh83u20--13u3r982834yreufy9p2--213883hr73230u201239ui3482hih2y4h', + expected: false + }, + { + input: 'ca', + expected: false + }, + { + input: 'CLOUDFLARE_GLOBAL_API_KEY', + expected: false + }, + { + input: 'CLOUDFLARE_API_KEY', + expected: false + }, + { + input: 'CLOUDFLARE_ORIGIN_CA', + expected: false + }, + { + input: 'CLOUDFLARE', + expected: false + } ] -cloudflare.testcases = testcase \ No newline at end of file +cloudflare.testcases = testcase diff --git a/packages/secret-scan/src/rules/codecov.ts b/packages/secret-scan/src/rules/codecov.ts index e0d183e1..eecec946 100644 --- a/packages/secret-scan/src/rules/codecov.ts +++ b/packages/secret-scan/src/rules/codecov.ts @@ -1,11 +1,11 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function codecov(): RegExp[] { - return [ - // Codecov key regex - /codecov[a-zA-Z0-9]{32}/i - ] + return [ + // Codecov key regex + /codecov[a-zA-Z0-9]{32}/i + ] } const testcase: TestCase[] = [ @@ -35,4 +35,4 @@ const testcase: TestCase[] = [ } ] -codecov.testcases = testcase \ No newline at end of file +codecov.testcases = testcase diff --git a/packages/secret-scan/src/rules/coinbase.ts b/packages/secret-scan/src/rules/coinbase.ts index 0d0c7ff9..bd5bf073 100644 --- a/packages/secret-scan/src/rules/coinbase.ts +++ b/packages/secret-scan/src/rules/coinbase.ts @@ -1,37 +1,38 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function coinbase(): RegExp[] { - return [ - /coinbase[a-zA-Z0-9=_\-]{64}/i - ] + return [/coinbase[a-zA-Z0-9=_\-]{64}/i] } const testcase: TestCase[] = [ - { - input: 'coinbase6-xXTZ5MlBlJsQtO9FhPYeRKelvoxhP5rTzfHsmL0aoJL32XFnL-SDKK142FoXMn', - expected: true - }, - { - input: 'coinbasev17P-2zbH=sG0DOhjOeM5AssQdss26wFpKl1jDj0avwk7E99YyJsdVU_cADE6ef3', - expected: true - }, - { - input: 'coinbase-ilgKJfRqc_EJoPgyWpwGeW-nQZ-U0hHiWxmi7H78KIYI=-OlBH0Yc1pSuB-i5tX', - expected: true - }, - { - input: 'coinbase-ilgKJfRqc_EJo-OlBH0Yc1pSuB-i5tX0pm01o0ypblsxza', - expected: false - }, - { - input: 'const = COINBASE_API_KEY', - expected: false - }, - { - input: 'coinbase', - expected: false - } + { + input: + 'coinbase6-xXTZ5MlBlJsQtO9FhPYeRKelvoxhP5rTzfHsmL0aoJL32XFnL-SDKK142FoXMn', + expected: true + }, + { + input: + 'coinbasev17P-2zbH=sG0DOhjOeM5AssQdss26wFpKl1jDj0avwk7E99YyJsdVU_cADE6ef3', + expected: true + }, + { + input: + 'coinbase-ilgKJfRqc_EJoPgyWpwGeW-nQZ-U0hHiWxmi7H78KIYI=-OlBH0Yc1pSuB-i5tX', + expected: true + }, + { + input: 'coinbase-ilgKJfRqc_EJo-OlBH0Yc1pSuB-i5tX0pm01o0ypblsxza', + expected: false + }, + { + input: 'const = COINBASE_API_KEY', + expected: false + }, + { + input: 'coinbase', + expected: false + } ] -coinbase.testcases = testcase \ No newline at end of file +coinbase.testcases = testcase diff --git a/packages/secret-scan/src/rules/confluent.ts b/packages/secret-scan/src/rules/confluent.ts index 3997e0a7..9721689a 100644 --- a/packages/secret-scan/src/rules/confluent.ts +++ b/packages/secret-scan/src/rules/confluent.ts @@ -1,54 +1,58 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function confluent(): RegExp[] { - return [ - /confluent[a-zA-Z0-9]{64}/i, //Confluent Secret Key regex - /confluent[a-zA-Z0-9]{16}/i //Confluent Access Key Regex - ] + return [ + /confluent[a-zA-Z0-9]{64}/i, // Confluent Secret Key regex + /confluent[a-zA-Z0-9]{16}/i // Confluent Access Key Regex + ] } const testcase: TestCase[] = [ - { - input: 'confluent3G5qsTebXxFLB1Kht4ryL1bAwuY5G8R3OPCFEkNfuMLCyNSoiCPvkZYsCVofnoT1', - expected: true - }, - { - input: 'confluentEjbQrUmCVHUJxkCT8ZvxPGbISq4KFfebycri6grc3XXGnzNGPHSKbAnaXdgxAT3N', - expected: true - }, - { - input: 'confluentef4FsV7WaAenQtGxvbx5hVCcpkOIRA3Ug5r3QjLPMrPjgGdqMhyMTt4PuybQYXuP', - expected: true - }, - { - input: 'confluentbz9upnD4TwQsTr0m', - expected: true - }, - { - input: 'confluentHjavJvHRIUTOoPcn', - expected: true - }, - { - input: 'confluentdJXRT8BKWWCdjuTa', - expected: true - }, - { - input: 'confluent234287*3___-347w83437@44^^2443HSYGTRHUsjfye3728rkejtye73bpsnfu3892muyy2bsuy8y34u58634', - expected: false - }, - { - input: 'const = CONFLUENT_SECRET_KEY', - expected: false - }, - { - input: 'const = CONFLUENT_ACCESS_TOKEN', - expected: false - }, - { - input: 'confluent', - expected: false - } + { + input: + 'confluent3G5qsTebXxFLB1Kht4ryL1bAwuY5G8R3OPCFEkNfuMLCyNSoiCPvkZYsCVofnoT1', + expected: true + }, + { + input: + 'confluentEjbQrUmCVHUJxkCT8ZvxPGbISq4KFfebycri6grc3XXGnzNGPHSKbAnaXdgxAT3N', + expected: true + }, + { + input: + 'confluentef4FsV7WaAenQtGxvbx5hVCcpkOIRA3Ug5r3QjLPMrPjgGdqMhyMTt4PuybQYXuP', + expected: true + }, + { + input: 'confluentbz9upnD4TwQsTr0m', + expected: true + }, + { + input: 'confluentHjavJvHRIUTOoPcn', + expected: true + }, + { + input: 'confluentdJXRT8BKWWCdjuTa', + expected: true + }, + { + input: + 'confluent234287*3___-347w83437@44^^2443HSYGTRHUsjfye3728rkejtye73bpsnfu3892muyy2bsuy8y34u58634', + expected: false + }, + { + input: 'const = CONFLUENT_SECRET_KEY', + expected: false + }, + { + input: 'const = CONFLUENT_ACCESS_TOKEN', + expected: false + }, + { + input: 'confluent', + expected: false + } ] -confluent.testcases = testcase \ No newline at end of file +confluent.testcases = testcase diff --git a/packages/secret-scan/src/rules/contentful.ts b/packages/secret-scan/src/rules/contentful.ts index a9cfb1c5..eaf282aa 100644 --- a/packages/secret-scan/src/rules/contentful.ts +++ b/packages/secret-scan/src/rules/contentful.ts @@ -1,38 +1,38 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function contentful(): RegExp[] { - return [ - // Contentful Delivery API Token regex - /contentful[a-zA-Z0-9=_\-]{43}/i - ] + return [ + // Contentful Delivery API Token regex + /contentful[a-zA-Z0-9=_\-]{43}/i + ] } const testcase: TestCase[] = [ - { - input: 'contentfulYLQU164W-BXIkhDoqd_8AS3nth7kymzPS5f018-La8F', - expected: true - }, - { - input: 'contentfulA6qqgCW=K7zSIQUiqB4nOfBfqEUvvSXMyACcpKDtQgi', - expected: true - }, - { - input: 'contentfulbk_ZN0LndzhGa1ebsdi-6dnqzOKYoUHF2TrkoT7tZBe', - expected: true - }, - { - input: 'contentfl-ilgKJfRqc_EJo-OlBH0Yc1pSuB-i5tX0pm01o0ypblsxza7299', - expected: false - }, - { - input: 'const = CONTENTFUL_DELIVERY_API_TOKEN', - expected: false - }, - { - input: 'contentful', - expected: false - } + { + input: 'contentfulYLQU164W-BXIkhDoqd_8AS3nth7kymzPS5f018-La8F', + expected: true + }, + { + input: 'contentfulA6qqgCW=K7zSIQUiqB4nOfBfqEUvvSXMyACcpKDtQgi', + expected: true + }, + { + input: 'contentfulbk_ZN0LndzhGa1ebsdi-6dnqzOKYoUHF2TrkoT7tZBe', + expected: true + }, + { + input: 'contentfl-ilgKJfRqc_EJo-OlBH0Yc1pSuB-i5tX0pm01o0ypblsxza7299', + expected: false + }, + { + input: 'const = CONTENTFUL_DELIVERY_API_TOKEN', + expected: false + }, + { + input: 'contentful', + expected: false + } ] -contentful.testcases = testcase \ No newline at end of file +contentful.testcases = testcase diff --git a/packages/secret-scan/src/rules/databricks.ts b/packages/secret-scan/src/rules/databricks.ts index 4f3f8324..bde3c510 100644 --- a/packages/secret-scan/src/rules/databricks.ts +++ b/packages/secret-scan/src/rules/databricks.ts @@ -1,38 +1,38 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function databricks(): RegExp[] { - return [ - // Databricks API Token Regex - /dapi[a-h0-9]{32}/i - ] + return [ + // Databricks API Token Regex + /dapi[a-h0-9]{32}/i + ] } const testcase: TestCase[] = [ - { - input: 'dapi9e9e452a35ah334788h284he1641ce9d', - expected: true - }, - { - input: 'dapi8ccbe94fhcfb10c1d8e3abaae92a37a3', - expected: true - }, - { - input: 'dapig35c98ghc3fg20c6cceb2b4852ghcbgb', - expected: true - }, - { - input: 'dapi', - expected: false - }, - { - input: 'const = DATABRICKS_API_KEY_TOKEN', - expected: false - }, - { - input: 'DATABRICKS', - expected: false - } + { + input: 'dapi9e9e452a35ah334788h284he1641ce9d', + expected: true + }, + { + input: 'dapi8ccbe94fhcfb10c1d8e3abaae92a37a3', + expected: true + }, + { + input: 'dapig35c98ghc3fg20c6cceb2b4852ghcbgb', + expected: true + }, + { + input: 'dapi', + expected: false + }, + { + input: 'const = DATABRICKS_API_KEY_TOKEN', + expected: false + }, + { + input: 'DATABRICKS', + expected: false + } ] -databricks.testcases = testcase \ No newline at end of file +databricks.testcases = testcase diff --git a/packages/secret-scan/src/rules/datadog.ts b/packages/secret-scan/src/rules/datadog.ts index aaaf112d..bfe5c874 100644 --- a/packages/secret-scan/src/rules/datadog.ts +++ b/packages/secret-scan/src/rules/datadog.ts @@ -1,38 +1,38 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function datadog(): RegExp[] { - return [ - // Datadog API Token Regex - /datadog[a-zA-Z0-9]{40}/i - ] + return [ + // Datadog API Token Regex + /datadog[a-zA-Z0-9]{40}/i + ] } const testcase: TestCase[] = [ - { - input: 'datadogVzwYnTLnKQAgYWPWdqmNtbYpoHkN4SaEBj5JwGMy', - expected: true - }, - { - input: 'datadogSnxRlia4291mrcP7KX9KNUaT1FglR3xMAnJyu31C', - expected: true - }, - { - input: 'datadogks1mBWX1PsNCwCByU8pV8shws1UuUhLx86OdslbO', - expected: true - }, - { - input: 'datadog', - expected: false - }, - { - input: 'const = DATADOG_ACCESS_TOKEN', - expected: false - }, - { - input: 'DATADOG', - expected: false - } + { + input: 'datadogVzwYnTLnKQAgYWPWdqmNtbYpoHkN4SaEBj5JwGMy', + expected: true + }, + { + input: 'datadogSnxRlia4291mrcP7KX9KNUaT1FglR3xMAnJyu31C', + expected: true + }, + { + input: 'datadogks1mBWX1PsNCwCByU8pV8shws1UuUhLx86OdslbO', + expected: true + }, + { + input: 'datadog', + expected: false + }, + { + input: 'const = DATADOG_ACCESS_TOKEN', + expected: false + }, + { + input: 'DATADOG', + expected: false + } ] -datadog.testcases = testcase \ No newline at end of file +datadog.testcases = testcase diff --git a/packages/secret-scan/src/rules/definednetworking.ts b/packages/secret-scan/src/rules/definednetworking.ts index e8412b8f..a0877d6b 100644 --- a/packages/secret-scan/src/rules/definednetworking.ts +++ b/packages/secret-scan/src/rules/definednetworking.ts @@ -1,42 +1,45 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function definednetworking(): RegExp[] { - return [ - // Defined Networking API Token Regex - /dnkey-[a-z0-9=_\-]{26}-[a-z0-9=_\-]{52}/i - ] + return [ + // Defined Networking API Token Regex + /dnkey-[a-z0-9=_\-]{26}-[a-z0-9=_\-]{52}/i + ] } const testcase: TestCase[] = [ - { - input: 'dnkey-u8zyff1jig=vnqorg=r=kn3vfj-6u0c8vass=ck8dji9a_r3=d-1rcza8cmawt4f2ivy6g58sgjysa-', - expected: true - }, - { - input: 'dnkey-i9tayj=cb6x0cn83j2pk6lat90-1egyi2mlqafyoz2np5ca7vqnalyctifus=db1_z-4qrofld59zjr', - expected: true - }, - { - input: 'dnkey-15-0_=jfg5h3ll1p490qd=v6-k-3o=nqllwjm802109x_x23-rd0l5e8ta57ivz1j6-9_74gvj7ob-d', - expected: true - }, - { - input: 'defined', - expected: false - }, - { - input: 'const = DEFINED_NETWORKING_API_TOKEN', - expected: false - }, - { - input: 'networking', - expected: false - }, - { - input: 'dnkey-', - expected: false - } + { + input: + 'dnkey-u8zyff1jig=vnqorg=r=kn3vfj-6u0c8vass=ck8dji9a_r3=d-1rcza8cmawt4f2ivy6g58sgjysa-', + expected: true + }, + { + input: + 'dnkey-i9tayj=cb6x0cn83j2pk6lat90-1egyi2mlqafyoz2np5ca7vqnalyctifus=db1_z-4qrofld59zjr', + expected: true + }, + { + input: + 'dnkey-15-0_=jfg5h3ll1p490qd=v6-k-3o=nqllwjm802109x_x23-rd0l5e8ta57ivz1j6-9_74gvj7ob-d', + expected: true + }, + { + input: 'defined', + expected: false + }, + { + input: 'const = DEFINED_NETWORKING_API_TOKEN', + expected: false + }, + { + input: 'networking', + expected: false + }, + { + input: 'dnkey-', + expected: false + } ] -definednetworking.testcases = testcase \ No newline at end of file +definednetworking.testcases = testcase diff --git a/packages/secret-scan/src/rules/digitalocean.ts b/packages/secret-scan/src/rules/digitalocean.ts index 9b14d89d..a0e12ecd 100644 --- a/packages/secret-scan/src/rules/digitalocean.ts +++ b/packages/secret-scan/src/rules/digitalocean.ts @@ -1,43 +1,46 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function digitalocean(): RegExp[] { - return [ - /dop_v1_[a-f0-9]{64}/i, // DigitalOcean Personal Access Token - /doo_v1_[a-f0-9]{64}/i, // DigitalOcean OAuth Token - /dor_v1_[a-f0-9]{64}/i // DigitalOcean Refresh Token - ] + return [ + /dop_v1_[a-f0-9]{64}/i, // DigitalOcean Personal Access Token + /doo_v1_[a-f0-9]{64}/i, // DigitalOcean OAuth Token + /dor_v1_[a-f0-9]{64}/i // DigitalOcean Refresh Token + ] } const testcase: TestCase[] = [ - { - input: 'dop_v1_6ebe0710b1c8c5d3a30150d1b07f3cd3517ca0cad9c98b0b8d67b36a522ee9ae', - expected: true - }, - { - input: 'doo_v1_8942e3f6cfd015bda398f07e39f7d5ecd86a93b9d0d0d858e07b07c69a7e9094', - expected: true - }, - { - input: 'dor_v1_281d007c3055850a8b19c1b610cd447595eccf3c32a601f74c596fa84b59319d', - expected: true - }, - { - input: 'DIGITAL_OCEAN', - expected: false - }, - { - input: 'const = DIGITAL_OCEAN_API_TOKEN', - expected: false - }, - { - input: 'dor_', - expected: false - }, - { - input: 'dop_', - expected: false - } + { + input: + 'dop_v1_6ebe0710b1c8c5d3a30150d1b07f3cd3517ca0cad9c98b0b8d67b36a522ee9ae', + expected: true + }, + { + input: + 'doo_v1_8942e3f6cfd015bda398f07e39f7d5ecd86a93b9d0d0d858e07b07c69a7e9094', + expected: true + }, + { + input: + 'dor_v1_281d007c3055850a8b19c1b610cd447595eccf3c32a601f74c596fa84b59319d', + expected: true + }, + { + input: 'DIGITAL_OCEAN', + expected: false + }, + { + input: 'const = DIGITAL_OCEAN_API_TOKEN', + expected: false + }, + { + input: 'dor_', + expected: false + }, + { + input: 'dop_', + expected: false + } ] -digitalocean.testcases = testcase \ No newline at end of file +digitalocean.testcases = testcase diff --git a/packages/secret-scan/src/rules/doppler.ts b/packages/secret-scan/src/rules/doppler.ts index 91731876..4aad39f1 100644 --- a/packages/secret-scan/src/rules/doppler.ts +++ b/packages/secret-scan/src/rules/doppler.ts @@ -1,41 +1,41 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function doppler(): RegExp[] { - return [ - /dp\.pt\.[a-z0-9]{43}/i, // Doppler API Token regex - ] + return [ + /dp\.pt\.[a-z0-9]{43}/i // Doppler API Token regex + ] } const testcase: TestCase[] = [ - { - input: 'dp.pt.x6larkn5ztqmlk5u61p5l7do894mn24c2vrew90le7l', - expected: true - }, - { - input: 'dp.pt.ec7m7djndnz5hwcbvkz4aou1n21aor5cthu9ophkohg', - expected: true - }, - { - input: 'dp.pt.zroxmgl1lqgq6t0mp2sbr3bxm802tuay3zztmg8edfd', - expected: true - }, - { - input: 'doppler', - expected: false - }, - { - input: 'const = DOPPLER_API_TOKEN', - expected: false - }, - { - input: 'dp.', - expected: false - }, - { - input: '.pt.', - expected: false - } + { + input: 'dp.pt.x6larkn5ztqmlk5u61p5l7do894mn24c2vrew90le7l', + expected: true + }, + { + input: 'dp.pt.ec7m7djndnz5hwcbvkz4aou1n21aor5cthu9ophkohg', + expected: true + }, + { + input: 'dp.pt.zroxmgl1lqgq6t0mp2sbr3bxm802tuay3zztmg8edfd', + expected: true + }, + { + input: 'doppler', + expected: false + }, + { + input: 'const = DOPPLER_API_TOKEN', + expected: false + }, + { + input: 'dp.', + expected: false + }, + { + input: '.pt.', + expected: false + } ] -doppler.testcases = testcase \ No newline at end of file +doppler.testcases = testcase diff --git a/packages/secret-scan/src/rules/dropbox.ts b/packages/secret-scan/src/rules/dropbox.ts index 863b7a8a..08a291f8 100644 --- a/packages/secret-scan/src/rules/dropbox.ts +++ b/packages/secret-scan/src/rules/dropbox.ts @@ -1,43 +1,44 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function dropbox(): RegExp[] { - return [ - // /[a-zA-Z0-9]{15}/i, // Dropbox API Secret TODO: This regex is too generic - /sl\.[a-z0-9\-=_]{135}/i, // Dropbox Short Lived API Secret - /[a-z0-9]{11}AAAAAAAAAA[a-z0-9\-_=]{43}/i // Dropbox Long Lived API Secret - ] + return [ + // /[a-zA-Z0-9]{15}/i, // Dropbox API Secret TODO: This regex is too generic + /sl\.[a-z0-9\-=_]{135}/i, // Dropbox Short Lived API Secret + /[a-z0-9]{11}AAAAAAAAAA[a-z0-9\-_=]{43}/i // Dropbox Long Lived API Secret + ] } const testcase: TestCase[] = [ - // { - // input: 'v3tpJLAgvfvDuOR', - // expected: true - // }, - { - input: 'sl.idap1pjlvrg-_heuxm8x-_nq8pot9nu3a_b_0gfdh7b=cio8wirw0lu0wlx56zrct7f60ga6v=a__khqvv6yw_hgvzem9fdotvrw874cini4dt34pp3l5kpwvo1g4drefjowpoj', - expected: true - }, - { - input: 'nn63as3wdinAAAAAAAAAAlfs_frv4=tzjxss-x3xfjj4-q_bez2idi2tgye2uh_m', - expected: true - }, - { - input: 'DROPBOX', - expected: false - }, - { - input: 'const = DROPBOX_TOKEN', - expected: false - }, - { - input: 'drOP', - expected: false - }, - { - input: 'dHGSDasw', - expected: false - } + // { + // input: 'v3tpJLAgvfvDuOR', + // expected: true + // }, + { + input: + 'sl.idap1pjlvrg-_heuxm8x-_nq8pot9nu3a_b_0gfdh7b=cio8wirw0lu0wlx56zrct7f60ga6v=a__khqvv6yw_hgvzem9fdotvrw874cini4dt34pp3l5kpwvo1g4drefjowpoj', + expected: true + }, + { + input: 'nn63as3wdinAAAAAAAAAAlfs_frv4=tzjxss-x3xfjj4-q_bez2idi2tgye2uh_m', + expected: true + }, + { + input: 'DROPBOX', + expected: false + }, + { + input: 'const = DROPBOX_TOKEN', + expected: false + }, + { + input: 'drOP', + expected: false + }, + { + input: 'dHGSDasw', + expected: false + } ] -dropbox.testcases = testcase \ No newline at end of file +dropbox.testcases = testcase diff --git a/packages/secret-scan/src/rules/duffel.ts b/packages/secret-scan/src/rules/duffel.ts index bb0d89ab..351cd9b0 100644 --- a/packages/secret-scan/src/rules/duffel.ts +++ b/packages/secret-scan/src/rules/duffel.ts @@ -1,41 +1,41 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function duffel(): RegExp[] { - return [ - /duffel_(?:test|live)_[a-z0-9_\-=]{43}/i, // Duffel API Token regex - ] + return [ + /duffel_(?:test|live)_[a-z0-9_\-=]{43}/i // Duffel API Token regex + ] } const testcase: TestCase[] = [ - { - input: 'duffel_live_ov4m2czrp7d7kn-i3uk5hvu8y2v9iz9xo2f=9nt2ie5', - expected: true - }, - { - input: 'duffel_test_9puxwrgem1nus5z9w6791nhiwz74agyhe3iph9fdoa1', - expected: true - }, - { - input: 'duffel_test_', - expected: false - }, - { - input: 'duffel_live_', - expected: false - }, - { - input: 'const = DUFFEL_API_TOKEN', - expected: false - }, - { - input: '_live_', - expected: false - }, - { - input: '_test_', - expected: false - } + { + input: 'duffel_live_ov4m2czrp7d7kn-i3uk5hvu8y2v9iz9xo2f=9nt2ie5', + expected: true + }, + { + input: 'duffel_test_9puxwrgem1nus5z9w6791nhiwz74agyhe3iph9fdoa1', + expected: true + }, + { + input: 'duffel_test_', + expected: false + }, + { + input: 'duffel_live_', + expected: false + }, + { + input: 'const = DUFFEL_API_TOKEN', + expected: false + }, + { + input: '_live_', + expected: false + }, + { + input: '_test_', + expected: false + } ] -duffel.testcases = testcase \ No newline at end of file +duffel.testcases = testcase diff --git a/packages/secret-scan/src/rules/dynatrace.ts b/packages/secret-scan/src/rules/dynatrace.ts index 847e06f0..20e6e2f6 100644 --- a/packages/secret-scan/src/rules/dynatrace.ts +++ b/packages/secret-scan/src/rules/dynatrace.ts @@ -1,41 +1,44 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function dynatrace(): RegExp[] { - return [ - /dt0c01\.[a-z0-9]{24}\.[a-z0-9]{64}/i, // Dynatrace API Token regex - ] + return [ + /dt0c01\.[a-z0-9]{24}\.[a-z0-9]{64}/i // Dynatrace API Token regex + ] } const testcase: TestCase[] = [ - { - input: 'dt0c01.qegcxgkteatilg69j8yz1fnk.kopd89w9rbo1m5wxsyt79g6vaxd0kfjerwntw3se5haebhc5uz08i370vhzg8k4v', - expected: true - }, - { - input: 'dt0c01.7piyhuyhc4x67zn0dbu21i7f.bwkbjqxoau6e6fwyaum979qqcppmj7387c9jf9aaotd6usurjzzccednl3h1wo2e', - expected: true - }, - { - input: 'dt0c01.gait0evjy9w5qzlkc4z6h173.5wgi3lwtr9z6rtsr1ks2jcgn278t16eu9pncqs36qsawr21a28ax0rhdc689lw6o', - expected: true - }, - { - input: 'dt0c01', - expected: false - }, - { - input: 'const = DYNATRACE_API_TOKEN', - expected: false - }, - { - input: 'dynatrace', - expected: false - }, - { - input: 'dt0', - expected: false - } + { + input: + 'dt0c01.qegcxgkteatilg69j8yz1fnk.kopd89w9rbo1m5wxsyt79g6vaxd0kfjerwntw3se5haebhc5uz08i370vhzg8k4v', + expected: true + }, + { + input: + 'dt0c01.7piyhuyhc4x67zn0dbu21i7f.bwkbjqxoau6e6fwyaum979qqcppmj7387c9jf9aaotd6usurjzzccednl3h1wo2e', + expected: true + }, + { + input: + 'dt0c01.gait0evjy9w5qzlkc4z6h173.5wgi3lwtr9z6rtsr1ks2jcgn278t16eu9pncqs36qsawr21a28ax0rhdc689lw6o', + expected: true + }, + { + input: 'dt0c01', + expected: false + }, + { + input: 'const = DYNATRACE_API_TOKEN', + expected: false + }, + { + input: 'dynatrace', + expected: false + }, + { + input: 'dt0', + expected: false + } ] -dynatrace.testcases = testcase \ No newline at end of file +dynatrace.testcases = testcase diff --git a/packages/secret-scan/src/rules/easypost.ts b/packages/secret-scan/src/rules/easypost.ts index 59986b44..13bde8f8 100644 --- a/packages/secret-scan/src/rules/easypost.ts +++ b/packages/secret-scan/src/rules/easypost.ts @@ -1,42 +1,42 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function easypost(): RegExp[] { - return [ - /\bEZAK[a-z0-9]{54}/i, // Easypost API Token regex - /\bEZTK[a-z0-9]{54}/i // Easypost Test API Token regex - ] + return [ + /\bEZAK[a-z0-9]{54}/i, // Easypost API Token regex + /\bEZTK[a-z0-9]{54}/i // Easypost Test API Token regex + ] } const testcase: TestCase[] = [ - { - input: 'EZAK2fdhpkemxyx0qaykdvzeqz8ot30kzbc8s46t2erpmireuylnjc3t9h', // Easypost API Token - expected: true - }, - { - input: 'EZTKvoc505r1qjlmocerfnz61ce0hco00fdejxtjpfbebj5811e70wsmvm', // Easypost Test API Token - expected: true - }, - { - input: 'EZTK', - expected: false - }, - { - input: 'EZAK', - expected: false - }, - { - input: 'const = EASYPOST_API_TOKEN', - expected: false - }, - { - input: 'easypost', - expected: false - }, - { - input: 'EZ', - expected: false - } + { + input: 'EZAK2fdhpkemxyx0qaykdvzeqz8ot30kzbc8s46t2erpmireuylnjc3t9h', // Easypost API Token + expected: true + }, + { + input: 'EZTKvoc505r1qjlmocerfnz61ce0hco00fdejxtjpfbebj5811e70wsmvm', // Easypost Test API Token + expected: true + }, + { + input: 'EZTK', + expected: false + }, + { + input: 'EZAK', + expected: false + }, + { + input: 'const = EASYPOST_API_TOKEN', + expected: false + }, + { + input: 'easypost', + expected: false + }, + { + input: 'EZ', + expected: false + } ] -easypost.testcases = testcase \ No newline at end of file +easypost.testcases = testcase diff --git a/packages/secret-scan/src/rules/facebook.ts b/packages/secret-scan/src/rules/facebook.ts index 7e99d4fb..c3f64c35 100644 --- a/packages/secret-scan/src/rules/facebook.ts +++ b/packages/secret-scan/src/rules/facebook.ts @@ -1,50 +1,52 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function facebook(): RegExp[] { - return [ - /\d{15,16}([|%])[0-9a-z\-_]{27,40}/i, // Facebook Access Token regex - /EAA[MC][a-z0-9]{20,}/i // Facebook Page Access Token regex - ] + return [ + /\d{15,16}([|%])[0-9a-z\-_]{27,40}/i, // Facebook Access Token regex + /EAA[MC][a-z0-9]{20,}/i // Facebook Page Access Token regex + ] } const testcase: TestCase[] = [ - { - input: '5219701998240756|trfnpbd-f85yzmsbfv1w1yfqybo_d', - expected: true - }, - { - input: '5787803457532702|snysgapvyoyn-_634d8swk1mla_', - expected: true - }, - { - input: '477694365976971%5t3cb9379539yjkz92pcllkpk8seopx8lw', - expected: true - }, - { - input: 'EAAM4qg58c5n0r3xy1as780uebhdl5mkild7w9iyxvs3cvl', - expected: true - }, - { - input: 'EAAMqzici842ogge7tlds11embpqnu8n6ue1v7k858jbqnfb7r2jih7m80wfz94knzdyplt33p20mt3wukadu4l4ayj0ctmkovq5nt3w2h1', - expected: true - }, - { - input: 'EEAAMfrnibgnp6vhh9hkqwcdzpbrgnjn8m14laqn3mns9ee7786kdcbr9saenj8fmi7dboe907r5ooh997zln3h68hxrl2w8z0soiybzi', - expected: true - }, - { - input: 'const = FACEBOOK_API_TOKEN', - expected: false - }, - { - input: 'EAAM4qg58c5n0r3xy1', - expected: false - }, - { - input: '477694365976971%5t3c', - expected: false - } + { + input: '5219701998240756|trfnpbd-f85yzmsbfv1w1yfqybo_d', + expected: true + }, + { + input: '5787803457532702|snysgapvyoyn-_634d8swk1mla_', + expected: true + }, + { + input: '477694365976971%5t3cb9379539yjkz92pcllkpk8seopx8lw', + expected: true + }, + { + input: 'EAAM4qg58c5n0r3xy1as780uebhdl5mkild7w9iyxvs3cvl', + expected: true + }, + { + input: + 'EAAMqzici842ogge7tlds11embpqnu8n6ue1v7k858jbqnfb7r2jih7m80wfz94knzdyplt33p20mt3wukadu4l4ayj0ctmkovq5nt3w2h1', + expected: true + }, + { + input: + 'EEAAMfrnibgnp6vhh9hkqwcdzpbrgnjn8m14laqn3mns9ee7786kdcbr9saenj8fmi7dboe907r5ooh997zln3h68hxrl2w8z0soiybzi', + expected: true + }, + { + input: 'const = FACEBOOK_API_TOKEN', + expected: false + }, + { + input: 'EAAM4qg58c5n0r3xy1', + expected: false + }, + { + input: '477694365976971%5t3c', + expected: false + } ] -facebook.testcases = testcase \ No newline at end of file +facebook.testcases = testcase diff --git a/packages/secret-scan/src/rules/flutterwave.ts b/packages/secret-scan/src/rules/flutterwave.ts index 5a8508dc..bdc74ca3 100644 --- a/packages/secret-scan/src/rules/flutterwave.ts +++ b/packages/secret-scan/src/rules/flutterwave.ts @@ -1,39 +1,39 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function flutterwave(): RegExp[] { - return [ - /FLWPUBK_TEST-[a-h0-9]{32}-X/i, // Flutterwave public key regex - /FLWSECK_TEST-[a-h0-9]{32}-X/i, // Flutterwave Secret key regex - /FLWSECK_TEST-[a-h0-9]{12}/i // Flutterwave Encryption key regex - ] + return [ + /FLWPUBK_TEST-[a-h0-9]{32}-X/i, // Flutterwave public key regex + /FLWSECK_TEST-[a-h0-9]{32}-X/i, // Flutterwave Secret key regex + /FLWSECK_TEST-[a-h0-9]{12}/i // Flutterwave Encryption key regex + ] } const testcase: TestCase[] = [ - { - input: 'FLWPUBK_TEST-gdg9d8ca68b9d6ce0de4f77hahc3gga6-X', - expected: true - }, - { - input: 'FLWSECK_TEST-0ae285010b1e52f1f1ba6f24655g70f8-X', - expected: true - }, - { - input: 'FLWSECK_TEST-67635h4h6360', - expected: true - }, - { - input: 'const = FLUTTERWAVE_SECRET_KEY', - expected: false - }, - { - input: 'FLWSECK_TEST-', - expected: false - }, - { - input: 'FLWPUBK_TEST-', - expected: false - } + { + input: 'FLWPUBK_TEST-gdg9d8ca68b9d6ce0de4f77hahc3gga6-X', + expected: true + }, + { + input: 'FLWSECK_TEST-0ae285010b1e52f1f1ba6f24655g70f8-X', + expected: true + }, + { + input: 'FLWSECK_TEST-67635h4h6360', + expected: true + }, + { + input: 'const = FLUTTERWAVE_SECRET_KEY', + expected: false + }, + { + input: 'FLWSECK_TEST-', + expected: false + }, + { + input: 'FLWPUBK_TEST-', + expected: false + } ] -flutterwave.testcases = testcase \ No newline at end of file +flutterwave.testcases = testcase diff --git a/packages/secret-scan/src/rules/frameio.ts b/packages/secret-scan/src/rules/frameio.ts index af012c63..44f8f2c5 100644 --- a/packages/secret-scan/src/rules/frameio.ts +++ b/packages/secret-scan/src/rules/frameio.ts @@ -1,41 +1,44 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function frameio(): RegExp[] { - return [ - /fio-u-[a-z0-9\-_=]{64}/i, // FrameIO API Token regex - ] + return [ + /fio-u-[a-z0-9\-_=]{64}/i // FrameIO API Token regex + ] } const testcase: TestCase[] = [ - { - input: 'fio-u-bgcrq_d-3wf715y77ftxqyt5mtuvc9y0914zzot514=wz0301mnmda7z-75sahhc', - expected: true - }, - { - input: 'fio-u-rw0k9va933_8vp0zefnlq-f0-n0ld1=h98z=teeebnph5qpnkftltfh3olavw9id', - expected: true - }, - { - input: 'fio-u-da94y-7vmtkb_bmu=lt3i4_1aesayge67ghj2by7p3mv8d50plsbro4sg7iebv4k', - expected: true - }, - { - input: 'fio-u-', - expected: false - }, - { - input: 'const = FRAMEIO_API_TOKEN', - expected: false - }, - { - input: 'frameio', - expected: false - }, - { - input: 'fio', - expected: false - } + { + input: + 'fio-u-bgcrq_d-3wf715y77ftxqyt5mtuvc9y0914zzot514=wz0301mnmda7z-75sahhc', + expected: true + }, + { + input: + 'fio-u-rw0k9va933_8vp0zefnlq-f0-n0ld1=h98z=teeebnph5qpnkftltfh3olavw9id', + expected: true + }, + { + input: + 'fio-u-da94y-7vmtkb_bmu=lt3i4_1aesayge67ghj2by7p3mv8d50plsbro4sg7iebv4k', + expected: true + }, + { + input: 'fio-u-', + expected: false + }, + { + input: 'const = FRAMEIO_API_TOKEN', + expected: false + }, + { + input: 'frameio', + expected: false + }, + { + input: 'fio', + expected: false + } ] -frameio.testcases = testcase \ No newline at end of file +frameio.testcases = testcase diff --git a/packages/secret-scan/src/rules/gitlab.ts b/packages/secret-scan/src/rules/gitlab.ts index 00e159c3..d4c42958 100644 --- a/packages/secret-scan/src/rules/gitlab.ts +++ b/packages/secret-scan/src/rules/gitlab.ts @@ -1,47 +1,47 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function gitlab(): RegExp[] { - return [ - /glpat-[0-9a-zA-Z\-_]{20}/, // GitLab Personal Access Token regex - /glptt-[0-9a-f]{40}/, // GitLab Pipeline Trigger Token regex - /GR1348941[0-9a-zA-Z\-_]{20}/ // GitLab Runner Registration Token regex - ] + return [ + /glpat-[0-9a-zA-Z\-_]{20}/, // GitLab Personal Access Token regex + /glptt-[0-9a-f]{40}/, // GitLab Pipeline Trigger Token regex + /GR1348941[0-9a-zA-Z\-_]{20}/ // GitLab Runner Registration Token regex + ] } const testcase: TestCase[] = [ - { - input: 'glpat-a7rhywlOQc22s2wu6ksw', - expected: true - }, - { - input: 'glptt-6a2ebf582d778fbabc413dfa97e0dfd6b4ce5c2e', - expected: true - }, - { - input: 'GR1348941PQrAlrwIUScCvc8l6dWY', - expected: true - }, - { - input: 'const = GITLAB_PERSONAL_ACCESS_TOKEN', - expected: false - }, - { - input: 'const = GITLAB_PIPELINE_TRIGGER_TOKEN', - expected: false - }, - { - input: 'const = GITLAB_RUNNER_REGISTRATION_TOKEN', - expected: false - }, - { - input: 'GITLAB', - expected: false - }, - { - input: 'GIT', - expected: false - } + { + input: 'glpat-a7rhywlOQc22s2wu6ksw', + expected: true + }, + { + input: 'glptt-6a2ebf582d778fbabc413dfa97e0dfd6b4ce5c2e', + expected: true + }, + { + input: 'GR1348941PQrAlrwIUScCvc8l6dWY', + expected: true + }, + { + input: 'const = GITLAB_PERSONAL_ACCESS_TOKEN', + expected: false + }, + { + input: 'const = GITLAB_PIPELINE_TRIGGER_TOKEN', + expected: false + }, + { + input: 'const = GITLAB_RUNNER_REGISTRATION_TOKEN', + expected: false + }, + { + input: 'GITLAB', + expected: false + }, + { + input: 'GIT', + expected: false + } ] -gitlab.testcases = testcase \ No newline at end of file +gitlab.testcases = testcase diff --git a/packages/secret-scan/src/rules/grafana.ts b/packages/secret-scan/src/rules/grafana.ts index faea1144..980bafac 100644 --- a/packages/secret-scan/src/rules/grafana.ts +++ b/packages/secret-scan/src/rules/grafana.ts @@ -1,83 +1,90 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function grafana(): RegExp[] { - return [ - /eyJrIjoi[A-Za-z0-9]{70,400}={0,2}/, // Grafana API Key regex - /glc_[A-Za-z0-9+/]{32,400}={0,2}/, // Grafana Cloud API Token regex - /glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8}/ // Grafana Service Account Token regex - ] + return [ + /eyJrIjoi[A-Za-z0-9]{70,400}={0,2}/, // Grafana API Key regex + /glc_[A-Za-z0-9+/]{32,400}={0,2}/, // Grafana Cloud API Token regex + /glsa_[A-Za-z0-9]{32}_[A-Fa-f0-9]{8}/ // Grafana Service Account Token regex + ] } const testcase: TestCase[] = [ - { - input: 'eyJrIjoiLC58NHoAWV9QQ4Hpinsjz28MsjlfclKhSP6J6ecvqe7mHV67gknZlPfS92wlJSaGVwKI8ZOxmosmWlylfjEQwsDL9M31sNtgLyJZgXMKr3YXFUvwXrxrUmrmA3SGEDQeqrwuQKIRglOx94NHGe7wve0xbOf3Mkysv6u8LUB9H2ZJJhtPorLByR2rUMaZaauZvyNm6dkz4iYgxNk2ROP6PIA1E6N6TGwHa44pebzqMSDMPSlVAWrNaK2xjco3Ez7qtXpJl7tayylHAONDcWiM9vQDUELUA8uZtQsHNZP4DEoPMKHeaChAMlAVzDvzaM8fkGta9CJeqfrwb4qJ2Y6uwsXk8e8XMsSWPsxXFyOe7NUVMPNFzy8C344xiv3YcvV1E==', - expected: true - }, - { - input: 'eyJrIjoiIvuuuE2MzK2VJR23kHp3Q90IJSdnW9f1WIoyculWhTLBXrykooBhgIYm6IJgCndcSWDIaXJks7bkCdP3ywa7AfVpQP9rmJOq5VK57mas1KcdXD7Z1bdvhSo0mdzW91epWEcnlnLQpbtVLlDvxqnak9WETmFH==', - expected: true - }, - { - input: 'eyJrIjoi6QlsUNL4JJHbBXlyJS3SiRDPUzUfhT1B2w6px62kuQK05cTohhVE4TR2H9dOGNF5B6plJAECmpGfWca7gbA7LpFGRRVG', - expected: true - }, - { - input: 'glc_kB8ZcmLO+X1zpBZ7ljeXs8x8QjAPWLAQfIMv9r+4iOeAnQXnecZLzdPkutte3w0u737mBAFf+v3CitNm0fzUOEFd26tuVsncFpEkxRq/kjcYEhBWLYtIStMLcYyo7XhyLFW8IM7Bf4tGI9g5n9jfjtZnWqfKWEEhaHfE0ra', - expected: true - }, - { - input: 'glc_Hb574KjK4N0Z81xqlZGJy0IZCvBmDPT7cPPVqdH9plY1GbHRVl8Nm8coHWlRrh97YJTUyaNSF1Ec3r36sOHyks9C31FIX5vEpAvRx5ZReGdPV4DVP9Y33gzhMgqhHA4HEUi+hnFPClhPlXMBMhZJLUAzFvP0AoOMxrkXnCMJSwfPC4/9/djzC16zX9MuYFWf==', - expected: true - }, - { - input: 'glc_zSP9RW2kk4DZpq/gXYZwiKmLudxJqUNfXjtC8BvJLiMS32766GkZNOq2XIvPs8ZfFAh3yMUYTs/N4UT2d7q63uqq7=', - expected: true - }, - { - input: 'glsa_phY2htSd5uTt3jmPvK8XBLuq1hwk8K7J_BbB124A7', - expected: true - }, - { - input: 'glsa_8LVjQdfLZyFiylzBXDmwAhkwkHODsRNJ_B6BfAf1c', - expected: true - }, - { - input: 'glsa_OBtXDlTAprnRnhZPLHXPyFeY9lbXc4dW_Eb1A4125', - expected: true - }, - { - input: 'glsa_OBtXDlTAprnRnhZPLHXPyFeY9lbXc4dW_', - expected: false - }, - { - input: 'glc_zSP9RW2kq/gXYZwiKmLudxJqU66GkZN', - expected: false - }, - { - input: 'eyJrIjoi6QlsUNL4JJHbBXlyJS3SiRDPUzUfhT1B2w6px62kuQK05cTohhVE4TR2H9dO', - expected: false - }, - { - input: 'GRAFANA', - expected: false - }, - { - input: 'const = GRAFANA_API_KEY', - expected: false - }, - { - input: 'GRAFANA_API_KEY', - expected: false - }, - { - input: 'GRAFANA_CLOUD_API_TOKEN', - expected: false - }, - { - input: 'GRAFANA_SERVICE_ACCOUNT_TOKEN', - expected: false - } + { + input: + 'eyJrIjoiLC58NHoAWV9QQ4Hpinsjz28MsjlfclKhSP6J6ecvqe7mHV67gknZlPfS92wlJSaGVwKI8ZOxmosmWlylfjEQwsDL9M31sNtgLyJZgXMKr3YXFUvwXrxrUmrmA3SGEDQeqrwuQKIRglOx94NHGe7wve0xbOf3Mkysv6u8LUB9H2ZJJhtPorLByR2rUMaZaauZvyNm6dkz4iYgxNk2ROP6PIA1E6N6TGwHa44pebzqMSDMPSlVAWrNaK2xjco3Ez7qtXpJl7tayylHAONDcWiM9vQDUELUA8uZtQsHNZP4DEoPMKHeaChAMlAVzDvzaM8fkGta9CJeqfrwb4qJ2Y6uwsXk8e8XMsSWPsxXFyOe7NUVMPNFzy8C344xiv3YcvV1E==', + expected: true + }, + { + input: + 'eyJrIjoiIvuuuE2MzK2VJR23kHp3Q90IJSdnW9f1WIoyculWhTLBXrykooBhgIYm6IJgCndcSWDIaXJks7bkCdP3ywa7AfVpQP9rmJOq5VK57mas1KcdXD7Z1bdvhSo0mdzW91epWEcnlnLQpbtVLlDvxqnak9WETmFH==', + expected: true + }, + { + input: + 'eyJrIjoi6QlsUNL4JJHbBXlyJS3SiRDPUzUfhT1B2w6px62kuQK05cTohhVE4TR2H9dOGNF5B6plJAECmpGfWca7gbA7LpFGRRVG', + expected: true + }, + { + input: + 'glc_kB8ZcmLO+X1zpBZ7ljeXs8x8QjAPWLAQfIMv9r+4iOeAnQXnecZLzdPkutte3w0u737mBAFf+v3CitNm0fzUOEFd26tuVsncFpEkxRq/kjcYEhBWLYtIStMLcYyo7XhyLFW8IM7Bf4tGI9g5n9jfjtZnWqfKWEEhaHfE0ra', + expected: true + }, + { + input: + 'glc_Hb574KjK4N0Z81xqlZGJy0IZCvBmDPT7cPPVqdH9plY1GbHRVl8Nm8coHWlRrh97YJTUyaNSF1Ec3r36sOHyks9C31FIX5vEpAvRx5ZReGdPV4DVP9Y33gzhMgqhHA4HEUi+hnFPClhPlXMBMhZJLUAzFvP0AoOMxrkXnCMJSwfPC4/9/djzC16zX9MuYFWf==', + expected: true + }, + { + input: + 'glc_zSP9RW2kk4DZpq/gXYZwiKmLudxJqUNfXjtC8BvJLiMS32766GkZNOq2XIvPs8ZfFAh3yMUYTs/N4UT2d7q63uqq7=', + expected: true + }, + { + input: 'glsa_phY2htSd5uTt3jmPvK8XBLuq1hwk8K7J_BbB124A7', + expected: true + }, + { + input: 'glsa_8LVjQdfLZyFiylzBXDmwAhkwkHODsRNJ_B6BfAf1c', + expected: true + }, + { + input: 'glsa_OBtXDlTAprnRnhZPLHXPyFeY9lbXc4dW_Eb1A4125', + expected: true + }, + { + input: 'glsa_OBtXDlTAprnRnhZPLHXPyFeY9lbXc4dW_', + expected: false + }, + { + input: 'glc_zSP9RW2kq/gXYZwiKmLudxJqU66GkZN', + expected: false + }, + { + input: + 'eyJrIjoi6QlsUNL4JJHbBXlyJS3SiRDPUzUfhT1B2w6px62kuQK05cTohhVE4TR2H9dO', + expected: false + }, + { + input: 'GRAFANA', + expected: false + }, + { + input: 'const = GRAFANA_API_KEY', + expected: false + }, + { + input: 'GRAFANA_API_KEY', + expected: false + }, + { + input: 'GRAFANA_CLOUD_API_TOKEN', + expected: false + }, + { + input: 'GRAFANA_SERVICE_ACCOUNT_TOKEN', + expected: false + } ] -grafana.testcases = testcase \ No newline at end of file +grafana.testcases = testcase diff --git a/packages/secret-scan/src/rules/harness.ts b/packages/secret-scan/src/rules/harness.ts index 7a53cd51..0520bbef 100644 --- a/packages/secret-scan/src/rules/harness.ts +++ b/packages/secret-scan/src/rules/harness.ts @@ -1,50 +1,54 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function harness(): RegExp[] { - return [ - // Harness Personal Access (starts with `pat`) & Service Account (starts with `sat`) Token regex - /(?:pat|sat)\.[a-zA-Z0-9]{22}\.[a-zA-Z0-9]{24}\.[a-zA-Z0-9]{20}/, - ] + return [ + // Harness Personal Access (starts with `pat`) & Service Account (starts with `sat`) Token regex + /(?:pat|sat)\.[a-zA-Z0-9]{22}\.[a-zA-Z0-9]{24}\.[a-zA-Z0-9]{20}/ + ] } const testcase: TestCase[] = [ - { - input: 'sat.tbD3t0UTVxnDsJjXtA7yFg.Ses0cii322QyNVAWsGCAtbPG.cL64ShIGlxlB55eB2YSw', - expected: true - }, - { - input: 'sat.D5rQDqdpmAy8RCFrGOjBXu.8YSoWK1thmC6eTbWDLSg4SiK.OnKZVW9IytuKh9HFhhKG', - expected: true - }, - { - input: 'pat.GRDSyUuWR5EA2jwP2LDXEv.WqO2w3p1vb8QBvif7r0ilHTS.8T9HF4wdkNw1SxJTcoB3', - expected: true - }, - { - input: 'pat.t9KDTZ3Z4y1LZx2lwLTx5Y.VHA8Fd6wMD8Lc5yZ1aruadYC.v56fG64UhjmwgkoY5ugl\n', - expected: true - }, - { - input: 'const = HARNESS_PERSONAL_ACCESS_TOKEN', - expected: false - }, - { - input: 'const = HARNESS_SERVICE_ACCOUNT_TOKEN', - expected: false - }, - { - input: 'HARNESS', - expected: false - }, - { - input: 'pat.', - expected: false - }, - { - input: 'sat.', - expected: false - } + { + input: + 'sat.tbD3t0UTVxnDsJjXtA7yFg.Ses0cii322QyNVAWsGCAtbPG.cL64ShIGlxlB55eB2YSw', + expected: true + }, + { + input: + 'sat.D5rQDqdpmAy8RCFrGOjBXu.8YSoWK1thmC6eTbWDLSg4SiK.OnKZVW9IytuKh9HFhhKG', + expected: true + }, + { + input: + 'pat.GRDSyUuWR5EA2jwP2LDXEv.WqO2w3p1vb8QBvif7r0ilHTS.8T9HF4wdkNw1SxJTcoB3', + expected: true + }, + { + input: + 'pat.t9KDTZ3Z4y1LZx2lwLTx5Y.VHA8Fd6wMD8Lc5yZ1aruadYC.v56fG64UhjmwgkoY5ugl\n', + expected: true + }, + { + input: 'const = HARNESS_PERSONAL_ACCESS_TOKEN', + expected: false + }, + { + input: 'const = HARNESS_SERVICE_ACCOUNT_TOKEN', + expected: false + }, + { + input: 'HARNESS', + expected: false + }, + { + input: 'pat.', + expected: false + }, + { + input: 'sat.', + expected: false + } ] -harness.testcases = testcase \ No newline at end of file +harness.testcases = testcase diff --git a/packages/secret-scan/src/rules/hashicorp.ts b/packages/secret-scan/src/rules/hashicorp.ts index ac88f0eb..15872186 100644 --- a/packages/secret-scan/src/rules/hashicorp.ts +++ b/packages/secret-scan/src/rules/hashicorp.ts @@ -1,26 +1,28 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function hashicorp(): RegExp[] { - return [ - // Hashicorp Terraform APi Token Regex - /[a-z0-9]{14}\.atlasv1\.[a-z0-9\-_=]{60,70}/i - ] + return [ + // Hashicorp Terraform APi Token Regex + /[a-z0-9]{14}\.atlasv1\.[a-z0-9\-_=]{60,70}/i + ] } const testcase: TestCase[] = [ - { - input: '9mc0jh5dvgc1cx.atlasv1.y4u=-3=j=5nbf2bg0tkg1019e_9r6ghkmugdfl05hp2qzdd8=8d=wmtfya99o', - expected: true - }, - { - input: 't4eyvzkop56q4o.atlasv1.idknou9rz9ul3y2lepjhk=c6dvpdioedep=cwkrzk4m8i5v8fpb-kixusz-xo7loooj1', - expected: true - }, - { - input: 'TERRAFORM', - expected: false - } + { + input: + '9mc0jh5dvgc1cx.atlasv1.y4u=-3=j=5nbf2bg0tkg1019e_9r6ghkmugdfl05hp2qzdd8=8d=wmtfya99o', + expected: true + }, + { + input: + 't4eyvzkop56q4o.atlasv1.idknou9rz9ul3y2lepjhk=c6dvpdioedep=cwkrzk4m8i5v8fpb-kixusz-xo7loooj1', + expected: true + }, + { + input: 'TERRAFORM', + expected: false + } ] -hashicorp.testcases = testcase \ No newline at end of file +hashicorp.testcases = testcase diff --git a/packages/secret-scan/src/rules/heroku.ts b/packages/secret-scan/src/rules/heroku.ts index 8c07d5a9..b01fee7b 100644 --- a/packages/secret-scan/src/rules/heroku.ts +++ b/packages/secret-scan/src/rules/heroku.ts @@ -1,38 +1,38 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function heroku(): RegExp[] { - return [ - // Heroku API Key regex ( UUID like pattern ) - /\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b/ - ] + return [ + // Heroku API Key regex ( UUID like pattern ) + /\b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b/ + ] } const testcase: TestCase[] = [ - { - input: 'E3D24DAc-7c5D-Aacd-fafF-3cc0c70e2ccc', - expected: true - }, - { - input: 'AAD43dca-DBFc-4aEc-c86c-D57D57CAefb2', - expected: true - }, - { - input: 'FdA859B1-7D9a-f3e0-fAC3-E4ae6FbEEfBA', - expected: true - }, - { - input: 'AADdca-DBFc-4aEc-c86c-D57D57CAefb2', - expected: false - }, - { - input: 'AAD43dca-DBFc-4aEc-c86c-D7CAefb2', - expected: false - }, - { - input: 'AAD43dca-Dc-Ec-cc-D57D57CAefb2', - expected: false - } + { + input: 'E3D24DAc-7c5D-Aacd-fafF-3cc0c70e2ccc', + expected: true + }, + { + input: 'AAD43dca-DBFc-4aEc-c86c-D57D57CAefb2', + expected: true + }, + { + input: 'FdA859B1-7D9a-f3e0-fAC3-E4ae6FbEEfBA', + expected: true + }, + { + input: 'AADdca-DBFc-4aEc-c86c-D57D57CAefb2', + expected: false + }, + { + input: 'AAD43dca-DBFc-4aEc-c86c-D7CAefb2', + expected: false + }, + { + input: 'AAD43dca-Dc-Ec-cc-D57D57CAefb2', + expected: false + } ] -heroku.testcases = testcase \ No newline at end of file +heroku.testcases = testcase diff --git a/packages/secret-scan/src/rules/hubspot.ts b/packages/secret-scan/src/rules/hubspot.ts index 9452d030..3b77b50a 100644 --- a/packages/secret-scan/src/rules/hubspot.ts +++ b/packages/secret-scan/src/rules/hubspot.ts @@ -1,38 +1,38 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function hubspot(): RegExp[] { - return [ - // Hubspot API Key regex - /\b[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}\b/ - ] + return [ + // Hubspot API Key regex + /\b[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}\b/ + ] } const testcase: TestCase[] = [ - { - input: '6CA76A92-AC2A-8798-B0DD-DC55F0FD2718', - expected: true - }, - { - input: '17EEDBBE-B310-B60F-D37F-5902082CA2F2', - expected: true - }, - { - input: 'F74407A5-64B8-1C17-C90D-A3613B216A0B', - expected: true - }, - { - input: '17EEDBBE-B310-B60F-D37F-5902082CA', - expected: false - }, - { - input: '17EEE-B310-B60F-D37F-5902082CA2F2', - expected: false - }, - { - input: '17EEDBBE-B0-B0F-D-5902082CA2F2', - expected: false - } + { + input: '6CA76A92-AC2A-8798-B0DD-DC55F0FD2718', + expected: true + }, + { + input: '17EEDBBE-B310-B60F-D37F-5902082CA2F2', + expected: true + }, + { + input: 'F74407A5-64B8-1C17-C90D-A3613B216A0B', + expected: true + }, + { + input: '17EEDBBE-B310-B60F-D37F-5902082CA', + expected: false + }, + { + input: '17EEE-B310-B60F-D37F-5902082CA2F2', + expected: false + }, + { + input: '17EEDBBE-B0-B0F-D-5902082CA2F2', + expected: false + } ] -hubspot.testcases = testcase \ No newline at end of file +hubspot.testcases = testcase diff --git a/packages/secret-scan/src/rules/huggingface.ts b/packages/secret-scan/src/rules/huggingface.ts index 4bd00c91..6fe5c5f9 100644 --- a/packages/secret-scan/src/rules/huggingface.ts +++ b/packages/secret-scan/src/rules/huggingface.ts @@ -1,41 +1,41 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function huggingface(): RegExp[] { - return [ - // Huggingface Access Token regex - /(?:^|[\\'"` + "`" + ` >=:])(hf_[a-zA-Z]{34})(?:$|[\\'"` + "`" + ` <])/, + return [ + // Huggingface Access Token regex + /(?:^|[\\'"` + "`" + ` >=:])(hf_[a-zA-Z]{34})(?:$|[\\'"` + "`" + ` <])/, - // Huggingface Organization Access Token Regex - /(?:^|[\\'"` + "`" + ` >=:\(,)])(api_org_[a-zA-Z]{34})(?:$|[\\'"` + "`" + ` <\),])/ - ] + // Huggingface Organization Access Token Regex + /(?:^|[\\'"` + "`" + ` >=:\(,)])(api_org_[a-zA-Z]{34})(?:$|[\\'"` + "`" + ` <\),])/ + ] } const testcase: TestCase[] = [ - { - input: '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', - expected: true - }, - { - input: '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', - expected: true - }, - { - input: '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', - expected: true - }, - { - input: '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', - expected: true - }, - { - input: 'api_org_', - expected: false - }, - { - input: 'hf_', - expected: false - } + { + input: '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', + expected: true + }, + { + input: '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', + expected: true + }, + { + input: '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', + expected: true + }, + { + input: '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', + expected: true + }, + { + input: 'api_org_', + expected: false + }, + { + input: 'hf_', + expected: false + } ] -huggingface.testcases = testcase \ No newline at end of file +huggingface.testcases = testcase diff --git a/packages/secret-scan/src/rules/index.ts b/packages/secret-scan/src/rules/index.ts index d3481091..07b2d228 100644 --- a/packages/secret-scan/src/rules/index.ts +++ b/packages/secret-scan/src/rules/index.ts @@ -16,34 +16,34 @@ import artifactory from './artifactory' import aws from './aws' import algolia from './algolia' import alibaba from './alibaba' -import adafruit from "./adafruit" -import adobe from "./adobe" -import age from "./age" -import airtable from "./airtable" -import asana from "./asana" -import atlassian from "./atlassian" -import authress from "./authress" -import beamer from "./beamer" -import bitbucket from "./bitbucket" -import bittrex from "./bittrex" +import adafruit from './adafruit' +import adobe from './adobe' +import age from './age' +import airtable from './airtable' +import asana from './asana' +import atlassian from './atlassian' +import authress from './authress' +import beamer from './beamer' +import bitbucket from './bitbucket' +import bittrex from './bittrex' import clojars from './clojars' -import cloudflare from "./cloudflare" -import codecov from "./codecov" -import coinbase from "./coinbase" -import confluent from "./confluent" -import contentful from "./contentful" -import databricks from "./databricks" -import datadog from "./datadog" -import definednetworking from "./definednetworking" -import digitalocean from "./digitalocean" +import cloudflare from './cloudflare' +import codecov from './codecov' +import coinbase from './coinbase' +import confluent from './confluent' +import contentful from './contentful' +import databricks from './databricks' +import datadog from './datadog' +import definednetworking from './definednetworking' +import digitalocean from './digitalocean' import doppler from './doppler' import dropbox from './dropbox' import duffel from './duffel' import dynatrace from './dynatrace' import easypost from './easypost' -import facebook from "./facebook"; +import facebook from './facebook' import flutterwave from './flutterwave' -import frameio from "./frameio" +import frameio from './frameio' import gitlab from './gitlab' import grafana from './grafana' import harness from './harness' @@ -53,7 +53,7 @@ import hubspot from './hubspot' import huggingface from './huggingface' import infracost from './infracost' import intra42 from './intra42' -//import kubernetes from './kubernetes' +// import kubernetes from './kubernetes' import linear from './linear' import lob from './lob' import planetscale from './planetscale' @@ -124,7 +124,7 @@ export { huggingface, infracost, intra42, - //kubernetes, + // kubernetes, linear, lob, planetscale, diff --git a/packages/secret-scan/src/rules/infracost.ts b/packages/secret-scan/src/rules/infracost.ts index 6a64824f..5c4a58af 100644 --- a/packages/secret-scan/src/rules/infracost.ts +++ b/packages/secret-scan/src/rules/infracost.ts @@ -1,30 +1,30 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function infracost(): RegExp[] { - return [ - // Infracost API Key regex - /ico-[a-zA-Z0-9]{32}/ - ] + return [ + // Infracost API Key regex + /ico-[a-zA-Z0-9]{32}/ + ] } const testcase: TestCase[] = [ - { - input: 'ico-xgKpukMuYNOpYRwdW9VFW1lUcBdgNoiu', - expected: true - }, - { - input: 'ico-nG06pZj4mJAMiBlX0jHsnMgfGFtJlhyu', - expected: true - }, - { - input: 'ico-nG06pZj4mJAMewtiueye', - expected: false - }, - { - input: 'ico-', - expected: false - } + { + input: 'ico-xgKpukMuYNOpYRwdW9VFW1lUcBdgNoiu', + expected: true + }, + { + input: 'ico-nG06pZj4mJAMiBlX0jHsnMgfGFtJlhyu', + expected: true + }, + { + input: 'ico-nG06pZj4mJAMewtiueye', + expected: false + }, + { + input: 'ico-', + expected: false + } ] -infracost.testcases = testcase \ No newline at end of file +infracost.testcases = testcase diff --git a/packages/secret-scan/src/rules/intra42.ts b/packages/secret-scan/src/rules/intra42.ts index ef97a7d4..2eab65ec 100644 --- a/packages/secret-scan/src/rules/intra42.ts +++ b/packages/secret-scan/src/rules/intra42.ts @@ -1,38 +1,41 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function intra42(): RegExp[] { - return [ - // Intra42 Client Secret regex - /s-s4t2(?:ud|af)-[a-f0-9]{64}/ - ] + return [ + // Intra42 Client Secret regex + /s-s4t2(?:ud|af)-[a-f0-9]{64}/ + ] } const testcase: TestCase[] = [ - { - input: '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', - expected: true - }, - { - input: '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', - expected: true - }, - { - input: 's-s4t2ud-03c69e8cad5ba22c8a947038931a391e4849eba9866dc065ea02d3', - expected: false - }, - { - input: 's-s4td-03c69e8cad5ba22c8a9470639238931a391e4849eba9866dc065ea02d353ef01wejht72934', - expected: false - }, - { - input: 's-s4t2ud-', - expected: false - }, - { - input: 's-s4t2af-', - expected: false - } + { + input: + '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', + expected: true + }, + { + input: + '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', + expected: true + }, + { + input: 's-s4t2ud-03c69e8cad5ba22c8a947038931a391e4849eba9866dc065ea02d3', + expected: false + }, + { + input: + 's-s4td-03c69e8cad5ba22c8a9470639238931a391e4849eba9866dc065ea02d353ef01wejht72934', + expected: false + }, + { + input: 's-s4t2ud-', + expected: false + }, + { + input: 's-s4t2af-', + expected: false + } ] -intra42.testcases = testcase \ No newline at end of file +intra42.testcases = testcase diff --git a/packages/secret-scan/src/rules/linear.ts b/packages/secret-scan/src/rules/linear.ts index b4e468c5..1b033ba4 100644 --- a/packages/secret-scan/src/rules/linear.ts +++ b/packages/secret-scan/src/rules/linear.ts @@ -1,30 +1,30 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function linear(): RegExp[] { - return [ - // Linear API Key regex - /lin_api_[a-z0-9]{40}/i - ] + return [ + // Linear API Key regex + /lin_api_[a-z0-9]{40}/i + ] } const testcase: TestCase[] = [ - { - input: 'lin_api_pfwfydji40fvlknog3166f9hvlvqfr1d8odknvr3', - expected: true - }, - { - input: 'lin_api_efzosrmg5ziv9z9v3iq75s8pdyb80qxztk58trza', - expected: true - }, - { - input: 'lin_api_s53gd3ky47rsnqpidr1jj1bjsgpdhr30', - expected: false - }, - { - input: 'lin_api_', - expected: false - } + { + input: 'lin_api_pfwfydji40fvlknog3166f9hvlvqfr1d8odknvr3', + expected: true + }, + { + input: 'lin_api_efzosrmg5ziv9z9v3iq75s8pdyb80qxztk58trza', + expected: true + }, + { + input: 'lin_api_s53gd3ky47rsnqpidr1jj1bjsgpdhr30', + expected: false + }, + { + input: 'lin_api_', + expected: false + } ] -linear.testcases = testcase \ No newline at end of file +linear.testcases = testcase diff --git a/packages/secret-scan/src/rules/lob.ts b/packages/secret-scan/src/rules/lob.ts index aa1b440a..c30f8af1 100644 --- a/packages/secret-scan/src/rules/lob.ts +++ b/packages/secret-scan/src/rules/lob.ts @@ -1,38 +1,38 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function lob(): RegExp[] { - return [ - // Lob API (1. Publishable, 2. Normal) Key regex - /(test|live)(_|_pub_)[a-f0-9]{31}/i - ] + return [ + // Lob API (1. Publishable, 2. Normal) Key regex + /(test|live)(_|_pub_)[a-f0-9]{31}/i + ] } const testcase: TestCase[] = [ - { - input: 'test_pub_ba8b57a94ac56f4920c74e2be50dc02', - expected: true - }, - { - input: 'live_ca949625109cf9648c17925b854d1e1', - expected: true - }, - { - input: 'test_9b3c24b9cafee0072d56ddd496adb82', - expected: true - }, - { - input: 'live_pub_c4a7332fc4c74ab259a5d96ab1e7397', - expected: true - }, - { - input: 'live_', - expected: false - }, - { - input: '_pub_', - expected: false - } + { + input: 'test_pub_ba8b57a94ac56f4920c74e2be50dc02', + expected: true + }, + { + input: 'live_ca949625109cf9648c17925b854d1e1', + expected: true + }, + { + input: 'test_9b3c24b9cafee0072d56ddd496adb82', + expected: true + }, + { + input: 'live_pub_c4a7332fc4c74ab259a5d96ab1e7397', + expected: true + }, + { + input: 'live_', + expected: false + }, + { + input: '_pub_', + expected: false + } ] -lob.testcases = testcase \ No newline at end of file +lob.testcases = testcase diff --git a/packages/secret-scan/src/rules/planetscale.ts b/packages/secret-scan/src/rules/planetscale.ts index ae4c6689..ac434a84 100644 --- a/packages/secret-scan/src/rules/planetscale.ts +++ b/packages/secret-scan/src/rules/planetscale.ts @@ -1,44 +1,45 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function planetscale(): RegExp[] { - return [ - // Planetscale Password regex - /pscale_pw_[a-z0-9=\-_\.]{32,64}/i, + return [ + // Planetscale Password regex + /pscale_pw_[a-z0-9=\-_\.]{32,64}/i, - // Planetscale API Token Regex - /pscale_tkn_[a-z0-9=\-_\.]{32,64}/i, + // Planetscale API Token Regex + /pscale_tkn_[a-z0-9=\-_\.]{32,64}/i, - // Planetscale OAuth Token Regex - /pscale_oauth_[a-z0-9=\-_\.]{32,64}/i - ] + // Planetscale OAuth Token Regex + /pscale_oauth_[a-z0-9=\-_\.]{32,64}/i + ] } const testcase: TestCase[] = [ - { - input: 'pscale_pw_ajpcyf4c=r6lb-io9o2.7-epuvojus8f4horjaq9f3895.6l', - expected: true - }, - { - input: 'pscale_pw_9c5mf807yeygid-jzx24q-2x_u94451-.4qt76m8p7imt0', - expected: true - }, - { - input: 'pscale_tkn_lpy9d_khrord04559x6bdzyrgj38nb_4koqkic', - expected: true - }, - { - input: 'pscale_tkn_zhrzrex23933m5_a3p-vf.vz55ylj3urc4olnter_twvgzujtu._hn3q8l2htdw', - expected: true - }, - { - input: 'pscale_oauth_k-5wwis--9jp1othxh8rrlkqgiv3acoorg0sklcjo', - expected: true - }, - { - input: 'pscale_oauth_dxo=v081vsv10emho_5uj-8xj8=5.upl369nvhwdql8u3x_17mzm', - expected: true - } + { + input: 'pscale_pw_ajpcyf4c=r6lb-io9o2.7-epuvojus8f4horjaq9f3895.6l', + expected: true + }, + { + input: 'pscale_pw_9c5mf807yeygid-jzx24q-2x_u94451-.4qt76m8p7imt0', + expected: true + }, + { + input: 'pscale_tkn_lpy9d_khrord04559x6bdzyrgj38nb_4koqkic', + expected: true + }, + { + input: + 'pscale_tkn_zhrzrex23933m5_a3p-vf.vz55ylj3urc4olnter_twvgzujtu._hn3q8l2htdw', + expected: true + }, + { + input: 'pscale_oauth_k-5wwis--9jp1othxh8rrlkqgiv3acoorg0sklcjo', + expected: true + }, + { + input: 'pscale_oauth_dxo=v081vsv10emho_5uj-8xj8=5.upl369nvhwdql8u3x_17mzm', + expected: true + } ] -planetscale.testcases = testcase \ No newline at end of file +planetscale.testcases = testcase diff --git a/packages/secret-scan/src/rules/postman.ts b/packages/secret-scan/src/rules/postman.ts index 04ba195e..14d302d4 100644 --- a/packages/secret-scan/src/rules/postman.ts +++ b/packages/secret-scan/src/rules/postman.ts @@ -1,30 +1,30 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function postman(): RegExp[] { - return [ - // Postman API Key regex - /PMAK-[a-f0-9]{24}-[a-f0-9]{34}/i - ] + return [ + // Postman API Key regex + /PMAK-[a-f0-9]{24}-[a-f0-9]{34}/i + ] } const testcase: TestCase[] = [ - { - input: 'PMAK-9b918da2e43ee95b919224d1-e04a135eda41453c240886e79109bf6af3', - expected: true - }, - { - input: 'PMAK-74b0ae4e463c8e190074daca-7cb16c6676b256ebd8b42ee55624ce4528', - expected: true - }, - { - input: 'PMAK-', - expected: false - }, - { - input: 'POSTMAN', - expected: false - } + { + input: 'PMAK-9b918da2e43ee95b919224d1-e04a135eda41453c240886e79109bf6af3', + expected: true + }, + { + input: 'PMAK-74b0ae4e463c8e190074daca-7cb16c6676b256ebd8b42ee55624ce4528', + expected: true + }, + { + input: 'PMAK-', + expected: false + }, + { + input: 'POSTMAN', + expected: false + } ] -postman.testcases = testcase \ No newline at end of file +postman.testcases = testcase diff --git a/packages/secret-scan/src/rules/prefect.ts b/packages/secret-scan/src/rules/prefect.ts index ee001373..6dc059d2 100644 --- a/packages/secret-scan/src/rules/prefect.ts +++ b/packages/secret-scan/src/rules/prefect.ts @@ -1,30 +1,30 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function prefect(): RegExp[] { - return [ - // Prefect API Token regex - /pnu_[a-z0-9]{36}/ - ] + return [ + // Prefect API Token regex + /pnu_[a-z0-9]{36}/ + ] } const testcase: TestCase[] = [ - { - input: 'pnu_uv8cueiemumn0xos0s2e3u2xrt8e61temlan', - expected: true - }, - { - input: 'pnu_2be7m5lzmyv47mwsgd1y3ochncyn9a6lltq1', - expected: true - }, - { - input: 'pnu_', - expected: false - }, - { - input: 'PREFECT', - expected: false - } + { + input: 'pnu_uv8cueiemumn0xos0s2e3u2xrt8e61temlan', + expected: true + }, + { + input: 'pnu_2be7m5lzmyv47mwsgd1y3ochncyn9a6lltq1', + expected: true + }, + { + input: 'pnu_', + expected: false + }, + { + input: 'PREFECT', + expected: false + } ] -prefect.testcases = testcase \ No newline at end of file +prefect.testcases = testcase diff --git a/packages/secret-scan/src/rules/pulumi.ts b/packages/secret-scan/src/rules/pulumi.ts index 8be45925..c1ef8534 100644 --- a/packages/secret-scan/src/rules/pulumi.ts +++ b/packages/secret-scan/src/rules/pulumi.ts @@ -1,30 +1,30 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function pulumi(): RegExp[] { - return [ - // Pulumi API Key regex - /pul-[a-f0-9]{40}/ - ] + return [ + // Pulumi API Key regex + /pul-[a-f0-9]{40}/ + ] } const testcase: TestCase[] = [ - { - input: 'pul-1a07270f686b1c66e1e854e540077aaeea752a6f', - expected: true - }, - { - input: 'pul-3779cd2eb66d752be9b15f03ade833da9652f6fe', - expected: true - }, - { - input: 'pul-', - expected: false - }, - { - input: 'PULUMI', - expected: false - } + { + input: 'pul-1a07270f686b1c66e1e854e540077aaeea752a6f', + expected: true + }, + { + input: 'pul-3779cd2eb66d752be9b15f03ade833da9652f6fe', + expected: true + }, + { + input: 'pul-', + expected: false + }, + { + input: 'PULUMI', + expected: false + } ] -pulumi.testcases = testcase \ No newline at end of file +pulumi.testcases = testcase diff --git a/packages/secret-scan/src/rules/readme.ts b/packages/secret-scan/src/rules/readme.ts index 571a722a..2fd44fff 100644 --- a/packages/secret-scan/src/rules/readme.ts +++ b/packages/secret-scan/src/rules/readme.ts @@ -1,30 +1,32 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function readme(): RegExp[] { - return [ - // Readme API Key regex - /rdme_[a-z0-9]{70}/ - ] + return [ + // Readme API Key regex + /rdme_[a-z0-9]{70}/ + ] } const testcase: TestCase[] = [ - { - input: 'rdme_gmof25sb3fpcxljii5qvo1bqm7bartk9plo3r1yzus98rp1r7m6ljbn6wca140bra0luib', - expected: true - }, - { - input: 'rdme_5the1frp29hldpuswj1qxczbk5w2m5hxza48zwi3mvppjr9w4fjqzed74znqvd2sku3c3h', - expected: true - }, - { - input: 'rdme_', - expected: false - }, - { - input: 'README', - expected: false - } + { + input: + 'rdme_gmof25sb3fpcxljii5qvo1bqm7bartk9plo3r1yzus98rp1r7m6ljbn6wca140bra0luib', + expected: true + }, + { + input: + 'rdme_5the1frp29hldpuswj1qxczbk5w2m5hxza48zwi3mvppjr9w4fjqzed74znqvd2sku3c3h', + expected: true + }, + { + input: 'rdme_', + expected: false + }, + { + input: 'README', + expected: false + } ] -readme.testcases = testcase \ No newline at end of file +readme.testcases = testcase diff --git a/packages/secret-scan/src/rules/rubygems.ts b/packages/secret-scan/src/rules/rubygems.ts index 6836b5b9..3536fe02 100644 --- a/packages/secret-scan/src/rules/rubygems.ts +++ b/packages/secret-scan/src/rules/rubygems.ts @@ -1,30 +1,30 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function rubygems(): RegExp[] { - return [ - // Ruby Gems API Key regex - /rubygems_[a-f0-9]{48}/ - ] + return [ + // Ruby Gems API Key regex + /rubygems_[a-f0-9]{48}/ + ] } const testcase: TestCase[] = [ - { - input: 'rubygems_fb6bff4ec114a74a96c4cd82bd34969fbc7873b15f4a0465', - expected: true - }, - { - input: 'rubygems_afff37f44056352348e9b97b33315e55792c0680841ba6bd', - expected: true - }, - { - input: 'rubygems_', - expected: false - }, - { - input: 'RubyGems', - expected: false - } + { + input: 'rubygems_fb6bff4ec114a74a96c4cd82bd34969fbc7873b15f4a0465', + expected: true + }, + { + input: 'rubygems_afff37f44056352348e9b97b33315e55792c0680841ba6bd', + expected: true + }, + { + input: 'rubygems_', + expected: false + }, + { + input: 'RubyGems', + expected: false + } ] -rubygems.testcases = testcase \ No newline at end of file +rubygems.testcases = testcase diff --git a/packages/secret-scan/src/rules/scalingo.ts b/packages/secret-scan/src/rules/scalingo.ts index 8f7684a9..57ac6c0c 100644 --- a/packages/secret-scan/src/rules/scalingo.ts +++ b/packages/secret-scan/src/rules/scalingo.ts @@ -1,30 +1,30 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function scalingo(): RegExp[] { - return [ - // Scalingo API Key regex - /tk-us-[a-zA-Z0-9-_]{48}/ - ] + return [ + // Scalingo API Key regex + /tk-us-[a-zA-Z0-9-_]{48}/ + ] } const testcase: TestCase[] = [ - { - input: 'tk-us-TPdFpIyuvXJLQytNSugN3RBeN0YYLed3ib1b7uJiPqk_XAws', - expected: true - }, - { - input: 'tk-us-h0rx7zIiaoFsmloQDcfCdkhaAljG9QjQRkmuF894qCCnp4XX', - expected: true - }, - { - input: 'tk-us-', - expected: false - }, - { - input: 'Scalingo', - expected: false - } + { + input: 'tk-us-TPdFpIyuvXJLQytNSugN3RBeN0YYLed3ib1b7uJiPqk_XAws', + expected: true + }, + { + input: 'tk-us-h0rx7zIiaoFsmloQDcfCdkhaAljG9QjQRkmuF894qCCnp4XX', + expected: true + }, + { + input: 'tk-us-', + expected: false + }, + { + input: 'Scalingo', + expected: false + } ] -scalingo.testcases = testcase \ No newline at end of file +scalingo.testcases = testcase diff --git a/packages/secret-scan/src/rules/sendinblue.ts b/packages/secret-scan/src/rules/sendinblue.ts index 2983b804..8667a393 100644 --- a/packages/secret-scan/src/rules/sendinblue.ts +++ b/packages/secret-scan/src/rules/sendinblue.ts @@ -1,30 +1,32 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function sendinblue(): RegExp[] { - return [ - // SendInBlue API Key regex - /xkeysib-[a-f0-9]{64}-[a-z0-9]{16}/i - ] + return [ + // SendInBlue API Key regex + /xkeysib-[a-f0-9]{64}-[a-z0-9]{16}/i + ] } const testcase: TestCase[] = [ - { - input: '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', - expected: true - }, - { - input: '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', - expected: true - }, - { - input: 'xkeysib-', - expected: false - }, - { - input: 'SENDINBLUE', - expected: false - } + { + input: + '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', + expected: true + }, + { + input: + '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', + expected: true + }, + { + input: 'xkeysib-', + expected: false + }, + { + input: 'SENDINBLUE', + expected: false + } ] -sendinblue.testcases = testcase \ No newline at end of file +sendinblue.testcases = testcase diff --git a/packages/secret-scan/src/rules/shippo.ts b/packages/secret-scan/src/rules/shippo.ts index 7e8ff6c7..85186e85 100644 --- a/packages/secret-scan/src/rules/shippo.ts +++ b/packages/secret-scan/src/rules/shippo.ts @@ -1,30 +1,30 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function shippo(): RegExp[] { - return [ - // Shippo API Key regex - /shippo_(live|test)_[a-f0-9]{40}/i - ] + return [ + // Shippo API Key regex + /shippo_(live|test)_[a-f0-9]{40}/i + ] } const testcase: TestCase[] = [ - { - input: 'shippo_test_db8536f152f40910e83640bc9567783f3ac7965f', - expected: true - }, - { - input: 'shippo_live_e844246554cebd546a8b2cce0aad583992368c82', - expected: true - }, - { - input: 'shippo_', - expected: false - }, - { - input: 'Shippo', - expected: false - } + { + input: 'shippo_test_db8536f152f40910e83640bc9567783f3ac7965f', + expected: true + }, + { + input: 'shippo_live_e844246554cebd546a8b2cce0aad583992368c82', + expected: true + }, + { + input: 'shippo_', + expected: false + }, + { + input: 'Shippo', + expected: false + } ] -shippo.testcases = testcase \ No newline at end of file +shippo.testcases = testcase diff --git a/packages/secret-scan/src/rules/shopify.ts b/packages/secret-scan/src/rules/shopify.ts index d98a44fe..299f2d0e 100644 --- a/packages/secret-scan/src/rules/shopify.ts +++ b/packages/secret-scan/src/rules/shopify.ts @@ -1,55 +1,55 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function shopify(): RegExp[] { - return [ - // Shopify Shared Secret regex - /shpss_[a-fA-F0-9]{32}/, + return [ + // Shopify Shared Secret regex + /shpss_[a-fA-F0-9]{32}/, - // Shopify Access Token Regex - /shpat_[a-fA-F0-9]{32}/, + // Shopify Access Token Regex + /shpat_[a-fA-F0-9]{32}/, - // Shopify Custom Access Token Regex - /shpca_[a-fA-F0-9]{32}/, + // Shopify Custom Access Token Regex + /shpca_[a-fA-F0-9]{32}/, - // Shopify Private App Access Token - /shppa_[a-fA-F0-9]{32}/ - ] + // Shopify Private App Access Token + /shppa_[a-fA-F0-9]{32}/ + ] } const testcase: TestCase[] = [ - { - input: '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', - expected: true - }, - { - input: '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', - expected: true - }, - { - input: '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', - expected: true - }, - { - input: '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', - expected: true - }, - { - input: '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', - expected: true - }, - { - input: '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', - expected: true - }, - { - input: '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', - expected: true - }, - { - input: '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', - expected: true - } + { + input: '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', + expected: true + }, + { + input: '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', + expected: true + }, + { + input: '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', + expected: true + }, + { + input: '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', + expected: true + }, + { + input: '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', + expected: true + }, + { + input: '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', + expected: true + }, + { + input: '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', + expected: true + }, + { + input: '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', + expected: true + } ] -shopify.testcases = testcase \ No newline at end of file +shopify.testcases = testcase diff --git a/packages/secret-scan/src/rules/sidekiq.ts b/packages/secret-scan/src/rules/sidekiq.ts index 400d42b9..f9098e31 100644 --- a/packages/secret-scan/src/rules/sidekiq.ts +++ b/packages/secret-scan/src/rules/sidekiq.ts @@ -1,33 +1,34 @@ // keyshade-ignore-all -import type { TestCase }from '@/types' +import type { TestCase } from '@/types' export default function sidekiq(): RegExp[] { - return [ - // Sidekiq Secret regex - /BUNDLE_ENTERPRISE__CONTRIBSYS__COM|BUNDLE_GEMS__CONTRIBSYS__COM( = |=)[^\n]*[a-f0-9]{8}:[a-f0-9]{8}/, + return [ + // Sidekiq Secret regex + /BUNDLE_ENTERPRISE__CONTRIBSYS__COM|BUNDLE_GEMS__CONTRIBSYS__COM( = |=)[^\n]*[a-f0-9]{8}:[a-f0-9]{8}/, - // Sidekiq Sensitive URL Regex - /\bhttps?:\/\/([a-f0-9]{8}:[a-f0-9]{8})@(gems\.contribsys\.com|enterprise\.contribsys\.com)(?:[\/|#|?|:]|$)/i - ] + // Sidekiq Sensitive URL Regex + /\bhttps?:\/\/([a-f0-9]{8}:[a-f0-9]{8})@(gems\.contribsys\.com|enterprise\.contribsys\.com)(?:[\/|#|?|:]|$)/i + ] } const testcase: TestCase[] = [ - { - input: 'BUNDLE_GEMS__CONTRIBSYS__COM=UBrkb/_"6,a,:,xH:}L02N[LFDkqM9+rLk.q~X%+\'zZP>vku<0eaYlV9Uj+YGh]; y%fiMj9j0ba92c069:de1f9899', - expected: true - }, - { - input: 'BUNDLE_ENTERPRISE__CONTRIBSYS__COM', - expected: true - }, - { - input: 'http://f85e09bd:a0fd7dff@enterprise.contribsys.com/', - expected: true - }, - { - input: 'http://70310b59:ad696f7f@gems.contribsys.com', - expected: true - } + { + input: + 'BUNDLE_GEMS__CONTRIBSYS__COM=UBrkb/_"6,a,:,xH:}L02N[LFDkqM9+rLk.q~X%+\'zZP>vku<0eaYlV9Uj+YGh]; y%fiMj9j0ba92c069:de1f9899', + expected: true + }, + { + input: 'BUNDLE_ENTERPRISE__CONTRIBSYS__COM', + expected: true + }, + { + input: 'http://f85e09bd:a0fd7dff@enterprise.contribsys.com/', + expected: true + }, + { + input: 'http://70310b59:ad696f7f@gems.contribsys.com', + expected: true + } ] -sidekiq.testcases = testcase \ No newline at end of file +sidekiq.testcases = testcase