Comments (6)
top10vulns = Item.risks_by_plugin(limit)
limit is default to 10. you can do any number really
from risu.
I haven't been able to get the count of the number of the plugins for each of these top 10 items.
How about the top 10 hosts with vulnerabilities?
And the number of hosts with critical, high, medium and low vulnerabilities (as opposed to the number of critical, high, etc.)?
from risu.
just add .all.count or .all.size to the query and it will return the counts.
this is the code from the top 10 hosts ordered by vuln count, not sure exactly what you want as there is a graph that already generates that data if i understand you correctly.
#
#
def top_vuln_graph(limit=10)
g = Gruff::Bar.new(GRAPH_WIDTH)
g.title = sprintf "Top %d Critical/High Finding Count Per Host ", Item.risks_by_host(limit).all.count
g.sort = false
g.theme = {
:colors => %w(red green blue orange yellow purple black grey brown pink),
:background_colors => %w(white white)
}
Item.risks_by_host(limit).all.each do |item|
ip = Host.find_by_id(item.host_id).name
count = Item.where(:host_id => item.host_id).where("severity IN (?)", [2,3]).count
g.data(ip, count)
end
StringIO.new(g.to_blob)
end
Item.where(:severity => 3).group(:host).all.count , should return all hosts with crit vulns
from risu.
Thanks for the code for these counts.
I am putting these counts into text as well as showing the graph in the executive summary which I am working on now.
from risu.
You can take a look at the models lib/nessusdb/models/* for all the helper methods.they are not fully documented yet. I will get them sooner or later.
from risu.
That should actually be: Item.where(:severity => 3).group(:host_id).all.count
from risu.
Related Issues (20)
- Unable to read font error HOT 2
- Data too long for column 'plugin_name' HOT 1
- SQL errors from most reports HOT 2
- SQL error when multiple OSs names are returned by Nessus for an host HOT 3
- VERY slow load speed HOT 16
- New XML elements HOT 3
- Trouble with Execute Summary template HOT 9
- risu's graphs template fails to generate, sqllite error HOT 3
- problem with risu in kali HOT 5
- New HostProperties attribute: UnsupportedProduct HOT 1
- Changing Risk Finding Colors HOT 32
- risu not installed in home directory HOT 2
- Risu won't stay installed on Kali HOT 13
- New XML element detected HOT 4
- New XML element: potential_vulnerability HOT 3
- New XML element. HOT 5
- Add support for attribute 'agent' HOT 7
- Support for multiple files and user-specified templates HOT 4
- Boolean fields stored as strings
- High instead of Critical items selected in findings_host.rb HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from risu.