Commit graph

2635 commits

Author SHA1 Message Date
Kashif Khan
e6c43ca863
ignore https as false postive for slackwebhook detector (#3425) 2024-10-16 05:53:06 -07:00
JonZeolla
4ea311dea9
feat: add github comments timeframe filtering (fixes #3388) (#3390)
* feat: add github comments timeframe filtering

* fixup and generate protos

* Cleanup

---------

Co-authored-by: Zachary Rice <zachary.rice@trufflesec.com>
2024-10-15 15:13:36 -04:00
ahrav
bf38b8480c
[fix] - resource leak (#3402)
* fix resource leak

* add comment

* use errors.Join

* address error wrapping
2024-10-15 12:11:45 -07:00
Abdul Basit
aa17b8eba4
[detector] Implemented Box Detector (#3242)
* Implemented a box detector with test cases.

* corrected comments

* remove generic keyword for box detector
remove PII details of user.

* Added Box Oauth detector
Implemented description for Box detectors.
Separated out test for Box detectors.

* removed user information from ExtraData.

---------

Co-authored-by: 0x1 <13666360+0x1@users.noreply.github.com>
2024-10-15 08:42:37 -05:00
Richard Gomez
34e443adcf
feat: propagate file info in log context (#3405) 2024-10-14 17:13:39 -07:00
Kyle Dodson
cf54b71a94
Update SaladCloud description (#3399) 2024-10-11 15:55:29 -07:00
ahrav
67a3b6df35
fix tests (#3400) 2024-10-11 13:14:03 -07:00
Miccah
fe97978143
[chore] Update custom detector default description (#3398) 2024-10-11 11:49:23 -07:00
Zachary Rice
3ac63414a2
add description to salad (#3397) 2024-10-11 11:55:38 -05:00
Kyle Dodson
58485f3395
Add detector for SaladCloud API Keys (#3273) 2024-10-10 21:23:25 -07:00
Bill Rich
5280c3877c
Add SliceContainsString common util (#3395)
* Add SliceContainsString common util

* Include slice index and string match from slice
2024-10-10 13:23:23 -07:00
Richard Gomez
05015b38f6
Separate detector tests into unit/integration (#3274)
* test: split unit and integration tests

* test: split railway unit/integration

* test(alchemy): add new case
2024-10-10 08:47:40 -05:00
ahrav
e57c712998
Manually upgrade github dep (#3387) 2024-10-10 06:16:40 -07:00
Kashif Khan
bc32592066
Updated Fastly Personal Token Detector (#3386)
* Updated verification API and enhanced the code for fastly personal token detector

* fixed integration test cases and resolved comments

* pass secret to SetVerificationError
2024-10-10 07:50:30 -05:00
Abdul Basit
76ca171765
[Fix] Snowflake privatelink Support (#3286)
* [Fixes]
- handling of `.privatelink` in account identifier
- added unit test for pattern detection.
- fixes hard coded account and username in test.

* variable name fixes
2024-10-09 09:54:14 -05:00
Kashif Khan
321813fe75
Enhanced the easyinsight detector (#3384)
* Enhanced the easyinsight detector

* restructured verification code and resolved comments

* resolved comments

* added basic auth

* updated statuscode logic
2024-10-09 09:52:28 -05:00
Richard Gomez
23afcd77ee
Log skipped files on debug level (#3383) 2024-10-07 20:39:06 -07:00
Dustin Decker
59c615a5e9
Fix git binary handling and add a smoke test (#3379)
* Fix git binary handling and add a smoke test

* hide stdout

* add failure case to smoke test

* run again with deadlock fix

* Add logic to drain reader in the event of an error

* add tests

* be picky

* set author identity

* suppress linter

---------

Co-authored-by: Ahrav Dutta <ahrav.dutta@trufflesec.com>
2024-10-07 13:55:07 -07:00
Kashif Khan
ce5da505a7
Added Cisco Meraki API Key detector (#3367)
* Added cisco meraki apikey detector

* addressed the comments

* handled api response and saving orgs data in extra data

* fixed linter

---------

Co-authored-by: Zachary Rice <zachary.rice@trufflesec.com>
2024-10-07 12:00:45 -05:00
Kashif Khan
23e8ae4a1e
improved the agora detector (#3360)
* improved the agora detector

* updated prefix keywords and test cases

---------

Co-authored-by: Zachary Rice <zachary.rice@trufflesec.com>
2024-10-07 11:39:54 -05:00
ahrav
c98c092a71
[refactor] - Decouple Metrics From Cache Implementation (#3355)
* decouple metrics from cache logic

* delete

* address comments

* update
2024-10-04 13:25:10 -07:00
Kashif Khan
a4cc5f7cc3
Added Pattern test cases for detectors (#3354)
* Added Pattern test cases for detectors

* restructured the unit tests

* Added pattern test cases for few more detectors

* Added pattern test case for 3 more detectors

* formatted testing patterns
2024-10-02 10:44:47 -07:00
ahrav
04eae7af42
remove size check (#3351) 2024-10-02 08:27:33 -07:00
ahrav
b63d6c02a7
[chore] - Rename memory cache package to 'simple' for clarity (#3352)
* rename memory to cache

* Update

* fix imports
2024-10-02 07:48:26 -07:00
Kashif Khan
effee2a912
Fixed github oauth2 token detector (#3353) 2024-10-01 04:07:22 -07:00
ahrav
a5b09951c1
[feat] - Add SizedLRU Cache (#3344)
* add impl for lru sized cache

* update error message

* address comments

* rename

* update comments
2024-09-30 13:18:15 -07:00
ahrav
350db3a11e
[bug] - Recover From Panic During Archive Handling (#3348)
* recover from panic

* clarify comment
2024-09-30 12:45:20 -07:00
ahrav
3dff283bb2
[fix] - Use Parent Context in Azure Detector (#3346)
* use context

* sort imports
2024-09-30 12:13:04 -07:00
Kashif Khan
49cb9d395d
Enhanced the eraser detector to handle new status code from verification API (#3342) 2024-09-27 11:32:58 -05:00
ahrav
ee51fc5cc4
[feat] - Add Generic Hasher Interface with Blake2b Implementation (#3337)
* Add hasher interface and fnv + sha256 implemenations

* update

* remove

* fix test

* update

* remove

* remove

* fix spelling
2024-09-26 20:11:42 -07:00
Miccah
0328a19a9d
[fix] Move detector initialization to DefaultDetectors function (#3341) 2024-09-26 14:03:24 -07:00
Dustin Decker
f3630da1e0
Improve process cleanup (#3339)
* ensures that cmd.Wait() is always called, even if there's a panic in the FromReader function or if stdOut.Close() returns an error

* close stdout and ensure wait is called when handling binaries

* process cleanup improvements

* lint
2024-09-26 10:17:47 -07:00
Richard Gomez
6d022e7d8e
fix(decoder): prevent race (#3031) 2024-09-26 09:44:59 -07:00
ahrav
0ba3fa11ba
Add named params to interface methods (#3335) 2024-09-26 07:06:07 -07:00
Miccah
1a0cf04c3d
[chore] Ensure testing Endpoints() doesn't silently pass on change (#3334)
Since Endpoints() isn't a defined interface, we are testing an
implementation detail of EndpointSetter. If that function changes in
anyway, the test will now fail instead of skipping every detector and
passing.
2024-09-25 15:27:13 -07:00
Miccah
4484bf443b
[fix] Correctly initialize detectors with cloud endpoint customization (#3333)
* [fix] Correctly initialize detectors with cloud endpoint customization

We were only initializing if the detector was configured with a custom
endpoint, but not in the default case.

* Add test

* Fix gitlab.v2 detector
2024-09-25 13:06:00 -07:00
Kashif Khan
eb40243984
RailwayApp Detector (#3331)
* Added RailwayApp detector

* Updated Keywords
2024-09-25 10:17:08 -05:00
dylanTruffle
0f427b3c6a
Adding Descriptions (#3258)
* adding AI generated descriptions of the key types and their capabilities

* removing empty file

* Update abbysale.go

* update to interface

* fixes

* fix

* small cleanup

---------

Co-authored-by: Dylan Ayrey <dxa4481@rit.edu>
Co-authored-by: Dustin Decker <dustin@trufflesec.com>
2024-09-24 16:10:16 -07:00
ahrav
50ff17bd5b
update timeout to 60s (#3330) 2024-09-24 15:13:36 -07:00
Abdul Basit
b612e1e4fd
[Fix] (#3306)
For AWS session token, substring is being searched to avoid false positive session tokens.
Reference: https://nitter.poast.org/TalBeerySec/status/1816449053841838223#m
2024-09-24 11:24:46 -07:00
Kashif Khan
4b6957df66
Endpoint customizer refresh (#3308)
* Refresh EndpointCustomizer for more explicit configuration

Also add CloudProvider interface.

* WIP: Update EndpointSetter

* Updated detectors with new endpoint customizer

* Fixed linter

* Added check for appending cloud endpoints

---------

Co-authored-by: Miccah Castorina <m.castorina93@gmail.com>
2024-09-24 11:41:05 -05:00
Richard Gomez
b2311b4ad2
Ignore glTF & JPEG XL files (#3325)
* feat: ignore glTF files

Inspired by https://github.com/gitleaks/gitleaks/issues/1526

* feat: ignore JPEG XL

* feat: ignore .avifs in addition to .avif
2024-09-24 08:00:02 -07:00
ahrav
26ae7cb09d
[bug] - Improve seekability check for stdout pipes in BufferedReadSeeker (#3189)
* fix bug

* update

* clarify comment

* cleanup

* fix test

* update comment

* remove code for large files

* address comments

* update
2024-09-23 16:55:26 -07:00
Richard Gomez
75557f61ed
Improve MongoDB connection string matching (#1550)
* feat(mongodb): improve conn string matching

* fix(mongodb): err -> verificationErr
2024-09-23 15:42:06 -07:00
Abdul Basit
3e46b3f221
[Analyzer] Test and generated permissions for HuggingFace, Square & Stripe (#3294)
* stripe analyzer unit test

* add huggingface analyzer unit test

* add permissions.yaml for huggingface and fix in analyzer

* square permissions generated

* permissions generated for stripe

* change permissions to lowercase

* skip unknown permissions for square and stripe

---------

Co-authored-by: Abdul Basit <abasit@folio3.com>
2024-09-23 12:17:20 -07:00
Miccah
2f3a410e38
Implement SourceUnitEnumChunker for GitHub (#3298)
* Implement SourceUnitEnumChunker for GitHub

This change refactors the internal scan method to introduce a scanRepo
method to perform the actual scan.

* Export unit fields so the values are captured in the report

* Add comment for scanRepo

* Break out ensureRepoInfoCache into a method

* Update comments and check errors

* Ensure that the repoInfoCache contains the repo during ChunkUnit

* Add integration test for ChunkUnit

* Move s.scanOptions initialization to Init()
2024-09-23 10:56:55 -07:00
Zachary Rice
b78be6d935
hit em w/ a min (#3316) 2024-09-23 11:07:39 -05:00
ahrav
97fd2f80ee
[fix] - Add Size Method to BufferedReadSeeker and Refactor Context Timeout Handling in HandleFile (#3307) 2024-09-23 06:21:07 -07:00
Miccah
77dc2720a8
Update GitHub enumeration to report unique filtered values (#3292)
The reported values should match the values populated in s.repos.
2024-09-18 14:30:10 -07:00
Miccah
b2da2a6a5c
[analyze] Add client filter to detect successful unsafe HTTP requests (#3305)
* Move analyzer client to its own file

* Add analyzer client filter to detect successful unsafe HTTP requests

* Close response body in test
2024-09-18 10:31:21 -07:00