Commit Graph
40 Commits
Author SHA1 Message Date
Muneeb Ullah Khan f9d1850dad [INS-241] Datadogapikey detector (#4627)
* [INS-241] New detector (datadogapikey) for datadog apikeys

* Analyzer updated to cater endpoint

* Added new tests for anlyzers

* Removed print statement

* resolved comments and fixed integration tests.

* resolved comments

* changed cli prompt

* Fixed the comments and added app key validation in analyzer

* renamed regex variable

* Added found verified endpoint to ExtraData

* Clean up Analyze function by removing comments

Removed commented-out code for appKey and endpoint.

* [INS-286] Added support to analyze just the apikey in datadog's analyzer

* fixed linter issue

* fixed comment and introduced snake case to make analyzer code cosistent and also fixed flaky tests

* resolved bugbot comment

* updated protos

* resolve conflicts

* updated protobuffs and resolved bugbot comments

* made regex idiomatic

* fixed ssrf vulnerability

* fixed string formatting
2026-03-11 16:04:51 +05:00
Amaan Ullah bb506f63a1 Analyzer/datadog (#4132)
* task: Datadog analyzer init commit with limited resources and permissions
No cases covered

* task: added more permissions

* task: added more permissions | refactoring

* task: added domain handling

* refactor: incorporated PR feedback

* task: Analyzer Result implementation for enterprise

* task: added tests | Analysis Info configuration changes | permissions.yaml

* revert: reverted datadog detector base URL

* refactor: streamline Datadog API key analysis and permission handling

- Simplified API key retrieval logic by removing redundant checks for "key".
- Enhanced permission binding extraction by introducing a new function for permissions.
- Cleaned up resource binding logic for better clarity and maintainability.
- Removed unnecessary ID fields from scopes.json to reduce clutter.
2025-06-10 11:51:33 -05:00
Shahzad Haider da08d9b0d8 Jiratoken Analyzer (#4193)
* jira token analyzer init

* added api requests in jiratoken analyzer

* more apis added for jira resources

* removed unnecessary code

* added test for jira token analyzer

* repeat resources in analyzer result based on assigned permissions of jira token

* simplified the code

* updated secret manager for analyzer tests
2025-06-06 11:30:47 -05:00
Kashif Khan 9a2b2681e2 Added DataBricks Analyzer (#4135)
* initial commit

* initial structure

* initial commit

* added databricks analyzer

* removed print statement

* resolved ahrav the legend comments

* resolved comments

* fixed issue
2025-05-20 10:55:44 +05:00
Nabeel Alam e23cd77f84 [Feat] Added Dropbox API OAuth2 Token Analyzer (#4080)
* temp

* temp

* adeded analysis info in dropbox detector

* removed unused function

* added scope capabilities in terminal results

* updated dropbox analyzer expected_output.json

* updated dropbox analyzer test expected output

* updated dropbox analyzer test expected output
2025-05-19 15:08:51 -05:00
Abdul Basit 3e87718555 [Feat] Implementation of Posthog Analyzer (#4103)
* initial implementation (unbuildable)

* posthog analyzer done

* cleanup the code and redesign the structure of analyzer info.

* removed unused function.
2025-05-16 17:11:44 +05:00
Nabeel Alam 8da58156fd [Feat] Added Mux API Analyzer (#4128)
* added mux analyzer

* updated mux analyzer print function and mux detector

* updated mux analyzer test expected output
2025-05-16 01:47:06 +05:00
Nabeel Alam 9551a08837 [Feat] Added Ngrok API Key Analyzer (#4110)
* added ngrok analyzer

* updated analyzer test

* added analysis info in ngrok detector

* updated and added pagination in ngrok analyzer

* updated ngrok analyzer expected output detector type

* updated ngrok analyzer removed unused models
2025-05-13 15:57:26 +05:00
Kashif Khan f573da368a Monday App Analyzer (#4120)
* initial commit

* updated monday detector

* close resp body
2025-05-08 08:37:56 -05:00
Kashif Khan 08b7e3b4a9 Fastly Analyzer (#4082)
* initial commit

* added more apis and test cases

* fixed test cases

* added more apis

* fixed analyzer type

* Update launchdarkly_test.go
2025-05-08 12:59:16 +05:00
Kashif Khan d20b3a4760 Netlify Analyzer (#4106)
* initial

* added netlify analyzer
2025-05-05 11:11:01 +05:00
Nabeel AlamandKashif Khan 5b3d6155ca [Feat] Plaid API Analyzer (#4004)
* added plaid api analyzer

* updated plaid analyzer and detector

* updated plaidkey detector verify loop

* added requested changes

* added build tags into detector integration test

* updated plaid analyzer and implemented suggestions

---------

Co-authored-by: Kashif Khan <70996046+kashifkhan0771@users.noreply.github.com>
2025-04-11 19:36:05 +05:00
Nabeel AlamandKashif Khan b2ba219e24 [Feat] Added Figma (PAT) Analyzer (#3974)
* added figma analyzer

* fixed lint issue

* fixed lint issue (2)

* added endpoint config from json

* simplified scope extraction and endpoint configuration

* updated with lint issue fixes

---------

Co-authored-by: Kashif Khan <70996046+kashifkhan0771@users.noreply.github.com>
2025-04-03 19:14:48 +05:00
Kashif Khan c1f2e91223 LaunchDarkly Token Analyzer (#3948)
* initial commit

* added more apis

* added test cases

* removed imposter print statement

* updated some code

* removed id from printResources

* added nabeel suggestion and set analysis info

* resolved ahrav comments

* resolved ahrav comments

* implemented ahrav's suggestion 🔥

* resolved linter error
2025-03-10 08:56:40 -07:00
Kashif Khan 95a2a2a04c Groq Analyzer (#3962)
* added groq analyzer

* print resource if present
2025-03-07 12:23:14 +05:00
Nabeel Alam 59c6f2d1b2 Feature: Airtable Analyzer for Personal Access Tokens (#3941)
* added airtable personal access token analyzer

* updated airtable oauth and pat analyzers

* updated airtable entry in analyzer mapping

* updated airtablepat error checking, table shape

* added more error checks in analyzer code

* updated airtable pat analyzer; incorporated feedback; fixed formating issues; improved code readability

* updated analyzer type int of planetscale expected output json

* fixed spelling in comment

* updated expected output analyzer type numbers
2025-03-04 03:33:19 +05:00
Abdul Basit 590ba66f6b [Feat] Planetscale Analyzer (#3928)
* implemented planetscale anlayzer

* linked detector with analyzer for planetscale.
override input form for TUI.
refactor some variable name for clarrification.

* clean up scopes for planetscale.

* add database and other scopes

* add remaining scopes and refactoring

* updated the analyzer type value in expected output of notion test.

* updated the expected output for analyzers
updated the go-pretty library in planetscale.
added extra information from results to be ignore like AnalysisInfo, ExtraData etc.

* updated expected output of test.
2025-03-03 15:19:21 -06:00
Kashif KhanandEng Zer Jun f7ff9980e3 elevenlabs analyzer (#3850)
* added analyzer initial working structure

* restructured the resources

* added history read api

* added history delete api

* fixed http method issue

* added delete dubbing api and refactored the code

* added dubbing read api

* optimized requests and added projects api

* added pronunciation dictionaries apis

* fixed linter

* added models,audionative,workspace apis

* added some last apis

* Deleted \

* fixed linter

* few more enhancements and test cases added

* added go generate command

* optimized the code and resolved the comments

* fixed linter

* fixed indentation

* resolved comments

* kicked imposter print statement

* formatted cli.go

* Update pkg/analyzer/analyzers/elevenlabs/elevenlabs.go

Co-authored-by: Eng Zer Jun <engzerjun@gmail.com>

* resolved comments

* added secret info methods which safely append and read permission and resources

---------

Co-authored-by: Eng Zer Jun <engzerjun@gmail.com>
2025-02-25 07:59:56 -08:00
Abdul Basit 03e8af1075 [Feat] DigitalOcean Analyzer (#3932)
* digitalocean analyzer implementation

* optimize checkPermissions function to concurrently run tests

* fixed conflict issues.
better commenting
updated the go-pretty import
updated the expected output.

* remove unused functions.
2025-02-24 14:19:07 -06:00
Nabeel Alam 72a515ce74 [Feature] Airtable Analyzer for OAuth Tokens (#3879)
* added airtable analyzer for oauth tokens

* added airtable analyzer cli command
2025-02-19 15:35:36 -06:00
Kashif Khan 7185b31072 anthropic api key analyzer (#3878)
* initial commit

* added anthropic api key analyzer

* added secret info type

* resolved comments
2025-02-12 15:26:27 -06:00
Abdul Basit f2dc96e854 [Feat] implementation Notion analyzer (#3869)
### Description:
Since `Notion.co` allows to enable [capabilities](https://developers.notion.com/reference/capabilities) against integration token, It is a good candidate to build an analyzer for it.
![Screenshot 2025-02-04 at 6 46 37 PM](https://github.com/user-attachments/assets/2fb711fe-466f-4b78-9b25-56852f08cd3b)

This PR implements notion analyzer along with its integration test.


### Checklist:
* [ ] Tests passing (`make test-community`)?
* [x] Lint passing (`make lint` this requires [golangci-lint](https://golangci-lint.run/welcome/install/#local-installation))?
2025-02-11 10:35:31 -08:00
Kashif Khan b10342e5da dockerhub analyzer (#3861)
* dockerhub analyzer

* fixed linter

* added test cases

* resolved comments
2025-02-11 09:31:29 -08:00
Honandmcastorina 03ca8aaa08 Merge analyze tui with trufflehog tui (#3735)
* Move pkg/analyzer/tui to pkg/tui/analyzer

* [WIP] Wire up arguments into the TUI package

* WIP - moving analyze inside tui

Co-authored-by: mcastorina <m.castorina93@gmail.com>

* [WIP] Analyze page

Co-authored-by: hxnyk <8292703+hxnyk@users.noreply.github.com>

* Add SetSize to KeyTypePage

* Use pageHistory stack for proper history traversal

Co-authored-by: hxnyk <8292703+hxnyk@users.noreply.github.com>

* Ongoing work - separate analyze pages

Co-authored-by: mcastorina <m.castorina93@gmail.com>

* Set size on list

Co-authored-by: mcastorina <m.castorina93@gmail.com>

* Pass analyzer as message

Co-authored-by: mcastorina <m.castorina93@gmail.com>

* fix args for analyze

Co-authored-by: mcastorina <m.castorina93@gmail.com>

* Actually run the analysis

Co-authored-by: hxnyk <8292703+hxnyk@users.noreply.github.com>

* Remove analyze_old

Co-authored-by: hxnyk <8292703+hxnyk@users.noreply.github.com>

* remove old comments

Co-authored-by: mcastorina <m.castorina93@gmail.com>

* Remove unused analyzeKeyType

---------

Co-authored-by: Miccah Castorina <m.castorina93@gmail.com>
2025-02-07 12:09:22 -08:00
Abdul Basit 69b6d018d5 [Feat] PrivateKey Analyzer (#3854)
* private key analyzer initial impl  - basic structure

* Impl analyzePermission method for PrivateKey analyzer.
export few private functions for reusability in analyzers

* add permissions.yaml and generate permissions

* permissions fix

* AnalyzeAndPrintPermissions impl

* analyzer test pushed

* Impl analyzer func called from detector.
added and regenerated permissions.

* filter empty strings in result and generate expected_output for test

* some refactoring

* comment added for better readability.

* fixed code breaking changes in detectors due to exporting private functions.

* log insufficient information message on no certificate results
2025-02-04 09:50:57 -06:00
Bill Rich abecab0d8f Remove proto (#3489)
Only used for tracking analyzer types
2024-10-21 17:16:26 -07:00
HonandMiccah Castorina ab8c843fec Analyzer capitalization (#3188)
* capitalization

* Lowercase analyze labels for the subcommand

* Canonicalize input and lowercase when matching command

* add warning

---------

Co-authored-by: Miccah Castorina <m.castorina93@gmail.com>
2024-08-06 17:00:40 -07:00
Miccah a8777fcad9 [analyze] Add analyze option to main TUI and unhide subcommand (#3186)
This is currently a one-way operation. Once you select "analyze" you
cannot get back to the main menu.
2024-08-06 15:30:50 -07:00
Miccah 1df83f79ef [analyze] Separate SID from token in twilio analyzer (#3177)
* [analyze] Separate SID from token in twilio analyzer

* Fix test

* Set sid in detector
2024-08-05 17:46:57 -07:00
Miccah 59fccbcf3f Analyze TUI (#3172)
* Setup TUI entrypoint

* Setup key type selector and form pages

* Add basic confirmation component

* Add basic list selector for analyzer type

* Add form page

* Remove quit confirmation

* Add styles

* Add input text redaction

* Add log file input to form

* Fix some bugs and race conditions

* Remove unused code

* Fix filtering bug
2024-08-05 15:00:46 -07:00
Abdul Basit 6fccac7f3d Separate out printing statements with anlayzer logic for SourceGraph (#3119)
* Separated printing and analyzes functionality for sourcegraph

* remove second call to fetch userinfo in sourcegraph.
2024-07-31 10:08:42 -07:00
Abdul Basit 24b7029d4d Separate out printing statements with anlayzer logic for Stripe (#3120)
* Separated printing and analyzes functionality for stripe

* removed logging enabled check
2024-07-31 07:07:10 -07:00
Abdul Basit a2c7219d65 Separate out printing statements with anlayzer logic for Slack (#3121)
* Separated printing and analyzes functionality for slack

* removed logging enabled check
2024-07-31 07:06:46 -07:00
Abdul Basit 67c01aee6e Separated printing and analyzes functionality for twilio (#3118) 2024-07-30 20:44:44 -07:00
Abdul Basit 02fb3879eb Separated printing and analyzes functionality for square (#3122) 2024-07-30 20:44:07 -07:00
Abdul Basit acd529d9dc Separated printing and analyzes functionality for shopify (#3123) 2024-07-30 20:43:46 -07:00
20de56d441 Analyzer partial implementations (#3114)
* Add POC analyze sub-command

* Address lint errors

* added http logging to most analyzers

* Use custom RoundTripper with default http.Client

* [chore] Embed scopes at compile time

* [chore] Move subcommand check up to prevent printing metrics

* Create framework of interfaces, structs, and protos

* Implement Analyzer for airbrake

* Add FullAccess permission constant

* Implement Analyzer for asana

* Implement Analyzer for bitbucket

* Implement Analyzer for github

* Implement Analyzer for gitlab

* Implemente Analyzer for huggingface

* Implement Analyzer for mailchimp

* implement analyzer for mailgun

* update cli cmd

* Implement analyzer for openai

* fix timing issue on scopes

* print permissions only if restricted key

* Implement Analyzer for mysql

* enable loggin check

* fixed the formatting issue to wrap sub-errors

* implemented analyzer for opsgenie

* implemented analyzer for postgres

* use format string

* implemented analyzer for sendgrid

* simplify returning the error

* implemented analyzer for postman

* added handling of workspace error

* Update protos to match OSS

* Generate protos

* Update data structures to match OSS

* Update airbrake implementation

* Remove asana implementation

* Remove mailchimp implementation

* Update openai implementation to match OSS

* Remove gitlab implementation

* Remove huggingface implementation

* Remove bitbucket implementation

* Fix permission in airbrake

* Remove github implementation

* Remove mailgun implementation

* Cleanup compiler errors

* Implement Analyzer interface for github

* Add parents to github resources

* Add fine_grained to github metadata

* Update with changes from main

* Remove unused function stubs

---------

Co-authored-by: Joe Leon <joe.leon@trufflesec.com>
Co-authored-by: Hon <8292703+hxnyk@users.noreply.github.com>
Co-authored-by: Abdul Basit <abasit@folio3.com>
Co-authored-by: Abdul Basit <basit.mussani@gmail.com>
2024-07-30 09:13:48 -07:00
Miccah 9d089c2188 [analyze] Implement Analyzer interface for github (#3110)
* [analyze] Implement Analyzer interface for github

* Make github repo and user enumeration configurable

* Add AnalysisInfo to github detector

* Use AnalyzeAndPrintPermissions from the CLI
2024-07-26 14:47:03 -07:00
Miccah 8a8ef85265 Implement Analyzer interface for openai (#3101)
* Implement Analyzer interface for openai

* Use organization ID for the FQDN

* Update CLI to print openai permissions
2024-07-25 14:20:01 -07:00
MiccahandJoe Leon 2424683923 Analyze (#3099)
* Add POC analyze sub-command

* Address lint errors

* [chore] Embed scopes at compile time

* [chore] Move subcommand check up to prevent printing metrics

* added http logging to most analyzers

* Use custom RoundTripper with default http.Client

* Create framework of interfaces, structs, and protos

* Merge main

* Add AnalysisInfo to detectors.Result

* Hide analyze subcommand

* Update gen_proto.sh

* Update protos

* Make protos

* Update analyzer data types

* Rename argument to credentialInfo

---------

Co-authored-by: Joe Leon <joe.leon@trufflesec.com>
2024-07-25 12:06:05 -07:00