Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,16 @@

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

## [v1.60.0]
- Removed the `--bitbucket-username`, `--bitbucket-token`, and `--bitbucket-oauth-token` flags in favour of `KF_BITBUCKET_*` environment variables when authenticating to Bitbucket.
- 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`.
- 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.
- 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.
- 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.
- 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`.

## [v1.59.0]
- Fixed `kingfisher scan github …` (and other provider-specific subcommands) so they no longer demand placeholder path arguments before the CLI accepts the request.
- 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.
- Added rules for meraki, duffel, finnhub, frameio, freshbooks, gitter, infracost, launchdarkly, lob, maxmind, messagebird, nytimes, prefect, scalingo, sendinblue, sentry, shippo, twitch, typeform

Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ publish = false

[package]
name = "kingfisher"
version = "1.59.0"
version = "1.60.0"
description = "MongoDB's blazingly fast and accurate secret scanning and validation tool"
edition.workspace = true
rust-version.workspace = true
Expand Down
186 changes: 104 additions & 82 deletions README.md

Large diffs are not rendered by default.

34 changes: 33 additions & 1 deletion data/rules/maxmind.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,48 @@ rules:
- license_key="ZXCVBN_0987654321abcdef1234567890abc_mmk"
references:
- https://dev.maxmind.com/geoip/docs/web-services
depends_on_rule:
- rule_id: kingfisher.maxmind.2
variable: ACCOUNT_ID
validation:
type: Http
content:
request:
method: GET
url: https://geoip.maxmind.com/geoip/v2.1/city/me?license_key={{ TOKEN }}
url: https://geoip.maxmind.com/geoip/v2.1/city/me
headers:
Authorization: "Basic {{ ACCOUNT_ID | append: ':' | append: TOKEN | b64enc }}"
Copy link

Copilot AI Oct 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The filter name 'append' should be 'concat' or similar based on typical templating syntax. Verify the template engine supports 'append' as a filter.

Suggested change
Authorization: "Basic {{ ACCOUNT_ID | append: ':' | append: TOKEN | b64enc }}"
Authorization: "Basic {{ ACCOUNT_ID | concat: ':' | concat: TOKEN | b64enc }}"

Copilot uses AI. Check for mistakes.
Accept: application/json
response_matcher:
- report_response: true
- type: StatusMatch
status:
- 200
- name: MaxMind Account ID
id: kingfisher.maxmind.2
pattern: |
(?xi)
(?:maxmind|geoip|geolite)
(?:.|[\n\r]){0,40}?
(?:account|user)
(?:.|[\n\r]){0,10}?
(?:id|number)
(?:.|[\n\r]){0,10}?
[:=\s]+
\s*
["']?
\b
(
\d{4,8}
)
\b
["']?
min_entropy: 2.0
confidence: low
examples:
- MAXMIND_ACCOUNT_ID=123456
- AccountID 988765
- '"maxmind": {"account_id": "654321", "license_key": "..."}'
- 'geoip_account_number: 456789'
references:
- https://dev.maxmind.com/geoip/docs/web-services
2 changes: 1 addition & 1 deletion data/rules/prefect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ rules:
content:
request:
method: GET
url: https://api.prefect.cloud/api/me
url: https://api.prefect.cloud/api/me/workspaces
headers:
Authorization: 'Bearer {{ TOKEN }}'
Accept: application/json
Expand Down
4 changes: 4 additions & 0 deletions src/bitbucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ impl AuthConfig {
Self { username, password, bearer_token }
}

pub fn from_env() -> Self {
Self::from_options(None, None, None)
}

fn apply(&self, request: reqwest::RequestBuilder) -> reqwest::RequestBuilder {
if let Some(token) = &self.bearer_token {
request.bearer_auth(token)
Expand Down
14 changes: 3 additions & 11 deletions src/cli/commands/bitbucket.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,9 @@ use crate::cli::commands::output::OutputArgs;

#[derive(Args, Debug, Clone, Default)]
pub struct BitbucketAuthArgs {
/// Username for Bitbucket basic authentication (app password or server)
#[arg(long)]
pub bitbucket_username: Option<String>,

/// Bitbucket app password, PAT, or server token
#[arg(long = "bitbucket-token", alias = "bitbucket-password")]
pub bitbucket_token: Option<String>,

/// Bitbucket OAuth token for bearer authentication
#[arg(long = "bitbucket-oauth-token", alias = "bitbucket-oauth")]
pub bitbucket_oauth_token: Option<String>,
/// Bitbucket credentials are sourced from KF_BITBUCKET_* environment variables.
#[arg(skip)]
_env_only: (),
}

/// Top-level Bitbucket command group
Expand Down
Loading
Loading