trufflesecurity / trufflehog

Find, verify, and analyze leaked credentials
https://trufflesecurity.com
GNU Affero General Public License v3.0
15.78k stars 1.64k forks source link

[request] Add PyMySQL connection object detector #833

Open bugbaba opened 1 year ago

bugbaba commented 1 year ago

Community Note

Description

Hello Team :)

Currently the truffleHog is not having any detector for PyMySQL connection object. Its a famouse python library to connect with mysql database.

Problem to be Addressed

PyMySQL connection objection not detected by trufflehog.

Description of the Preferred Solution

Add a detector to detect PyMySQL connection object in the code. We should look for pymysql.connect(.*) in th code and then parse the host, username, password to verify the credentials.

Additional Context

Basic regex which can be used for detection part : https://regex101.com/r/nMcIUK/1

References

Official PyMySQL documentation: https://pymysql.readthedocs.io/en/latest/index.html

-- Regards, @bugbaba

Fenrisfulsur commented 1 year ago

Hi, I would like to contribute to this issue, is it still open / possible ?

bugbaba commented 1 year ago

@Fenrisfulsur yes its still open.

Fenrisfulsur commented 1 year ago

Ok, I will start to work on it then.

Fenrisfulsur commented 1 year ago

Hi, I have a question regarding the test case i have to provided with the detector, I've read the Adding_Detectors_external.md, is it mandatory to provide a working test that can verify the secret ? because in my case it would require setting up a mysql database. Can i provided only "found, unverified" test case ?