Skip to content

/AWS1/IF_GDY=>GETMALWARESCAN()

About GetMalwareScan

Retrieves the detailed information for a specific malware scan. Each member account can view the malware scan details for their own account. An administrator can view malware scan details for all accounts in the organization.

There might be regional differences because some data sources might not be available in all the Amazon Web Services Regions where GuardDuty is presently supported. For more information, see Regions and endpoints.

Method Signature

METHODS /AWS1/IF_GDY~GETMALWARESCAN
  IMPORTING
    !IV_SCANID TYPE /AWS1/GDYSTRING OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_gdygetmalwarescanrsp
  RAISING
    /AWS1/CX_GDYBADREQUESTEX
    /AWS1/CX_GDYINTERNALSERVERER00
    /AWS1/CX_GDYRESOURCENOTFOUNDEX
    /AWS1/CX_GDYCLIENTEXC
    /AWS1/CX_GDYSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_scanid TYPE /AWS1/GDYSTRING /AWS1/GDYSTRING

A unique identifier that gets generated when you invoke the API without any error. Each malware scan has a corresponding scan ID. Using this scan ID, you can monitor the status of your malware scan.

RETURNING

oo_output TYPE REF TO /aws1/cl_gdygetmalwarescanrsp /AWS1/CL_GDYGETMALWARESCANRSP

Domain /AWS1/RT_ACCOUNT_ID
Primitive Type NUMC

Examples

Syntax Example

This is an example of the syntax for calling the method. It includes every possible argument and initializes every possible value. The data provided is not necessarily semantically accurate (for example the value "string" may be provided for something that is intended to be an instance ID, or in some cases two arguments may be mutually exclusive). The syntax shows the ABAP syntax for creating the various data structures.

DATA(lo_result) = lo_client->getmalwarescan( |string| ).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_nonemptystring = lo_result->get_scanid( ).
  lv_detectorid = lo_result->get_detectorid( ).
  lv_detectorid = lo_result->get_admindetectorid( ).
  lv_nonemptystring = lo_result->get_resourcearn( ).
  lv_malwareprotectionresour = lo_result->get_resourcetype( ).
  lv_nonnegativeinteger = lo_result->get_scannedresourcescount( ).
  lv_nonnegativeinteger = lo_result->get_skippedresourcescount( ).
  lv_nonnegativeinteger = lo_result->get_failedresourcescount( ).
  LOOP AT lo_result->get_scannedresources( ) into lo_row.
    lo_row_1 = lo_row.
    IF lo_row_1 IS NOT INITIAL.
      lv_nonemptystring = lo_row_1->get_scannedresourcearn( ).
      lv_malwareprotectionresour = lo_row_1->get_scannedresourcetype( ).
      lv_malwareprotectionscanst = lo_row_1->get_scannedresourcestatus( ).
      lv_scanstatusreason = lo_row_1->get_scanstatusreason( ).
      lo_scannedresourcedetails = lo_row_1->get_resourcedetails( ).
      IF lo_scannedresourcedetails IS NOT INITIAL.
        lo_volumedetail = lo_scannedresourcedetails->get_ebsvolume( ).
        IF lo_volumedetail IS NOT INITIAL.
          lv_string = lo_volumedetail->get_volumearn( ).
          lv_string = lo_volumedetail->get_volumetype( ).
          lv_string = lo_volumedetail->get_devicename( ).
          lv_integer = lo_volumedetail->get_volumesizeingb( ).
          lv_string = lo_volumedetail->get_encryptiontype( ).
          lv_string = lo_volumedetail->get_snapshotarn( ).
          lv_string = lo_volumedetail->get_kmskeyarn( ).
        ENDIF.
        lo_ebssnapshot = lo_scannedresourcedetails->get_ebssnapshot( ).
        IF lo_ebssnapshot IS NOT INITIAL.
          lv_nonemptystring = lo_ebssnapshot->get_devicename( ).
        ENDIF.
      ENDIF.
    ENDIF.
  ENDLOOP.
  lo_scanconfiguration = lo_result->get_scanconfiguration( ).
  IF lo_scanconfiguration IS NOT INITIAL.
    lv_nonemptystring = lo_scanconfiguration->get_role( ).
    lo_triggerdetails = lo_scanconfiguration->get_triggerdetails( ).
    IF lo_triggerdetails IS NOT INITIAL.
      lv_nonemptystring = lo_triggerdetails->get_guarddutyfindingid( ).
      lv_nonemptystring = lo_triggerdetails->get_description( ).
      lv_triggertype = lo_triggerdetails->get_triggertype( ).
    ENDIF.
    lo_incrementalscandetails = lo_scanconfiguration->get_incrementalscandetails( ).
    IF lo_incrementalscandetails IS NOT INITIAL.
      lv_nonemptystring = lo_incrementalscandetails->get_baselineresourcearn( ).
    ENDIF.
    lo_scanconfigurationrecove = lo_scanconfiguration->get_recoverypoint( ).
    IF lo_scanconfigurationrecove IS NOT INITIAL.
      lv_nonemptystring = lo_scanconfigurationrecove->get_backupvaultname( ).
    ENDIF.
  ENDIF.
  lv_scancategory = lo_result->get_scancategory( ).
  lv_malwareprotectionscanst = lo_result->get_scanstatus( ).
  lv_scanstatusreason = lo_result->get_scanstatusreason( ).
  lv_malwareprotectionscanty = lo_result->get_scantype( ).
  lv_timestamp = lo_result->get_scanstartedat( ).
  lv_timestamp = lo_result->get_scancompletedat( ).
  lo_getmalwarescanresultdet = lo_result->get_scanresultdetails( ).
  IF lo_getmalwarescanresultdet IS NOT INITIAL.
    lv_scanresultstatus = lo_getmalwarescanresultdet->get_scanresultstatus( ).
    lv_positivelong = lo_getmalwarescanresultdet->get_skippedfilecount( ).
    lv_positivelong = lo_getmalwarescanresultdet->get_failedfilecount( ).
    lv_positivelong = lo_getmalwarescanresultdet->get_threatfoundfilecount( ).
    lv_positivelong = lo_getmalwarescanresultdet->get_totalfilecount( ).
    lv_positivelong = lo_getmalwarescanresultdet->get_totalbytes( ).
    lv_positivelong = lo_getmalwarescanresultdet->get_uniquethreatcount( ).
    LOOP AT lo_getmalwarescanresultdet->get_threats( ) into lo_row_2.
      lo_row_3 = lo_row_2.
      IF lo_row_3 IS NOT INITIAL.
        lv_nonemptystring = lo_row_3->get_name( ).
        lv_detectionsource = lo_row_3->get_source( ).
        lv_positivelong = lo_row_3->get_count( ).
        lv_nonemptystring = lo_row_3->get_hash( ).
        LOOP AT lo_row_3->get_itemdetails( ) into lo_row_4.
          lo_row_5 = lo_row_4.
          IF lo_row_5 IS NOT INITIAL.
            lv_nonemptystring = lo_row_5->get_resourcearn( ).
            lv_nonemptystring = lo_row_5->get_itempath( ).
            lv_string = lo_row_5->get_hash( ).
            lo_additionalinfo = lo_row_5->get_additionalinfo( ).
            IF lo_additionalinfo IS NOT INITIAL.
              lv_nonemptystring = lo_additionalinfo->get_versionid( ).
              lv_nonemptystring = lo_additionalinfo->get_devicename( ).
            ENDIF.
          ENDIF.
        ENDLOOP.
      ENDIF.
    ENDLOOP.
  ENDIF.
ENDIF.