Cisco Cisco Firepower Management Center 2000 Guía Del Desarrollador

Descargar
Página de 102
 
2-46
FireSIGHT System Host Input API Guide
 
Chapter 2      Using the Host Input API 
  Example Host Input API Scripts
warn "AddHost Failed with error $retval";
exit;
}
# From UI: Policies > Application Detectors > User Third-Party Mappings, Set the 
current product map to
# 'Asset Management App' before running SetCurrent3rdPartyMap()
if ($retval = SF::SFDataCorrelator::HostInput::SetCurrent3rdPartyMap
("Asset Management App"))
{
warn "SetCurrent3rdPartyMap Failed with error $retval";
exit;
}
# Set the operating system on the newly created host
if ($retval = SF::SFDataCorrelator::HostInput::SetOS(
$source_type_id, $source_id, "1.2.3.4", [],
{
vendor_str => 'Microsoft',
product_str => 'Windows 2000',
}))
{
warn "SetOS Failed with error $retval";
exit;
}
# Add the transport protocol "ospf" to the newly created host
if ($retval = SF::SFDataCorrelator::HostInput::AddProtocol
($source_type_id, $source_id, "1.2.3.4", [], [],
"ospf", "xport" ))
{
warn "AddProtocol Failed with error $retval";
exit;
}
# Add the OpenSSH server to the host
if ($retval = SF::SFDataCorrelator::HostInput::AddService(
$source_type_id, $source_id, "1.2.3.4", [],
{
port => 22,
proto => 'tcp',
vendor_str => 'OpenSSH',
version_str => '4.1',
service_name => 'ssh'
}))
{
warn "AddService Failed with error $retval";
exit;
}
# Set the Criticality of the host to "Medium"
if ($retval = SF::SFDataCorrelator::HostInput::SetAttributeValue(
$source_type_id, $source_id, "1.2.3.4", [],
"Criticality", "medium" ))
{
warn "SetAttributeValue Failed with error $retval";
exit;
}
# Add a Client Application to all hosts with a Criticality Value of "Medium"
if ($retval = SF::SFDataCorrelator::HostInput::AddClientApp(
$source_type_id, $source_id, "",
[ { attribute => "Criticality", value => "medium"} ],
"BMC Remedy", "Asset Manager", "0.0" ))