Skip to content

Commit

Permalink
chore(secret-scan): Failing lint issues (#507)
Browse files Browse the repository at this point in the history
  • Loading branch information
somya-05 authored Oct 23, 2024
1 parent f441262 commit 48f45df
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 18 deletions.
6 changes: 3 additions & 3 deletions packages/secret-scan/src/rules/authress.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import type { TestCase } from '@/types'

export default function authress(): RegExp[] {
/*
Authress API key regex
Authress API key regex
reference: https://authress.io/knowledge-base/docs/authorization/service-clients/secrets-scanning/#1-detection
*/
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
]
Expand Down
2 changes: 1 addition & 1 deletion packages/secret-scan/src/rules/beamer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { TestCase } from '@/types'
export default function beamer(): RegExp[] {
return [
// Beamer API key regex
/b_[a-z0-9=_\-]{44}/i
/b_[a-z0-9=_-]{44}/i
]
}

Expand Down
2 changes: 1 addition & 1 deletion packages/secret-scan/src/rules/bitbucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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
/bitbucket[a-zA-Z0-9]{32}|bitbucket[a-zA-Z0-9=_-]{64}/i
]
}

Expand Down
2 changes: 1 addition & 1 deletion packages/secret-scan/src/rules/cloudflare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default function cloudflare(): RegExp[] {
* */
return [
// Cloudflare key regex
/(?:[a-z0-9]{37}|[a-zA-Z0-9=_\-]{40}|v1\.0-[a-f0-9]{24}-[a-f0-9]{146})/i
/(?:[a-z0-9]{37}|[a-zA-Z0-9=_-]{40}|v1\.0-[a-f0-9]{24}-[a-f0-9]{146})/i
]
}

Expand Down
2 changes: 1 addition & 1 deletion packages/secret-scan/src/rules/coinbase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
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[] = [
Expand Down
2 changes: 1 addition & 1 deletion packages/secret-scan/src/rules/contentful.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { TestCase } from '@/types'
export default function contentful(): RegExp[] {
return [
// Contentful Delivery API Token regex
/contentful[a-zA-Z0-9=_\-]{43}/i
/contentful[a-zA-Z0-9=_-]{43}/i
]
}

Expand Down
2 changes: 1 addition & 1 deletion packages/secret-scan/src/rules/definednetworking.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ 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
/dnkey-[a-z0-9=_-]{26}-[a-z0-9=_-]{52}/i
]
}

Expand Down
6 changes: 3 additions & 3 deletions packages/secret-scan/src/rules/dropbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ 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
// /[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: 'v3tpJLAgvfvDuOR',
// expected: true
// },
{
input:
Expand Down
2 changes: 1 addition & 1 deletion packages/secret-scan/src/rules/huggingface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function huggingface(): RegExp[] {
/(?:^|[\\'"` + "`" + ` >=:])(hf_[a-zA-Z]{34})(?:$|[\\'"` + "`" + ` <])/,

// Huggingface Organization Access Token Regex
/(?:^|[\\'"` + "`" + ` >=:\(,)])(api_org_[a-zA-Z]{34})(?:$|[\\'"` + "`" + ` <\),])/
/(?:^|[\\'"` + "`" + ` >=:(,)])(api_org_[a-zA-Z]{34})(?:$|[\\'"` + "`" + ` <),])/
]
}

Expand Down
2 changes: 1 addition & 1 deletion packages/secret-scan/src/rules/ip_public.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type { TestCase } from '@/types'
// eslint-disable-next-line @typescript-eslint/naming-convention
export default function ip_public(): RegExp[] {
return [
/(?<![\w.])((?!(192\.168\.|127\.|10\.|172\.(?:1[6-9]|2[0-9]|3[01])))(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?:\:\d{1,5})?)(?![\w.])/
/(?<![\w.])((?!(192\.168\.|127\.|10\.|172\.(?:1[6-9]|2[0-9]|3[01])))(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])(?::\d{1,5})?)(?![\w.])/
]
}

Expand Down
6 changes: 3 additions & 3 deletions packages/secret-scan/src/rules/planetscale.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import type { TestCase } from '@/types'
export default function planetscale(): RegExp[] {
return [
// Planetscale Password regex
/pscale_pw_[a-z0-9=\-_\.]{32,64}/i,
/pscale_pw_[a-z0-9=\-_.]{32,64}/i,

// Planetscale API Token Regex
/pscale_tkn_[a-z0-9=\-_\.]{32,64}/i,
/pscale_tkn_[a-z0-9=\-_.]{32,64}/i,

// Planetscale OAuth Token Regex
/pscale_oauth_[a-z0-9=\-_\.]{32,64}/i
/pscale_oauth_[a-z0-9=\-_.]{32,64}/i
]
}

Expand Down
2 changes: 1 addition & 1 deletion packages/secret-scan/src/rules/sidekiq.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default function sidekiq(): RegExp[] {
/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
/\bhttps?:\/\/([a-f0-9]{8}:[a-f0-9]{8})@(gems\.contribsys\.com|enterprise\.contribsys\.com)(?:[/|#|?|:]|$)/i
]
}

Expand Down

0 comments on commit 48f45df

Please sign in to comment.