Skip to content

Commit eab6c2d

Browse files
authored
Merge pull request #131 from mongodb/development
v1.60.0
2 parents 8f7772b + 706caeb commit eab6c2d

24 files changed

+2223
-374
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,16 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [v1.60.0]
6+
- Removed the `--bitbucket-username`, `--bitbucket-token`, and `--bitbucket-oauth-token` flags in favour of `KF_BITBUCKET_*` environment variables when authenticating to Bitbucket.
7+
- Added provider-specific `kingfisher scan` subcommands (for example `kingfisher scan github …`) that translate into the legacy flags under the hood. The new layout keeps backwards compatibility while removing the wall of provider options from `kingfisher scan --help`.
8+
- Updated the README so every provider example (GitHub, GitLab, Bitbucket, Azure Repos, Gitea, Hugging Face, Slack, Jira, Confluence, S3, GCS, Docker) uses the new subcommand style.
9+
- Legacy provider flags (for example `--github-user`, `--gitlab-group`, `--bitbucket-workspace`, `--s3-bucket`) still work but now emit a deprecation warning to encourage migration to the new `kingfisher scan <provider>` flow.
10+
- Kept the direct `kingfisher scan /path/to/dir` flow for local filesystem / local git repo scans while adding a `--list-only` switch to each provider subcommand so repository enumeration no longer requires the standalone `github repos`, `gitlab repos`, etc. commands.
11+
- Removed the legacy top-level provider commands (`kingfisher github`, `kingfisher gitlab`, `kingfisher gitea`, `kingfisher bitbucket`, `kingfisher azure`, `kingfisher huggingface`) now that enumeration lives under `kingfisher scan <provider> --list-only`.
12+
513
## [v1.59.0]
14+
- Fixed `kingfisher scan github …` (and other provider-specific subcommands) so they no longer demand placeholder path arguments before the CLI accepts the request.
615
- Fixed `kingfisher scan` so that providing `--branch` without `--since-commit` now diffs the branch against the empty tree and scans every commit reachable from that branch.
716
- Added rules for meraki, duffel, finnhub, frameio, freshbooks, gitter, infracost, launchdarkly, lob, maxmind, messagebird, nytimes, prefect, scalingo, sendinblue, sentry, shippo, twitch, typeform
817

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ publish = false
1010

1111
[package]
1212
name = "kingfisher"
13-
version = "1.59.0"
13+
version = "1.60.0"
1414
description = "MongoDB's blazingly fast and accurate secret scanning and validation tool"
1515
edition.workspace = true
1616
rust-version.workspace = true

README.md

Lines changed: 124 additions & 83 deletions
Large diffs are not rendered by default.

buildwin.bat

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,9 @@ cargo build --release --target x86_64-pc-windows-msvc || (
124124

125125
echo Generating CHECKSUM.txt...
126126
powershell -Command ^
127-
"Get-FileHash .\target\x86_64-pc-windows-msvc\release\%PROJECT_NAME%.exe -Algorithm SHA256 | Out-File .\target\x86_64-pc-windows-msvc\release\CHECKSUM.txt"
127+
"$hash = Get-FileHash '.\target\x86_64-pc-windows-msvc\release\%PROJECT_NAME%.exe' -Algorithm SHA256;" ^
128+
"$line = '{0} {1}' -f $hash.Hash, (Split-Path -Leaf $hash.Path);" ^
129+
"Set-Content -Path '.\target\x86_64-pc-windows-msvc\release\CHECKSUM.txt' -Value $line"
128130

129131
if not exist "target\release" mkdir "target\release"
130132
copy /Y "target\x86_64-pc-windows-msvc\release\%PROJECT_NAME%.exe" "target\release\" >nul
@@ -137,7 +139,10 @@ powershell -Command "Compress-Archive -Path '%PROJECT_NAME%.exe','CHECKSUM-windo
137139

138140
if exist "%PROJECT_NAME%-windows-x64.zip" (
139141
REM -- append the ZIP’s SHA-256 to the existing checksum file ----
140-
certutil -hashfile "%PROJECT_NAME%-windows-x64.zip" SHA256 >> "CHECKSUM-windows-x64.txt"
142+
powershell -Command ^
143+
"$hash = Get-FileHash '.\%PROJECT_NAME%-windows-x64.zip' -Algorithm SHA256;" ^
144+
"$line = '{0} {1}' -f $hash.Hash, (Split-Path -Leaf $hash.Path);" ^
145+
"Add-Content -Path '.\CHECKSUM-windows-x64.txt' -Value $line"
141146
echo Created: %PROJECT_NAME%-windows-x64.zip
142147
) else (
143148
echo ERROR: Archive not created.

data/rules/anthropic.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ rules:
4646
- report_response: true
4747
- type: WordMatch
4848
words:
49-
- '"type":"invalid_request_error"'
49+
- '"type":"message"'
5050
url: https://api.anthropic.com/v1/messages

data/rules/maxmind.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,44 @@ rules:
1515
- license_key="ZXCVBN_0987654321abcdef1234567890abc_mmk"
1616
references:
1717
- https://dev.maxmind.com/geoip/docs/web-services
18+
depends_on_rule:
19+
- rule_id: kingfisher.maxmind.2
20+
variable: ACCOUNT_ID
1821
validation:
1922
type: Http
2023
content:
2124
request:
2225
method: GET
23-
url: https://geoip.maxmind.com/geoip/v2.1/city/me?license_key={{ TOKEN }}
26+
url: https://geoip.maxmind.com/geoip/v2.1/city/me
2427
headers:
28+
Authorization: "Basic {{ ACCOUNT_ID | append: ':' | append: TOKEN | b64enc }}"
2529
Accept: application/json
2630
response_matcher:
2731
- report_response: true
2832
- type: StatusMatch
2933
status:
3034
- 200
35+
- name: MaxMind Account ID
36+
id: kingfisher.maxmind.2
37+
pattern: |
38+
(?xi)
39+
(?:maxmind|geoip|geolite)
40+
(?:.|[\n\r]){0,40}?
41+
(?:account|user)
42+
(?:.|[\n\r]){0,10}?
43+
(?:id|number)
44+
(?:.|[\n\r]){0,16}?
45+
\b
46+
(
47+
\d{4,8}
48+
)
49+
\b
50+
min_entropy: 2.0
51+
confidence: medium
52+
visible: false
53+
examples:
54+
- MAXMIND_ACCOUNT_ID=123456
55+
- '"maxmind": {"account_id": "654321", "license_key": "..."}'
56+
- 'geoip_account_number: 456789'
57+
references:
58+
- https://dev.maxmind.com/geoip/docs/web-services

data/rules/microsoftteamswebhook.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,14 @@ rules:
2222
type: Http
2323
content:
2424
request:
25-
body: |
26-
{'text':''}
25+
body: '{"text":""}'
2726
headers:
2827
Content-Type: application/json
2928
method: POST
3029
response_matcher:
3130
- type: StatusMatch
3231
status:
33-
- 200
32+
- 400
3433
- report_response: true
3534
type: WordMatch
3635
words:

data/rules/prefect.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ rules:
2020
content:
2121
request:
2222
method: GET
23-
url: https://api.prefect.cloud/api/me
23+
url: https://api.prefect.cloud/api/me/workspaces
2424
headers:
2525
Authorization: 'Bearer {{ TOKEN }}'
2626
Accept: application/json

src/bitbucket.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ impl AuthConfig {
5555
Self { username, password, bearer_token }
5656
}
5757

58+
pub fn from_env() -> Self {
59+
Self::from_options(None, None, None)
60+
}
61+
5862
fn apply(&self, request: reqwest::RequestBuilder) -> reqwest::RequestBuilder {
5963
if let Some(token) = &self.bearer_token {
6064
request.bearer_auth(token)

src/cli/commands/azure.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ pub struct AzureRepoSpecifiers {
4747
pub project: Vec<String>,
4848

4949
/// Include repositories from all projects within the specified organizations
50-
#[arg(long = "azure-all-projects", alias = "all-azure-projects")]
50+
#[arg(long = "all-projects", alias = "azure-all-projects")]
5151
pub all_projects: bool,
5252

5353
/// Skip repositories when enumerating Azure sources (format: ORGANIZATION/PROJECT/REPOSITORY)
@@ -59,7 +59,7 @@ pub struct AzureRepoSpecifiers {
5959
pub exclude_repos: Vec<String>,
6060

6161
/// Filter by repository type
62-
#[arg(long = "azure-repo-type", default_value_t = AzureRepoType::Source)]
62+
#[arg(long = "repo-type", alias = "azure-repo-type", default_value_t = AzureRepoType::Source)]
6363
pub repo_type: AzureRepoType,
6464
}
6565

0 commit comments

Comments
 (0)