Last active
July 17, 2024 20:44
-
-
Save renatogroffe/f0db08cee9be6bd0c0b093d0db38f4d4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This plugin searches for SQL Server, Azure SQL and PostgreSQL connection strings. | |
""" | |
import re | |
from detect_secrets.plugins.base import RegexBasedDetector | |
class ConnectionStringDetector(RegexBasedDetector): | |
"""Scans for Connection Strings for SQL Server, Azure SQL and PostgreSQL.""" | |
secret_type = 'Connection String (SQL Server, Azure SQL, PostgreSQL)' | |
denylist = [ | |
re.compile(r'(Server|Data Source|Address|Addr|Network Address)=.*', re.IGNORECASE), | |
re.compile(r'(Initial Catalog|Database)=.*', re.IGNORECASE), | |
re.compile(r'(User Id|Password|Integrated Security)=.*', re.IGNORECASE), | |
re.compile(r'(host|serverr|port|dbname|database|user|user id|password=)=.*', re.IGNORECASE) | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment