Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a rule for Databricks Personal Access Token detection #187

Merged
merged 5 commits into from
May 17, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -28,6 +28,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- New rules have been added:

- AWS AppSync API Key ([#176](https://github.com/praetorian-inc/noseyparker/pull/176))
- Databricks Personal Access Token ([#187](https://github.com/praetorian-inc/noseyparker/pull/187) from @@tobiasgyoerfi)
- Password Hash (Kerberos 5, etype 23, AS-REP) ([#176](https://github.com/praetorian-inc/noseyparker/pull/176))

### Changes
Original file line number Diff line number Diff line change
@@ -2,4 +2,4 @@
source: crates/noseyparker-cli/tests/rules/mod.rs
expression: stdout
---
141 rules and 3 rulesets: no issues detected
142 rules and 3 rulesets: no issues detected
Original file line number Diff line number Diff line change
@@ -478,6 +478,26 @@ expression: stdout
]
}
},
{
"id": "np.databricks.1",
"structural_id": "652e0e0655c34bb2f8cb9252540f7305f0aaa006",
"name": "Databricks Personal Access Token",
"syntax": {
"name": "Databricks Personal Access Token",
"id": "np.databricks.1",
"pattern": "(?x)\n\\b\n(\n dapi[a-f0-9]{32}\n (?: -[0-9]+ )? (?# optional -NUM suffix )\n)\n\\b\n",
"examples": [
"DATABRICKS_TOKEN: 'dapicd295a7be286969133e18a58e4afe7bd-3'",
"dapif21ee53d2b3648c2a1ed38953312a203"
],
"negative_examples": [
" dapiDataGetTopLongShortPositionRatio (params?: {}): Promise<implicitReturnType>;"
],
"references": [
"https://docs.databricks.com/en/dev-tools/auth/pat.html"
]
}
},
{
"id": "np.digitalocean.1",
"structural_id": "f43e1590624961d1a9984818101cb6a91ca00081",
@@ -2822,7 +2842,7 @@ expression: stdout
{
"id": "default",
"name": "Nosey Parker default rules",
"num_rules": 120
"num_rules": 121
},
{
"id": "np.assets",
Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@ expression: stdout
np.blynk.7 Blynk Organization Client Secret (URL last)
np.codeclimate.1 CodeClimate Reporter ID
np.cratesio.1 crates.io API Key
np.databricks.1 Databricks Personal Access Token
np.digitalocean.1 DigitalOcean Application Access Token
np.digitalocean.2 DigitalOcean Personal Access Token
np.digitalocean.3 DigitalOcean Refresh Token
@@ -148,6 +149,6 @@ expression: stdout

Ruleset ID Ruleset Name Rules
─────────────────────────────────────────────────────────
default Nosey Parker default rules 120
default Nosey Parker default rules 121
np.assets Nosey Parker asset detection rules 15
np.hashes Nosey Parker password hash rules 6
22 changes: 22 additions & 0 deletions crates/noseyparker/data/default/builtin/rules/databricks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
rules:

- name: Databricks Personal Access Token
id: np.databricks.1
pattern: |
(?x)
\b
(
dapi[a-f0-9]{32}
(?: -[0-9]+ )? (?# optional -NUM suffix )
)
\b

references:
- https://docs.databricks.com/en/dev-tools/auth/pat.html

examples:
- "DATABRICKS_TOKEN: 'dapicd295a7be286969133e18a58e4afe7bd-3'"
- "dapif21ee53d2b3648c2a1ed38953312a203"

negative_examples:
- " dapiDataGetTopLongShortPositionRatio (params?: {}): Promise<implicitReturnType>;"
Original file line number Diff line number Diff line change
@@ -34,6 +34,7 @@ rulesets:
- np.blynk.7 # Blynk Organization Client Secret (URL last)
- np.codeclimate.1 # CodeClimate
- np.cratesio.1 # crates.io API Key
- np.databricks.1 # Databricks Personal Access Token
- np.dtrack.1 # Dependency-Track API Key
- np.digitalocean.1 # DigitalOcean Application Access Token
- np.digitalocean.2 # DigitalOcean Personal Access Token