lib/tasks/enrich/network_service.rb
def run
    _log "Enriching... Network Service: #{_get_entity_name}"

    ###
    ### First, normalize the nane - split out the various attributes
    ###
    entity_name = _get_entity_name
    ip_address = entity_name.split(":").first
    port = entity_name.split(":").last.split("/").first.to_i
    proto = entity_name.split(":").last.split("/").first.upcase

    _set_entity_detail("ip_address", ip_address) unless _get_entity_detail("ip_address")
    _set_entity_detail("port", port) unless _get_entity_detail("port")
    _set_entity_detail("proto", proto) unless _get_entity_detail("proto")

    ###
    ###
    ###
    fingerprint_service(ip_address, port) 
    
    ###
    ### Handle SNMP as a special treat
    ###
    enrich_snmp if port == 161 && proto.upcase == "UDP"

  end
## Default method, subclasses must override this
Default method, subclasses must override this
Default method subclasses must override this
def run
    _log "Enriching... Network Service: #{_get_entity_name}"
     First, normalize the nane - split out the various attributes
    entity_name = _get_entity_name
    ip_address = entity_name.split(":").first
    port = entity_name.split(":").last.split("/").first.to_i
    proto = entity_name.split(":").last.split("/").first.upcase
    _set_entity_detail("ip_address", ip_address) unless _get_entity_detail("ip_address")
    _set_entity_detail("port", port) unless _get_entity_detail("port")
    _set_entity_detail("proto", proto) unless _get_entity_detail("proto")
    fingerprint_service(ip_address, port) 
     Handle SNMP as a special treat
    enrich_snmp if port == 161 && proto.upcase == "UDP"
  end
def run _log "Enriching... Network Service: #{_get_entity_name}" entity_name = _get_entity_name ip_address = entity_name . split ( ":" ) . first port = entity_name . split ( ":" ) . last . split ( "/" ) . first . to_i proto = entity_name . split ( ":" ) . last . split ( "/" ) . first . upcase _set_entity_detail ( "ip_address" , ip_address ) unless _get_entity_detail ( "ip_address" ) _set_entity_detail ( "port" , port ) unless _get_entity_detail ( "port" ) _set_entity_detail ( "proto" , proto ) unless _get_entity_detail ( "proto" ) fingerprint_service ( ip_address , port ) enrich_snmp if port == 161 && proto . upcase == "UDP" end
Default method, subclasses must override this
Default method subclasses must override this
### ### First, normalize the nane - split out the various attributes ### ### ### ### ### ### Handle SNMP as a special treat ###