Skip to content

Instantly share code, notes, and snippets.

@mattburch
Created March 24, 2014 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattburch/9739742 to your computer and use it in GitHub Desktop.
Save mattburch/9739742 to your computer and use it in GitHub Desktop.
var listVulnerabilitiesByHostIP = function(addr) {
//
// Created by: Matt Burch
// Usage: listVulnerabilitiesByHostIP("x.x.x.x");
// Requires client-side updates: false
var PROJECT_ID = Session.get('projectId');
var vulnerabilities = Vulnerabilities.find({"project_id": PROJECT_ID, "hosts": {"$elemMatch": {"string_addr": addr}}}).fetch();
if (!vulnerabilities) {
return("Vulnerability not found");
}
vulnerabilities.forEach(function(vulnerability){
console.log(vulnerability.title);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment