Skip to content

adding tls certificate match to proto.txt#3099

Open
kalindafab wants to merge 3 commits intontop:devfrom
kalindafab:feature/tls-cert-protos-file-3021
Open

adding tls certificate match to proto.txt#3099
kalindafab wants to merge 3 commits intontop:devfrom
kalindafab:feature/tls-cert-protos-file-3021

Conversation

@kalindafab
Copy link
Copy Markdown
Contributor

Please sign (check) the below before submitting the Pull Request:

Link to the related issue:#3021

Describe changes:
Adds support for dynamic TLS certificate–based subprotocol detection using a new @tls_cert: rule syntax. Rules are parsed at runtime, stored in the detection module, and matched against TLS certificate Subject/Issuer fields during inspection.

The implementation follows existing dynamic rule patterns as @ja4:, @ndpifp:), includes proper initialization/cleanup.

Request for Review:

@lucaderi Hi! I'm working on implementing this feature but running into a protocol name parsing issue. The error messages suggest the protocol name is being extracted from the certificate pattern rather than from before the @tls_cert: part.

Could you point me to how protocol names are supposed to be extracted for new attribute types? Looking at the existing @ja4: and @ndpifp: handlers, I tried to follow the same pattern, but something isn't working correctly.

Any guidance would be appreciated! Happy to make any changes needed.

@IvanNardi
Copy link
Copy Markdown
Collaborator

@kalindafab, could you add a simple example rule in protos.txt with a matching pcap, please? Hopefully, with a new, self-signed certificate, to try to avoid matching with "real" traffic...
In other words, just a unit test for this new feature....

@sonarqubecloud
Copy link
Copy Markdown

@kalindafab
Copy link
Copy Markdown
Contributor Author

I added unit test but the parsing issue is so complex :)
Screenshot from 2026-01-27 13-04-29

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Mar 2, 2026

@lucaderi
Copy link
Copy Markdown
Member

We need to match the certificate hash, not the .pem certificate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants