feat(censys): Add certificate discovery for domain enrichment #5429
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Enhances the Censys enrichment connector to discover X.509 certificates associated with domain observables, providing more comprehensive threat intelligence for infrastructure mapping and certificate transparency monitoring.
Proposed changes
fetch_certs_by_domain()method to Client class for searching certificates that reference a domain in their namesgenerate_octi_objects_from_domain_certs()method to Converter class for creating STIX certificate objects and relationshipsMotivation
Currently, when enriching a domain observable, the connector only discovers hosts with that domain in their DNS records. However, Censys also provides certificate transparency data that can reveal additional
infrastructure and patterns. This PR adds certificate discovery to provide:
Technical Implementation
The implementation follows the existing connector architecture:
fetch_certs_by_domain()method uses the Censys platform SDK to search for certificates withcert.names = 'domain'querygenerate_octi_objects_from_domain_certs()method reuses existing_generate_certificate()helper to create X509Certificate STIX objects with RELATED_TO relationships to thedomain
Related issues
Checklist
Further comments
Backward Compatibility: This change is fully backward compatible. It adds additional enrichment data for domains but does not modify existing functionality. All other observable types (IPs, certificates)
remain unchanged.
API Impact: Certificate discovery adds one additional Censys API call per domain enrichment. Users should be aware of their Censys API rate limits, which is now documented in the README.
Testing: The implementation is designed to handle:
_generate_certificate()andRelationshippatterns)Code Quality: The implementation follows existing patterns in the codebase: