FortiSOAR Community

 View Only
Expand all | Collapse all

Upload CSV and update FortiSOAR Records

  • 1.  Upload CSV and update FortiSOAR Records

    Posted Jun 02, 2022 08:35 PM
    Hello,

    I am looking to formulate a solution. I want to upload a csv file using user prompt to FortiSOAR and update records in Module of FortiSOAR. Of course, the headers in field will be similar to fields created in module. 

    Looking for inputs from community members.

    ------------------------------
    Punit
    ------------------------------


  • 2.  RE: Upload CSV and update FortiSOAR Records

    Posted Jun 03, 2022 09:23 AM
    Hi Punit,

    You can use the CSV Data Management connector to load data from a CSV: https://docs.fortinet.com/document/fortisoar/1.0.0/csv-data-management/270/csv-data-management-v1-0-0
    You can use a step for loop with a Create Record step to create records using the output from the CSV.

    Here is an older playbook that does something similar (though it doesn't use the CSV connector). It accepts a CSV file as input, parses it, and creates indicators/assets based on the output: FortiSOAR - Import Assets/Indicators from a CSV  

    Thank you,

    ------------------------------
    Chris
    Principal Software Development Engineer - FortiSOAR
    ------------------------------



  • 3.  RE: Upload CSV and update FortiSOAR Records

    Posted Jun 03, 2022 09:47 AM

    He Chris,

    Thanks for your response. I did try to use the CSV connector but when running the step, I was getting below error:
    No module named 'pandas'  Connector :: csv-data-managementV1.0.0 URL : https://localhost:9595/integration/execute/?format=json 

    Also, I do not seem to have access to the link to the older playbook. Do you mind attaching the older playbook to this thread.

    Thanks 
    Punit D



    ------------------------------
    Punit
    ------------------------------



  • 4.  RE: Upload CSV and update FortiSOAR Records

    Posted Jun 03, 2022 10:01 AM

    Hi Punit,

    It looks like your environment did not install the Python dependencies. Please run this command to install them separately:
    >=7.2.0
    sudo -u fsr-integrations /opt/cyops-integrations/.env/bin/pip install -r /opt/cyops-integrations/integrations/connectors/csv-data-management_1_0_0/requirements.txt

    <=7.0.2

    sudo -u nginx /opt/cyops-integrations/.env/bin/pip install -r /opt/cyops-integrations/integrations/connectors/csv-data-management_1_0_0/requirements.txt

    I have also updated the link in my original message. Please try the new link to see the other playbook.

    Thank you,



    ------------------------------
    Chris
    Principal Software Development Engineer - FortiSOAR
    ------------------------------



  • 5.  RE: Upload CSV and update FortiSOAR Records

    Posted Jun 03, 2022 10:40 AM
    Hey Chris,

    I am getting error as below while updating python dependencies:

    ERROR: Could not find a version that satisfies the requirement json (from -r /opt/cyops-integrations/integrations/connectors/csv-data-management_1_0_0/requirements.txt (line 4)) (from versions: none)
    ERROR: No matching distribution found for json (from -r /opt/cyops-integrations/integrations/connectors/csv-data-management_1_0_0/requirements.txt (line 4))

    ------------------------------
    Punit
    ------------------------------



  • 6.  RE: Upload CSV and update FortiSOAR Records

    Posted Jun 03, 2022 12:35 PM
    Hi Punit,

    Please try running this direct command to install:
    sudo -u nginx /opt/cyops-integrations/.env/bin/pip install numpy pandas

    Thank you,

    ------------------------------
    Chris
    Principal Software Development Engineer - FortiSOAR
    ------------------------------



  • 7.  RE: Upload CSV and update FortiSOAR Records

    Posted Jun 03, 2022 09:04 PM
    Hi Punit,

    Please check the link below
    https://fusecommunity.fortinet.com/viewdocument/ingest-advisories-from-pdf-excel?CommunityKey=9f1420e8-e3c6-4535-8cae-3fa714da66d8&tab=librarydocuments
    Use the playbooks from the link. Instead of email, just change the start point to be "Manual Input".