Class: Risu::Models::Reference
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Risu::Models::Reference
- Defined in:
- lib/risu/models/reference.rb
Overview
Reference Model
Class Method Summary collapse
- .apple_sa ⇒ Object
-
.bid ⇒ Object
Queries all unique BID.
-
.cert ⇒ Object
Queries all unique cert refs.
- .cert_cc ⇒ Object
- .cert_vu ⇒ Object
- .cisco_bug_id ⇒ Object
- .cisco_sa ⇒ Object
- .cisco_sr ⇒ Object
-
.cpe ⇒ Object
Queries all unique CPE.
-
.cve ⇒ Object
Queries all unique CVEs.
-
.cwe ⇒ Object
Queries all unique cwe refs.
-
.dsa ⇒ Object
Queries all unique dsa refs.
-
.edbid ⇒ Object
Queries all unique edbid refs.
-
.iava ⇒ Object
Queries all unique IAVA.
- .iavb ⇒ Object
- .iavt ⇒ Object
- .ics_alert ⇒ Object
- .icsa ⇒ Object
-
.msft ⇒ Object
Queries all unique MSFT.
- .msvr ⇒ Object
-
.osvdb ⇒ Object
Queries all unique OSvdb.
-
.owasp ⇒ Object
Queries all unique owasp refs.
-
.reference_string ⇒ Object
Generates a full string of all the references direct output to the report.
-
.reference_string_by(type) ⇒ String
Generates a string of all the references of the specified type.
-
.rhsa ⇒ Object
Queries all unique rhsa refs.
-
.secunia ⇒ Object
Queries all unique secunia refs.
-
.see_also ⇒ Object
Queries all unique see_also.
-
.suse ⇒ Object
Queries all unique suse refs.
- .usn ⇒ Object
- .vmsa ⇒ Object
Class Method Details
.apple_sa ⇒ Object
215 216 217 |
# File 'lib/risu/models/reference.rb', line 215 def apple_sa where(:reference_name => "apple-sa").select('DISTINCT value') end |
.bid ⇒ Object
Queries all unique BID
83 84 85 |
# File 'lib/risu/models/reference.rb', line 83 def bid where(:reference_name => "bid").select('DISTINCT value') end |
.cert ⇒ Object
Queries all unique cert refs
113 114 115 |
# File 'lib/risu/models/reference.rb', line 113 def cert where(:reference_name => "cert").select('DISTINCT value') end |
.cert_cc ⇒ Object
209 210 211 |
# File 'lib/risu/models/reference.rb', line 209 def cert_cc where(:reference_name => "cert-cc").select('DISTINCT value') end |
.cert_vu ⇒ Object
197 198 199 |
# File 'lib/risu/models/reference.rb', line 197 def cert_vu where(:reference_name => "cert-vu").select('DISTINCT value') end |
.cisco_bug_id ⇒ Object
185 186 187 |
# File 'lib/risu/models/reference.rb', line 185 def cisco_bug_id where(:reference_name => "cisco-bug-id").select('DISTINCT value') end |
.cisco_sa ⇒ Object
173 174 175 |
# File 'lib/risu/models/reference.rb', line 173 def cisco_sa where(:reference_name => "cisco-sa").select('DISTINCT value') end |
.cisco_sr ⇒ Object
191 192 193 |
# File 'lib/risu/models/reference.rb', line 191 def cisco_sr where(:reference_name => "cisco-sr").select('DISTINCT value') end |
.cpe ⇒ Object
Queries all unique CPE
77 78 79 |
# File 'lib/risu/models/reference.rb', line 77 def cpe where(:reference_name => "cpe").select('DISTINCT value') end |
.cve ⇒ Object
Queries all unique CVEs
71 72 73 |
# File 'lib/risu/models/reference.rb', line 71 def cve where(:reference_name => "cve").select('DISTINCT value') end |
.cwe ⇒ Object
Queries all unique cwe refs
155 156 157 |
# File 'lib/risu/models/reference.rb', line 155 def cwe where(:reference_name => "cwe").select('DISTINCT value') end |
.dsa ⇒ Object
Queries all unique dsa refs
143 144 145 |
# File 'lib/risu/models/reference.rb', line 143 def dsa where(:reference_name => "dsa").select('DISTINCT value') end |
.edbid ⇒ Object
Queries all unique edbid refs
119 120 121 |
# File 'lib/risu/models/reference.rb', line 119 def edbid where(:reference_name => "edb-id").select('DISTINCT value') end |
.iava ⇒ Object
Queries all unique IAVA
95 96 97 |
# File 'lib/risu/models/reference.rb', line 95 def iava where(:reference_name => "iava").select('DISTINCT value') end |
.iavb ⇒ Object
161 162 163 |
# File 'lib/risu/models/reference.rb', line 161 def iavb where(:reference_name => "iavb").select('DISTINCT value') end |
.iavt ⇒ Object
167 168 169 |
# File 'lib/risu/models/reference.rb', line 167 def iavt where(:reference_name => "iavt").select('DISTINCT value') end |
.ics_alert ⇒ Object
179 180 181 |
# File 'lib/risu/models/reference.rb', line 179 def ics_alert where(:reference_name => "ics-alert").select('DISTINCT value') end |
.icsa ⇒ Object
221 222 223 |
# File 'lib/risu/models/reference.rb', line 221 def icsa where(:reference_name => "icsa").select('DISTINCT value') end |
.msft ⇒ Object
Queries all unique MSFT
101 102 103 |
# File 'lib/risu/models/reference.rb', line 101 def msft where(:reference_name => "msft").select('DISTINCT value') end |
.msvr ⇒ Object
227 228 229 |
# File 'lib/risu/models/reference.rb', line 227 def msvr where(:reference_name => "msvr").select('DISTINCT value') end |
.osvdb ⇒ Object
Queries all unique OSvdb
107 108 109 |
# File 'lib/risu/models/reference.rb', line 107 def osvdb where(:reference_name => "osvdb").select('DISTINCT value') end |
.owasp ⇒ Object
Queries all unique owasp refs
149 150 151 |
# File 'lib/risu/models/reference.rb', line 149 def owasp where(:reference_name => "owasp").select('DISTINCT value') end |
.reference_string ⇒ Object
Generates a full string of all the references direct output to the report
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/risu/models/reference.rb', line 36 def reference_string reference_names = ["cve", "cpe", "bid", "see_also", "iava", "msft", "osvdb", "cert", "edbid", "rhsa", "secunia", "suse", "dsa", "owasp", "cwe", "iavb", "iavt", "cisco_sa", "ics_alert", "cisco_bug_id", "cisco_sr", "cert_vu", "vmsa", "cert_cc", "msvr", "apple_sa", "icsa" ] ref_string = "" reference_names.each do |type| ref = reference_string_by self.send(type) ref_string << "<b>#{type}</b>: #{ref}\n" if ref.length != 0 end ref_string end |
.reference_string_by(type) ⇒ String
Generates a string of all the references of the specified type
60 61 62 63 64 65 66 67 |
# File 'lib/risu/models/reference.rb', line 60 def reference_string_by type rstring = [] type.each do |ref| rstring << ref.value end rstring.join(", ") end |
.rhsa ⇒ Object
Queries all unique rhsa refs
125 126 127 |
# File 'lib/risu/models/reference.rb', line 125 def rhsa where(:reference_name => "rhsa").select('DISTINCT value') end |
.secunia ⇒ Object
Queries all unique secunia refs
131 132 133 |
# File 'lib/risu/models/reference.rb', line 131 def secunia where(:reference_name => "secunia").select('DISTINCT value') end |
.see_also ⇒ Object
Queries all unique see_also
89 90 91 |
# File 'lib/risu/models/reference.rb', line 89 def see_also where(:reference_name => "see_also").select('DISTINCT value') end |
.suse ⇒ Object
Queries all unique suse refs
137 138 139 |
# File 'lib/risu/models/reference.rb', line 137 def suse where(:reference_name => "suse").select('DISTINCT value') end |
.usn ⇒ Object
233 234 235 |
# File 'lib/risu/models/reference.rb', line 233 def usn where(:reference_name => "usn").select('DISTINCT value') end |
.vmsa ⇒ Object
203 204 205 |
# File 'lib/risu/models/reference.rb', line 203 def vmsa where(:reference_name => "vmsa").select('DISTINCT value') end |