Skip to content

[INS-334] Octopus Deploy detector#4787

Open
MuneebUllahKhan222 wants to merge 5 commits intotrufflesecurity:mainfrom
MuneebUllahKhan222:oct-deploy-detector
Open

[INS-334] Octopus Deploy detector#4787
MuneebUllahKhan222 wants to merge 5 commits intotrufflesecurity:mainfrom
MuneebUllahKhan222:oct-deploy-detector

Conversation

@MuneebUllahKhan222
Copy link
Copy Markdown
Contributor

@MuneebUllahKhan222 MuneebUllahKhan222 commented Mar 4, 2026

Description

This PR adds the Octopus Deploy API Key Detector for TruffleHog.
It scans for Octopus Deploy API tokens (prefix API- with 29–34 uppercase alphanumerics) and optionally verifies them via the official API.

Regex: \b(API-[A-Z0-9]{29,34})\b

Verification

For verification, we use the Octopus Deploy Users API: /api/users/me. We send a GET request with the token in the X-Octopus-ApiKey: <token> header. A response code of 200 OK means the token is valid. 401 means it is invalid or revoked, and 403 means it is valid but has insufficient permissions.

This API endpoint is part of the official Octopus Deploy API and can be used safely for verification. It is read-only and does not perform any destructive actions.

Corpora Test

The detector does not appear in the list.
image

Checklist:

  • Tests passing (make test-community)?
  • Lint passing (make lint this requires golangci-lint)?

Note

Medium Risk
Adds a new detector that can make outbound HTTP verification calls to Octopus Deploy cloud instances; incorrect matching/verification behavior could impact scan performance or false-positive/negative rates.

Overview
Adds a new octopusdeploy detector that finds Octopus Deploy Cloud hostnames and API keys, emitting results keyed as url:token and optionally verifying tokens by calling GET /api/users/me with the X-Octopus-ApiKey header.

Registers the new detector in the default detector list and introduces a new DetectorType_OctopusDeploy enum value in proto/detectors.proto (with regenerated detectors.pb.go). Includes unit, integration, and benchmark coverage for matching and verification error handling.

Reviewed by Cursor Bugbot for commit 8e4cb9b. Bugbot is set up for automated code reviews on this repo. Configure here.

@MuneebUllahKhan222 MuneebUllahKhan222 requested a review from a team March 4, 2026 10:01
@MuneebUllahKhan222 MuneebUllahKhan222 requested review from a team as code owners March 4, 2026 10:01
Copy link
Copy Markdown
Contributor

@amanfcp amanfcp left a comment

Choose a reason for hiding this comment

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

LGTM!

A couple of non-blocking comments..

Comment thread pkg/detectors/octopusdeploy/octopusdeploy.go
Comment thread pkg/detectors/octopusdeploy/octopusdeploy.go
Comment thread proto/detectors.proto Outdated
Comment thread pkg/detectors/octopusdeploy/octopusdeploy.go
Copy link
Copy Markdown
Contributor

@shahzadhaider1 shahzadhaider1 left a comment

Choose a reason for hiding this comment

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

Let's add the detector to the engine defaults as well

Comment thread pkg/detectors/octopusdeploy/octopusdeploy.go
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Comment thread pkg/detectors/octopusdeploy/octopusdeploy.go Outdated
Comment thread pkg/detectors/octopusdeploy/octopusdeploy.go
Expanded the description of Octopus Deploy to include additional functionalities related to API keys.
@MuneebUllahKhan222 MuneebUllahKhan222 added the review/product-eng Team integrations reviewed, awaiting product-eng review label Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review/product-eng Team integrations reviewed, awaiting product-eng review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants