Upload file: Request

Prev Next

To upload a file from IOC or STIX source to the system, send the following request:

POST https://<IA_IP_address>:<port_number>/threatintelservice/v1/uploadfile

Note

To use this request, your user account must have admin privileges.

Required headers:

Cookie: px=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
X-Username: <user> 
X-Role: <role>

Forms

feedname—The feed name.

uploadfile—The full path to the file to be uploaded.

Options

  • IA_IP_address—The IP address of the NDR appliance running the NDR API.

  • port_number—The port number of the NDR appliance running the NDR API.

  • token—This token authenticates the session. By default, the session times out after 24 hours.

  • user—The user ID.

  • role—The user's role.

Example

POST https://xxx.xxx.xxx.xxx:443/threatintelservice/v1/uploadfile -F "feedname=$<feedname>" -F "uploadfile=@$<uploadfile>

Required headers:

Cookie: px=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
X-Username: wheel 
X-Role: wheel

Upload file: Response

HTTP/1.1 [Response Code] [Response Message]				
Response fields
  • Response Code—A standard HTTP response code.

    • 200—The feed name exists and the file upload can succeed.

    • 400—Feed name does not exist.

    • 403—Upload is not permitted.

  • Response Message—A standard HTTP response message.

    • OK—The feed name exists and the file upload can succeed.

Example
HTTP/1.1 200 OK				
Date: [Date]				

cURL code sample: Upload file

curl -k -X POST --cookie "px=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" -H "X-Username: wheel" -H "X-Role: wheel" https://xxx.xxx.xxx.xxx:443/threatintelservice/v1/uploadfile -F "feedname=$myfeed" -F "uploadfile=@$/path/to/filename"

This cURL sample includes the following options:

  • -k—This option explicitly allows cURL to perform insecure SSL connections and transfers, which allows you to test your SSL connection without installing a CA certificate.

  • -X POST—Specifies using the POST method.

  • --cookie "px=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"—This option specifies the authentication token for this session.

  • -H "X-Username: wheel"—User name.

  • -H "X-Role: wheel"—User role.

  • -F "feedname=$myfeed"—The feed name. Replace myfeed with the name of your feed.

  • -F "uploadfile=@$/path/to/filename"—The full path to file you want to upload to the system. Replace /path/to/filename with the path to your file.

  • https://xxx.xxx.xxx.xxx:443/threatintelservice/v1/uploadfile—The upload request URL. Replace xxx.xxx.xxx.xxx with the IP address of your NDR appliance.

Results

This example uploads the specified file.