Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[thog-1548] log verification errors #2107

Closed
wants to merge 6 commits into from

Conversation

0x1
Copy link
Contributor

@0x1 0x1 commented Nov 9, 2023

Description:

Update plaintext logging to include verification error

Current Output

image

Updated Output

image

Checklist:

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

@0x1 0x1 requested review from a team as code owners November 9, 2023 20:30
@0x1 0x1 changed the base branch from main to thog-1548-add-redact-verification-errors November 9, 2023 20:31
@0x1 0x1 force-pushed the thog-1548-log-verification-errors branch from 951b68e to 709c480 Compare November 9, 2023 20:37
@rgmz
Copy link
Contributor

rgmz commented Nov 9, 2023

Related to #1924. From my own experiences enabling this, it would be good to release this feature in tandem with an improvement to the list of known false-positives. For instance, localhost/127.0.0.1/placeholders for URI or database connections.

e.g., this should never even be attempted to be verified:

Found unverified result 🐷🔑❓
Detector Type: JDBC
Decoder Type: BASE64
Raw result: jdbc:postgresql://<IP>/<DBNAME>?cloudSqlInstance=<CONNECTION_NAME>;socketFactory=com.google.cloud.sql.postgres.SocketFactory
...
Verification Error: dial tcp: lookup <IP>: no such host
dial tcp: lookup <IP>: no such host
dial tcp 127.0.0.1:5432: connect: connection refused
dial tcp: lookup <IP>: no such host

The SQLServer pattern is also overly permissive and results in a lot of frequent (and large) verification errors.

Found unverified result 🐷🔑❓
Detector Type: SQLServer
Decoder Type: PLAIN
Raw result: Senha
format=Formato
rule_lowerCase=regra

date=Data
direction=Dire\u00e7\u00e3o
validator=Validador
extractor=Extrator
minor=Secund\u00e1rio
major=Principal
url=URL
displayName=Nome de Exibi\u00e7\u00e3o
deployedBaselines=Linhas de Base Implementadas
enabled=Ativado
debug=Depura\u00e7\u00e3o
rulesetProperties=Propriedades do Conjunto de Regras
... (this goes on for hundreds of lines)
Verification Error: unable to open tcp connection with host 'localhost:1433': dial tcp 127.0.0.1:1433: connect: connection refused

@0x1
Copy link
Contributor Author

0x1 commented Nov 13, 2023

Related to #1924. From my own experiences enabling this, it would be good to release this feature in tandem with an improvement to the list of known false-positives. For instance, localhost/127.0.0.1/placeholders for URI or database connections.

i think placeholders make sense to filter out, but localhost/127 seem useful for internal testers, no?

@rgmz
Copy link
Contributor

rgmz commented Nov 13, 2023

i think placeholders make sense to filter out, but localhost/127 seem useful for internal testers, no?

That makes sense for 172.x, 192.168.x, and 10.x (private IP ranges). Localhost/0.0.0.0/127.0.0.1 will never succeed unless you are already running the service on your local machine, otherwise you'll get a connection refused error.

It's an exceptionally low signal/noise ratio that drowns out legitimate verification errors. Not to mention that "localhost" is often the default for incomplete or incorrect information.

@0x1 0x1 force-pushed the thog-1548-add-redact-verification-errors branch from 61f0b06 to b2f328d Compare December 5, 2023 01:45
Base automatically changed from thog-1548-add-redact-verification-errors to main December 5, 2023 13:57
@0x1
Copy link
Contributor Author

0x1 commented Jan 24, 2024

closed in favor of #2335

@0x1 0x1 closed this Jan 24, 2024
@0x1
Copy link
Contributor Author

0x1 commented Jan 24, 2024

Related to #1924. From my own experiences enabling this, it would be good to release this feature in tandem with an improvement to the list of known false-positives. For instance, localhost/127.0.0.1/placeholders for URI or database connections.

e.g., this should never even be attempted to be verified:

Found unverified result 🐷🔑❓
Detector Type: JDBC
Decoder Type: BASE64
Raw result: jdbc:postgresql://<IP>/<DBNAME>?cloudSqlInstance=<CONNECTION_NAME>;socketFactory=com.google.cloud.sql.postgres.SocketFactory
...
Verification Error: dial tcp: lookup <IP>: no such host
dial tcp: lookup <IP>: no such host
dial tcp 127.0.0.1:5432: connect: connection refused
dial tcp: lookup <IP>: no such host

The SQLServer pattern is also overly permissive and results in a lot of frequent (and large) verification errors.

Found unverified result 🐷🔑❓
Detector Type: SQLServer
Decoder Type: PLAIN
Raw result: Senha
format=Formato
rule_lowerCase=regra

date=Data
direction=Dire\u00e7\u00e3o
validator=Validador
extractor=Extrator
minor=Secund\u00e1rio
major=Principal
url=URL
displayName=Nome de Exibi\u00e7\u00e3o
deployedBaselines=Linhas de Base Implementadas
enabled=Ativado
debug=Depura\u00e7\u00e3o
rulesetProperties=Propriedades do Conjunto de Regras
... (this goes on for hundreds of lines)
Verification Error: unable to open tcp connection with host 'localhost:1433': dial tcp 127.0.0.1:1433: connect: connection refused

will make separate tickets for these since they are not blocking for the log output changes

@rgmz rgmz mentioned this pull request Feb 3, 2024
2 tasks
rosecodym pushed a commit that referenced this pull request Mar 15, 2024
This is a follow-up to #2107 and #2335. It adds a new (hidden) --results flag that allows a user to show any combination of verified, unverified, and indeterminate secrets.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants