Importing Risks

The following services upload risks to AFA.

Import Risks from Spreadsheet

Request Type: ImportingRisksfromSpreadsheetRequest

This web service operation will receive the following parameters:

Element

Type

Description

SessionIDMandatory

String

Allows the consequent calls of various web services, without performing full AFA login each time.

RiskProfileNameMandatory

String

The name of the risk profile in which to save the risks.

ImportedFileTypeMandatory

String

The extention of the imported spreadsheet. It can be only xlsx/xls.

EncodedFileDataMandatory

String

The contents of the imported spreadsheet file, encoded in base64.

InheritStandardOptional

Integer

Considered only for a new risk profile (that does not exist). 1 - to inherit from the standard, 0 (or unset) - not inherited from the standard.

Response Type: ImportingRisksfromSpreadsheetResponse

  1. RetVal - integer - 1- for success 0- for failure.
  1. RetMessage - string - a detailed return/error message, if errors came up during the operation.

Request example:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:afa="https://www.algosec.com/afa-ws">

   <soapenv:Header/>
   <soapenv:Body>
      <afa:ImportRisksFromSpreadsheetRequest>
         <SessionID>2931306bb7e1ab756b0caf5ecf9a4d36</SessionID>
         <RiskProfileName>Risks12</RiskProfileName>
         <ImportedFileType>xls</ImportedFileType>
   <!--Below is a partial text example of encoded64bit xls file:-->
         <EncodedFileData>UEsDBBQABgAIAAAAIQB8bJgWaQEAAKAFAAATAAgCW0NvbnRlbnRfVHlwZXNdLnhtbCCiBAIooAAC
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA....</EncodedFileData>
         <!--Optional:-->
         <InheritStandard>0</InheritStandard>
      </afa:ImportRisksFromSpreadsheetRequest>
   </soapenv:Body>
</soapenv:Envelope>

Response example:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://www.algosec.com/afa-ws">
   <SOAP-ENV:Body>
      <ns1:ImportRisksFromSpreadsheetResponse>
         <RetVal>0</RetVal>
         <RetMessage>Failed to import risks:
Traffic sheet not found
Networks sheet not found
Services sheet not found</RetMessage>
      </ns1:ImportRisksFromSpreadsheetResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Import Risks from XML File

Notes:
The web service caller requires AFA administration privileges.

The definition of new services or hostgroups for risks is not supported.

Request Type: ImportingRisksFromXMLRequest

This web service operation will receive the following parameters:

Element

Type

Description

SessionIDMandatory

String

SessionID obtained from Connect method.

RiskProfileNameMandatory

String

The name of the risk profile in which to save the risks.

EncodedFileDataMandatory

String

The contents of the imported risk profile XML file, encoded in base64.

Response Type: ImportingRisksFromXMLResponse

  1. RetVal - integer - 1- for success 0- for failure.
  1. RetMessage - string - a detailed return/error message, if errors came up during the operation.

The Import Risks from Spreadsheet should work the same via web services as it does via the AFA GUI.

Request example:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:afa="https://www.algosec.com/afa-ws">

   <soapenv:Header/>
   <soapenv:Body>
      <afa:ImportRisksFromXMLRequest>
         <SessionID>6b7f0760750a63ba97abefe1dfccac6f</SessionID>
         <RiskProfileName>XMLRisk3</RiskProfileName>
         <EncodedFileData>PD94bWwgd...M+Cg==</EncodedFileData>
            </afa:ImportRisksFromXMLRequest>
   </soapenv:Body>
</soapenv:Envelope>

Response example:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://www.algosec.com/afa-ws">
   <SOAP-ENV:Body>
      <ns1:ImportRisksFromXMLResponse>
         <RetVal>0</RetVal>
         <RetMessage>Failed to import risks:
Traffic sheet not found
Networks sheet not found
Services sheet not found</RetMessage>
      </ns1:ImportRisksFromXMLResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>