Django novice question here :)
I have the following model
Domain:
domain_name
domain_description
These domains can be scanned multiple times
The other model is
ScanHistory:
last_scan_date
scan_status
domain_name = models.ForeignKey(Domain, on_delete=models.CASCADE)
When scanned, these domains produce several subdomains
ScannedHost:
subdomain
cname
scan_history = models.ForeignKey(ScanHistory, on_delete=models.CASCADE)
These subdomains will have vulnerabilities associated with it
VulnerabilityScan:
vulnerability_of = models.ForeignKey(ScanHistory, on_delete=models.CASCADE)
severity
vulnerability_name
How do I find out the domain which are top 3 most vulnerable Domain? A most vulnerable Domain is any domain that has the highest count of Unique Vulnerability despite n numbers of time it is scanned.
I stumbled upon Django annotate, but I don't seem to solve this.