added some methods for querying the vuln data
This commit is contained in:
parent
01a9373cfd
commit
763de4b83d
1 changed files with 8 additions and 0 deletions
|
@ -12,4 +12,12 @@ class CisaKnownExploit < ActiveRecord::Base
|
||||||
def self.cves_from_year(year)
|
def self.cves_from_year(year)
|
||||||
last.vulnerabilities.select { |vuln| vuln if vuln.dig('cve_id') =~ /CVE-#{year}-\d{4,7}/ }
|
last.vulnerabilities.select { |vuln| vuln if vuln.dig('cve_id') =~ /CVE-#{year}-\d{4,7}/ }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.by_product(product_name)
|
||||||
|
last.vulnerabilities.select {|vuln| vuln if vuln.dig('product') == product_name }
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.by_due_date(due_date)
|
||||||
|
last.vulnerabilities.select {|vuln| vuln if vuln.dig('due_date') == due_date }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue