Documentation ¶
Overview ¶
Package graph implements the graph data structures used by certgraph to build the certificate graph
Index ¶
- type CertGraph
- func (graph *CertGraph) AddCert(certNode *CertNode)
- func (graph *CertGraph) AddDomain(domainNode *DomainNode)
- func (graph *CertGraph) DomainDepth() uint
- func (graph *CertGraph) GenerateMap() map[string]interface{}
- func (graph *CertGraph) GetCert(fp fingerprint.Fingerprint) (*CertNode, bool)
- func (graph *CertGraph) GetDomain(domain string) (*DomainNode, bool)
- func (graph *CertGraph) GetDomainNeighbors(domain string, cdn bool, maxSANsSize int) []string
- func (graph *CertGraph) NumDomains() int
- type CertNode
- type DomainNode
- func (d *DomainNode) AddCertFingerprint(fp fingerprint.Fingerprint, certSource string)
- func (d *DomainNode) AddRelatedDomains(domains []string)
- func (d *DomainNode) AddStatusMap(m status.Map)
- func (d *DomainNode) CheckForDNS(timeout time.Duration) (bool, error)
- func (d *DomainNode) GetCertificates() []fingerprint.Fingerprint
- func (d *DomainNode) String() string
- func (d *DomainNode) ToMap() map[string]string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CertGraph ¶
type CertGraph struct {
// contains filtered or unexported fields
}
CertGraph main graph storage engine
func (*CertGraph) AddDomain ¶
func (graph *CertGraph) AddDomain(domainNode *DomainNode)
AddDomain add a DomainNode to the graph
func (*CertGraph) DomainDepth ¶
DomainDepth returns the maximum depth of the graph from the initial root domains
func (*CertGraph) GenerateMap ¶
GenerateMap returns a map representation of the certificate graph used for JSON serialization
func (*CertGraph) GetCert ¶
func (graph *CertGraph) GetCert(fp fingerprint.Fingerprint) (*CertNode, bool)
GetCert returns (CertNode, found) for the certificate with the provided Fingerprint in the graph if found
func (*CertGraph) GetDomain ¶
func (graph *CertGraph) GetDomain(domain string) (*DomainNode, bool)
GetDomain returns (DomainNode, found) for the domain in the graph if found
func (*CertGraph) GetDomainNeighbors ¶
GetDomainNeighbors given a domain, return the list of all other domains that share a certificate with the provided domain that are in the graph cdn will include CDN certs as well
func (*CertGraph) NumDomains ¶
NumDomains returns the number of domains in the graph
type CertNode ¶
type CertNode struct { Fingerprint fingerprint.Fingerprint Domains []string // contains filtered or unexported fields }
CertNode graph node to store certificate information
func (*CertNode) CDNCert ¶
CDNCert returns true if we think the certificate belongs to a CDN very weak detection, only supports fastly & cloudflare
type DomainNode ¶
type DomainNode struct { Domain string Depth uint Certs map[fingerprint.Fingerprint][]string RelatedDomains status.Map Status status.Status Root bool HasDNS bool }
DomainNode structure to store a domain and its edges
func NewDomainNode ¶
func NewDomainNode(domain string, depth uint) *DomainNode
NewDomainNode constructor for DomainNode, converts domain to lower nonWildcard
func (*DomainNode) AddCertFingerprint ¶
func (d *DomainNode) AddCertFingerprint(fp fingerprint.Fingerprint, certSource string)
AddCertFingerprint appends a Fingerprint to the DomainNode's list of certificates
func (*DomainNode) AddRelatedDomains ¶
func (d *DomainNode) AddRelatedDomains(domains []string)
AddRelatedDomains adds the domains in the provided array to the domainNode's related domains status map with an unknown status if they are not already in the map
func (*DomainNode) AddStatusMap ¶
func (d *DomainNode) AddStatusMap(m status.Map)
AddStatusMap adds the status' in the map to the DomainNode also sets the Node's own status if it is in the Map side effect: will delete its own status from the provided map
func (*DomainNode) CheckForDNS ¶
func (d *DomainNode) CheckForDNS(timeout time.Duration) (bool, error)
CheckForDNS checks for the existence of DNS records for the domain's apex sets the value to the node and returns the result as well
func (*DomainNode) GetCertificates ¶
func (d *DomainNode) GetCertificates() []fingerprint.Fingerprint
GetCertificates returns a list of known certificate fingerprints for the domain
func (*DomainNode) String ¶
func (d *DomainNode) String() string
String returns the string representation of a node
func (*DomainNode) ToMap ¶
func (d *DomainNode) ToMap() map[string]string
ToMap returns a map of the DomainNode's fields (weak serialization)