Class: DeepSecurity::Host

Inherits:
TransportObject show all
Defined in:
lib/deepsecurity/transport_objects/host.rb

Overview

The primary computer transport object that represents the computer systems Deep Security is aware of. Physical computers, virtual machines, ESX servers, and Deep Security Virtual Appliances are all represented as HostTransport objects.

To determine a HostTransport status (e.g., Activated, Offline, Installed, etc.) the computer HostStatusTransport should be retrieved and the assigned ProtectionStatusTransport objects should be inspected. The HostTransportStatus will reflect the overall protection status of a computer. If protection is applied by both an in-guest Agent and Virtual Appliance, then two ProtectionStatusTransport objects will be assigned. Agent and Virtual Appliance protection may have different protection capabilities enabled, so inspection of all assigned ProtectionStatusTransport objects should considered. Note that this is only necessary where a Virtual Appliance is deployed. Computers and virtual machines that only use Agent protection may only use the HostTransportStatus.

Direct Known Subclasses

HostDetail

Constant Summary

Constants inherited from SavonHelper::MappingObject

SavonHelper::MappingObject::BLACK_LIST

High-Level SOAP Wrapper collapse

Instance Attribute Summary collapse

Attributes inherited from SavonHelper::MappingObject

#interface

Attributes included from SavonHelper::DSL

#alias_accessor

High-Level Screenscraping Wrapper collapse

Methods inherited from TransportObject

#manager

Methods inherited from SavonHelper::CachingObject

all_cache_aspects, #cachable?, #cache, cache_aspects, cache_by_aspect, cache_key, #cache_key, from_savon, #store_in_cache

Methods inherited from SavonHelper::MappingObject

all_type_mappings, defined_attributes, from_savon, has_attribute_chain, #initialize, #to_json, #to_s, #to_savon, type_mappings

Methods included from SavonHelper::DSL

#array_boolean_accessor, #array_datetime_accessor, #array_double_accessor, #array_enum_accessor, #array_float__accessor, #array_integer_accessor, #array_ip_address_accessor, #array_object_accessor, #array_string_accessor, #attr_boolean_accessor, #attr_datetime_accessor, #attr_double_accessor, #attr_enum_accessor, #attr_float_accessor, #attr_integer_accessor, #attr_ip_address_accessor, #attr_object_accessor, #attr_string_accessor, #hint_object_accessor

Constructor Details

This class inherits a constructor from SavonHelper::MappingObject

Instance Attribute Details

#descriptionString

Returns:



18
# File 'lib/deepsecurity/transport_objects/host.rb', line 18

attr_string_accessor :description

#display_nameString

Computer display name

Returns:



20
21
# File 'lib/deepsecurity/transport_objects/host.rb', line 20

attr_string_accessor :display_name,
'Computer display name'

#externalBoolean

Administrative external boolean for integration purposes.

Returns:

  • (Boolean)


22
23
# File 'lib/deepsecurity/transport_objects/host.rb', line 22

attr_boolean_accessor :external,
'Administrative external boolean for integration purposes.'

#external_idString

Administrative external ID for integration purposes.

Returns:



24
25
# File 'lib/deepsecurity/transport_objects/host.rb', line 24

attr_string_accessor :external_id,
'Administrative external ID for integration purposes.'

#host_groupObject



82
83
84
# File 'lib/deepsecurity/transport_objects/host.rb', line 82

hint_object_accessor :host_group,
HostGroup,
'The host group this host belongs to'

#host_group_idint

Assigned HostGroupTransport ID

Returns:

  • (int)


26
27
# File 'lib/deepsecurity/transport_objects/host.rb', line 26

attr_integer_accessor :host_group_id,
'Assigned HostGroupTransport ID'

#host_typeEnumHostType

Assigned host type

Returns:



28
29
30
# File 'lib/deepsecurity/transport_objects/host.rb', line 28

attr_enum_accessor :host_type,
EnumHostType,
'Assigned host type'

#idint

Returns:

  • (int)


16
# File 'lib/deepsecurity/transport_objects/host.rb', line 16

attr_integer_accessor :id

#nameString

Returns:



17
# File 'lib/deepsecurity/transport_objects/host.rb', line 17

attr_string_accessor :name

#platformString

Computer platform

Returns:



31
32
# File 'lib/deepsecurity/transport_objects/host.rb', line 31

attr_string_accessor :platform,
'Computer platform'

#security_profile_idint

Assigned SecurityProfileTransport ID

Returns:

  • (int)


33
34
# File 'lib/deepsecurity/transport_objects/host.rb', line 33

attr_integer_accessor :security_profile_id,
'Assigned SecurityProfileTransport ID'

Instance Method Details

#all_dpi_rule_identifiersObject



50
51
52
# File 'lib/deepsecurity/transport_objects/host.rb', line 50

def all_dpi_rule_identifiers
  Manager.current.dpi_rule_identifiers_for_host(@id, 0)
end

#all_dpi_rulesObject



70
71
72
# File 'lib/deepsecurity/transport_objects/host.rb', line 70

def all_dpi_rules
  dpi_rules_from_identifiers(all_dpi_rule_identifiers())
end

#assigned_dpi_rule_identifiersObject



54
55
56
# File 'lib/deepsecurity/transport_objects/host.rb', line 54

def assigned_dpi_rule_identifiers
  Manager.current.dpi_rule_identifiers_for_host(@id, 16)
end

#assigned_dpi_rulesObject



74
75
76
# File 'lib/deepsecurity/transport_objects/host.rb', line 74

def assigned_dpi_rules
  dpi_rules_from_identifiers(assigned_dpi_rule_identifiers())
end

#dpi_rules_from_identifiers(rule_identifiers) ⇒ Object



44
45
46
47
48
# File 'lib/deepsecurity/transport_objects/host.rb', line 44

def dpi_rules_from_identifiers(rule_identifiers)
  dpi_rules = Hash.new()
  Manager.current.dpi_rules.each { |rule| dpi_rules[rule.identifier]=rule }
  rule_identifiers.map { |rule_identifier| dpi_rules[rule_identifier] }
end


62
63
64
# File 'lib/deepsecurity/transport_objects/host.rb', line 62

def recommended__dpi_rule_identifiers
  Manager.current.dpi_rule_identifiers_for_host(@id, 33)
end

#unassigned_dpi_rule_identifiersObject



58
59
60
# File 'lib/deepsecurity/transport_objects/host.rb', line 58

def unassigned_dpi_rule_identifiers
  Manager.current.dpi_rule_identifiers_for_host(@id, 32)
end

#unrecommended__dpi_rule_identifiersObject



66
67
68
# File 'lib/deepsecurity/transport_objects/host.rb', line 66

def unrecommended__dpi_rule_identifiers
  Manager.current.dpi_rule_identifiers_for_host(@id, 18)
end