Skip to content

/AWS1/IF_SAG=>CREATETHREATMODEL()

About CreateThreatModel

Creates a new threat model configuration in an agent space. A threat model defines the parameters for automated threat analysis.

Method Signature

METHODS /AWS1/IF_SAG~CREATETHREATMODEL
  IMPORTING
    !IV_TITLE TYPE /AWS1/SAGSTRING OPTIONAL
    !IV_AGENTSPACEID TYPE /AWS1/SAGSTRING OPTIONAL
    !IV_DESCRIPTION TYPE /AWS1/SAGSTRING OPTIONAL
    !IO_ASSETS TYPE REF TO /AWS1/CL_SAGASSETS OPTIONAL
    !IT_SCOPEDOCS TYPE /AWS1/CL_SAGDOCUMENTINFO=>TT_DOCUMENTLIST OPTIONAL
    !IV_SERVICEROLE TYPE /AWS1/SAGSERVICEROLE OPTIONAL
    !IO_LOGCONFIG TYPE REF TO /AWS1/CL_SAGCLOUDWATCHLOG OPTIONAL
    !IO_REPORTDESTINATION TYPE REF TO /AWS1/CL_SAGREPORTDESTINATION OPTIONAL
  RETURNING
    VALUE(OO_OUTPUT) TYPE REF TO /aws1/cl_sagcreatethrtmodelout
  RAISING
    /AWS1/CX_SAGCLIENTEXC
    /AWS1/CX_SAGSERVEREXC
    /AWS1/CX_RT_TECHNICAL_GENERIC
    /AWS1/CX_RT_SERVICE_GENERIC.

IMPORTING

Required arguments:

iv_title TYPE /AWS1/SAGSTRING /AWS1/SAGSTRING

The title of the threat model.

iv_agentspaceid TYPE /AWS1/SAGSTRING /AWS1/SAGSTRING

The unique identifier of the agent space to create the threat model in.

iv_servicerole TYPE /AWS1/SAGSERVICEROLE /AWS1/SAGSERVICEROLE

The IAM service role to use for the threat model.

Optional arguments:

iv_description TYPE /AWS1/SAGSTRING /AWS1/SAGSTRING

A description of the application or system being threat modeled.

io_assets TYPE REF TO /AWS1/CL_SAGASSETS /AWS1/CL_SAGASSETS

The assets to include in the threat model.

it_scopedocs TYPE /AWS1/CL_SAGDOCUMENTINFO=>TT_DOCUMENTLIST TT_DOCUMENTLIST

The scoped documents for the agent to focus on during threat modeling.

io_logconfig TYPE REF TO /AWS1/CL_SAGCLOUDWATCHLOG /AWS1/CL_SAGCLOUDWATCHLOG

The CloudWatch Logs configuration for the threat model.

io_reportdestination TYPE REF TO /AWS1/CL_SAGREPORTDESTINATION /AWS1/CL_SAGREPORTDESTINATION

The destination for publishing scan reports to an integrated document provider.

RETURNING

oo_output TYPE REF TO /aws1/cl_sagcreatethrtmodelout /AWS1/CL_SAGCREATETHRTMODELOUT

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->createthreatmodel(
  io_assets = new /aws1/cl_sagassets(
    it_actors = VALUE /aws1/cl_sagactor=>tt_actorlist(
      (
        new /aws1/cl_sagactor(
          io_authentication = new /aws1/cl_sagauthentication(
            iv_providertype = |string|
            iv_value = |string|
          )
          it_uris = VALUE /aws1/cl_sagurilist_w=>tt_urilist(
            ( new /aws1/cl_sagurilist_w( |string| ) )
          )
          iv_description = |string|
          iv_identifier = |string|
        )
      )
    )
    it_documents = VALUE /aws1/cl_sagdocumentinfo=>tt_documentlist(
      (
        new /aws1/cl_sagdocumentinfo(
          io_integrateddocument = new /aws1/cl_sagintegrateddocument(
            iv_integrationid = |string|
            iv_resourceid = |string|
          )
          iv_artifactid = |string|
          iv_s3location = |string|
        )
      )
    )
    it_endpoints = VALUE /aws1/cl_sagendpoint=>tt_endpointlist(
      ( new /aws1/cl_sagendpoint( |string| ) )
    )
    it_integratedrepositories = VALUE /aws1/cl_sagintgrtdrepository=>tt_integratedrepositorylist(
      (
        new /aws1/cl_sagintgrtdrepository(
          iv_integrationid = |string|
          iv_providerresourceid = |string|
        )
      )
    )
    it_sourcecode = VALUE /aws1/cl_sagsourcecoderepo=>tt_sourcecoderepositorylist(
      ( new /aws1/cl_sagsourcecoderepo( |string| ) )
    )
  )
  io_logconfig = new /aws1/cl_sagcloudwatchlog(
    iv_loggroup = |string|
    iv_logstream = |string|
  )
  io_reportdestination = new /aws1/cl_sagreportdestination(
    iv_containerid = |string|
    iv_documentid = |string|
    iv_integrationid = |string|
    iv_parentid = |string|
  )
  it_scopedocs = VALUE /aws1/cl_sagdocumentinfo=>tt_documentlist(
    (
      new /aws1/cl_sagdocumentinfo(
        io_integrateddocument = new /aws1/cl_sagintegrateddocument(
          iv_integrationid = |string|
          iv_resourceid = |string|
        )
        iv_artifactid = |string|
        iv_s3location = |string|
      )
    )
  )
  iv_agentspaceid = |string|
  iv_description = |string|
  iv_servicerole = |string|
  iv_title = |string|
).

This is an example of reading all possible response values

lo_result = lo_result.
IF lo_result IS NOT INITIAL.
  lv_string = lo_result->get_threatmodelid( ).
  lv_string = lo_result->get_title( ).
  lv_string = lo_result->get_agentspaceid( ).
  lv_string = lo_result->get_description( ).
  lo_assets = lo_result->get_assets( ).
  IF lo_assets IS NOT INITIAL.
    LOOP AT lo_assets->get_endpoints( ) into lo_row.
      lo_row_1 = lo_row.
      IF lo_row_1 IS NOT INITIAL.
        lv_string = lo_row_1->get_uri( ).
      ENDIF.
    ENDLOOP.
    LOOP AT lo_assets->get_actors( ) into lo_row_2.
      lo_row_3 = lo_row_2.
      IF lo_row_3 IS NOT INITIAL.
        lv_string = lo_row_3->get_identifier( ).
        LOOP AT lo_row_3->get_uris( ) into lo_row_4.
          lo_row_5 = lo_row_4.
          IF lo_row_5 IS NOT INITIAL.
            lv_string = lo_row_5->get_value( ).
          ENDIF.
        ENDLOOP.
        lo_authentication = lo_row_3->get_authentication( ).
        IF lo_authentication IS NOT INITIAL.
          lv_authenticationprovidert = lo_authentication->get_providertype( ).
          lv_string = lo_authentication->get_value( ).
        ENDIF.
        lv_string = lo_row_3->get_description( ).
      ENDIF.
    ENDLOOP.
    LOOP AT lo_assets->get_documents( ) into lo_row_6.
      lo_row_7 = lo_row_6.
      IF lo_row_7 IS NOT INITIAL.
        lv_string = lo_row_7->get_s3location( ).
        lv_string = lo_row_7->get_artifactid( ).
        lo_integrateddocument = lo_row_7->get_integrateddocument( ).
        IF lo_integrateddocument IS NOT INITIAL.
          lv_string = lo_integrateddocument->get_integrationid( ).
          lv_string = lo_integrateddocument->get_resourceid( ).
        ENDIF.
      ENDIF.
    ENDLOOP.
    LOOP AT lo_assets->get_sourcecode( ) into lo_row_8.
      lo_row_9 = lo_row_8.
      IF lo_row_9 IS NOT INITIAL.
        lv_string = lo_row_9->get_s3location( ).
      ENDIF.
    ENDLOOP.
    LOOP AT lo_assets->get_integratedrepositories( ) into lo_row_10.
      lo_row_11 = lo_row_10.
      IF lo_row_11 IS NOT INITIAL.
        lv_string = lo_row_11->get_integrationid( ).
        lv_string = lo_row_11->get_providerresourceid( ).
      ENDIF.
    ENDLOOP.
  ENDIF.
  LOOP AT lo_result->get_scopedocs( ) into lo_row_6.
    lo_row_7 = lo_row_6.
    IF lo_row_7 IS NOT INITIAL.
      lv_string = lo_row_7->get_s3location( ).
      lv_string = lo_row_7->get_artifactid( ).
      lo_integrateddocument = lo_row_7->get_integrateddocument( ).
      IF lo_integrateddocument IS NOT INITIAL.
        lv_string = lo_integrateddocument->get_integrationid( ).
        lv_string = lo_integrateddocument->get_resourceid( ).
      ENDIF.
    ENDIF.
  ENDLOOP.
  lv_servicerole = lo_result->get_servicerole( ).
  lo_cloudwatchlog = lo_result->get_logconfig( ).
  IF lo_cloudwatchlog IS NOT INITIAL.
    lv_string = lo_cloudwatchlog->get_loggroup( ).
    lv_string = lo_cloudwatchlog->get_logstream( ).
  ENDIF.
  lv_timestamp = lo_result->get_createdat( ).
  lv_timestamp = lo_result->get_updatedat( ).
ENDIF.