Created
March 24, 2014 13:09
-
-
Save mattburch/9739742 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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