Class: Nexpose::SyslogAlert
Overview
Description
Object that represents a Syslog Alert.
Instance Attribute Summary collapse
-
#enabled ⇒ Object
readonly
If this alert is enabled or not.
-
#name ⇒ Object
readonly
A unique name for this alert.
-
#server ⇒ Object
readonly
The Syslog server to sent this alert.
-
#type ⇒ Object
readonly
The alert type.
-
#vulnFilter ⇒ Object
readonly
The vulnerability filter to trigger the alert.
Instance Method Summary collapse
-
#initialize(name, server, enabled = 1) ⇒ SyslogAlert
constructor
A new instance of SyslogAlert.
-
#setVulnFilter(vulnFilter) ⇒ Object
Sets the Vulnerability Filter for this alert.
- #to_xml ⇒ Object
Methods included from Sanitize
Constructor Details
#initialize(name, server, enabled = 1) ⇒ SyslogAlert
Returns a new instance of SyslogAlert.
1768 1769 1770 1771 1772 1773 1774 1775 1776 |
# File 'lib/nexpose.rb', line 1768 def initialize(name, server, enabled = 1) @type = :syslog @name = name @server = server @enabled = enabled # Sets default vuln filter - All Events setVulnFilter(VulnFilter.new("50790400",1)) end |
Instance Attribute Details
#enabled ⇒ Object (readonly)
If this alert is enabled or not
1760 1761 1762 |
# File 'lib/nexpose.rb', line 1760 def enabled @enabled end |
#name ⇒ Object (readonly)
A unique name for this alert
1758 1759 1760 |
# File 'lib/nexpose.rb', line 1758 def name @name end |
#server ⇒ Object (readonly)
The Syslog server to sent this alert
1762 1763 1764 |
# File 'lib/nexpose.rb', line 1762 def server @server end |
#type ⇒ Object (readonly)
The alert type
1766 1767 1768 |
# File 'lib/nexpose.rb', line 1766 def type @type end |
#vulnFilter ⇒ Object (readonly)
The vulnerability filter to trigger the alert
1764 1765 1766 |
# File 'lib/nexpose.rb', line 1764 def vulnFilter @vulnFilter end |
Instance Method Details
#setVulnFilter(vulnFilter) ⇒ Object
Sets the Vulnerability Filter for this alert.
1779 1780 1781 |
# File 'lib/nexpose.rb', line 1779 def setVulnFilter(vulnFilter) @vulnFilter = vulnFilter end |
#to_xml ⇒ Object
1784 1785 1786 1787 1788 1789 1790 1791 1792 |
# File 'lib/nexpose.rb', line 1784 def to_xml xml = "<syslogAlert" xml << %Q{ name="#{replace_entities(name)}"} xml << %Q{ enabled="#{replace_entities(enabled)}"} xml << %Q{ server="#{replace_entities(server)}">} xml << vulnFilter.to_xml xml << "</syslogAlert>" xml end |