Web File Repository

Simple web server with a file uploading console to store small files. This is helpful to make your environment ready for testing purpose for your playbooks or automations to download files from a web server.

Utilities · Web File Repository

Details

IDWeb File Repository
ProviderOpen Source
CategoryUtilities
From Version6.0.0
Docker Imagedemisto/bottle:1.0.0.10133006
Supported ModulesAgentix XSIAM

README

Simple web server with a file uploading console to store small files.

Helps make your environment ready for testing purpose for your playbooks or automations to download files from a web server. NOTE: For more information about long-running integrations, see the Cortex XSOAR 8 Cloud, Cortex XSOAR 8 On-prem or Cortex XSIAM documentation.

Configure Web File Repository in Cortex

Parameter Description Required
Incident type   False
Long running instance   False
Port mapping (<port> or <host port>:<docker port>) Runs the service on this port from within Cortex XSOAR. Requires a unique port for each long-running integration instance. Do not use the same port for multiple instances. Note: If you click the test button more than once, a failure may occur mistakenly indicating that the port is already in use. (For Cortex XSOAR 8 and Cortex XSIAM) If you do not enter a port, an unused port for Web File Repository will automatically be generated when the instance is saved. However, if using an engine, you must enter a port. True
User ID for Read/Write   False
Password   False
User ID for Read-Only   False
Password   False
Authentication Method Some of the browsers such as Chrome may not support Digest-sha256. False
Public Read Access Authentication is not requiured for read access False
MIME Types for file extensions “mime-type extension [extension]*” for each line, wild-card file extensions are supported. False
Merge with Default MIME Types Set true to merge the specified types with the default settings, false to replace them False
Attachment extensions List of extensions to set “attachment” to Content-Disposition False
Storage Protection   True
The maximum repository size   False
The maximum sandbox repository size   False

How to Access the File Management UI

Access the File Management UI by URL and Port (HTTP)

In a web browser, go to http://<cortex-xsoar-server-address>:<listen_port>.

Access the File Management UI by Instance Name (HTTPS)

To access the File Management UI by instance name, make sure Instance execute external is enabled.

  1. In Cortex XSOAR 6.x:

    1. Navigate to Settings > About > Troubleshooting.
    2. In the Server Configuration section, verify that the instance.execute.external.<instance_name> key is set to true. If this key does not exist, click + Add Server Configuration and add the instance.execute.external.<instance_name> and set the value to true. See this documentation for further information.
  2. In a web browser:

    • For Cortex XSOAR 6.x: Go to https://<cortex-xsoar-address>/instance/execute/<instance_name>.
    • For Cortex XSOAR 8 On-prem, Cortex XSOAR 8 Cloud, or Cortex XSIAM: Go to https://ext-<tenant>.crtx.<region>.paloaltonetworks.com/xsoar/instance/execute/<instance-name>.
    • For Multi Tenant environments: Go to https://<cortex-xsoar-address>/acc_<account name>/instance/execute/<instance_name>.

      Note:
      For Cortex XSOAR 8 On-prem, you need to add the ext- FQDN DNS record to map the Cortex XSOAR DNS name to the external IP address.
      For example, ext-xsoar.mycompany.com.

Commands

You can execute these commands from the CLI, as part of an automation, or in a playbook.
After you successfully execute a command, a DBot message appears in the War Room with the command details.

wfr-status


Get the service status

Base Command

wfr-status

Input

| Argument Name | Description | Required |
| — | — | — |

Context Output

Path Type Description
WebFileRepository.Status.StorageUsage number The current storage usage in bytes
WebFileRepository.Status.SandboxUsage number The current sandbox usage in bytes
WebFileRepository.Status.StorageProtection string The storage protection mode
WebFileRepository.Status.IntercommunicationIP string The IP address of the service to which the internal client connects
WebFileRepository.Status.IntercommunicationPort number The port number of the service to which the internal client connects
WebFileRepository.Status.ExternaIP unknown The external IP address of the service
WebFileRepository.Status.ExternalPort unknown The external port number of the service
WebFileRepository.Status.ServerIP string The IP address of the service
WebFileRepository.Status.ServerPort number The port number of the service

wfr-cleanup


Remove all the files from the repository

Base Command

wfr-cleanup

Input

| Argument Name | Description | Required |
| — | — | — |

Context Output

There is no context output for this command.

wfr-upload-as-file


Upload a file from data to the repository.

Base Command

wfr-upload-as-file

Input

Argument Name Description Required
file_name The name of the file. Required
data Input data to create the file. Optional
encoding Encoding type of the input data. Default is utf-8. Optional
extract_archive Set to true to extract files to archive files, otherwise false. Possible values are: true, false. Default is false. Optional
upload_directory The directory path where to upload. Default is /. Optional

Context Output

There is no context output for this command.

wfr-upload-file


Upload a file to the repository

Base Command

wfr-upload-file

Input

Argument Name Description Required
entry_id The entry ID list of the file. Required
file_name The name of the file. Optional
extract_archive Set to true to extract files to archive files, otherwise false. Possible values are: true, false. Default is false. Optional
upload_directory The directory path where to upload. Default is /. Optional

Context Output

There is no context output for this command.

wfr-upload-files


Upload files to the repository

Base Command

wfr-upload-files

Input

Argument Name Description Required
entry_ids The entry ID list of files. Required
extract_archive Set to true to extract files to archive files, otherwise false. Possible values are: true, false. Default is false. Optional
upload_directory The directory path where to upload. Default is /. Optional

Context Output

There is no context output for this command.

wfr-list-files


List files in the repository

Base Command

wfr-list-files

Input

Argument Name Description Required
directory The directory path where to list files. Default is /. Optional
recursive Set to true to list subdirectories recursively, otherwise false. Possible values are: true, false. Default is false. Optional

Context Output

Path Type Description
WebFileRepository.Files.Name string The file name
WebFileRepository.Files.Path string The file path
WebFileRepository.Files.Size number The file size in bytes
WebFileRepository.Files.LastModified date The last modified time

wfr-remove-files


Remove files from the repository

Base Command

wfr-remove-files

Input

Argument Name Description Required
paths The list of the file paths. Required

Context Output

There is no context output for this command.

wfr-download-file


Download a file from the repository

Base Command

wfr-download-file

Input

Argument Name Description Required
path The file path. Required
save_as The name to give the file to save. Optional

Context Output

There is no context output for this command.

wfr-download-as-text


Retrieve the file data from the repository into the context.

Base Command

wfr-download-as-text

Input

Argument Name Description Required
path The file path. Required
encoding Encoding type to convert the file data when setting to the context. Default is utf-8. Optional

Context Output

Path Type Description
WebFileRepository.Files.Name string The file name
WebFileRepository.Files.Path string The file path
WebFileRepository.Files.Size number The file size in bytes
WebFileRepository.Files.Data string The file data encoded in the encoding
WebFileRepository.Files.Encoding string The encoding name

wfr-archive-zip


Download a file to which all the files are archived

Base Command

wfr-archive-zip

Input

Argument Name Description Required
save_as The name to give the archive-file to save. Optional

Context Output

There is no context output for this command.

wfr-reset


Reset the repository data

Base Command

wfr-reset

Input

| Argument Name | Description | Required |
| — | — | — |

Context Output

There is no context output for this command.

Configuration parameters

  • incidentType — Incident type
  • longRunning — Long running instance
  • longRunningPort — Port mapping (<port> or <host port>:<docker port>) (required)
  • rwCredentials — User ID for Read/Write
  • roCredentials — User ID for Read-Only
  • authenticationMethod — Authentication Method
  • publicReadAccess — Public Read Access
  • mimeTypes — MIME Types for file extensions
  • mergeMimeTypes — Merge with Default MIME Types
  • attachmentExtensions — Attachment extensions
  • storageProtection — Storage Protection (required)
  • maxStorageSize — The maximum repository size
  • maxSandboxSize — The maximum sandbox repository size

Commands (11)

  • wfr-archive-zip

    Download a file to which all the files are archived.

  • wfr-cleanup

    Remove all the files from the repository.

  • wfr-download-as-text

    Retrieve the file data from the repository into the context.

  • wfr-download-file

    Download a file from the repository.

  • wfr-list-files

    List files in the repository.

  • wfr-remove-files

    Remove files from the repository.

  • wfr-reset

    Reset the repository data.

  • wfr-status

    Get the service status.

  • wfr-upload-as-file

    Upload a file from data to the repository.

  • wfr-upload-file

    Upload files to the repository.

  • wfr-upload-files

    Upload files to the repository.

category: Utilities
provider: Open Source
sectionorder:
- Connect
- Collect
commonfields:
  id: Web File Repository
  version: -1
configuration:
- display: Incident type
  name: incidentType
  type: 13
  required: false
  section: Collect
- defaultvalue: "true"
  display: Long running instance
  name: longRunning
  type: 8
  required: false
  section: Connect
- display: Port mapping (<port> or <host port>:<docker port>)
  name: longRunningPort
  required: true
  type: 0
  additionalinfo: "Runs the service on this port from within Cortex XSOAR. Requires a unique port for each long-running integration instance. Do not use the same port for multiple instances. Note: If you click the test button more than once, a failure may occur mistakenly indicating that the port is already in use. (For Cortex XSOAR 8 and Cortex XSIAM) If you do not enter a port, an unused port for Web File Repository will automatically be generated when the instance is saved. However, if using an engine, you must enter a port."
  section: Connect
- display: User ID for Read/Write
  displaypassword: Password
  name: rwCredentials
  type: 9
  required: false
  section: Connect
- display: User ID for Read-Only
  displaypassword: Password
  name: roCredentials
  type: 9
  required: false
  section: Connect
- additionalinfo: Some of the browsers such as Chrome may not support Digest-sha256.
  display: Authentication Method
  name: authenticationMethod
  options:
  - Basic
  - Digest-md5
  - Digest-sha256
  type: 15
  required: false
  section: Connect
- additionalinfo: Authentication is not required for read access
  defaultvalue: "true"
  display: Public Read Access
  name: publicReadAccess
  type: 8
  required: false
  section: Connect
- additionalinfo: '"mime-type  extension [extension]*" for each line, wild-card file extensions are supported.'
  display: MIME Types for file extensions
  name: mimeTypes
  type: 12
  required: false
  section: Collect
- additionalinfo: Set true to merge the specified types with the default settings, false to replace them
  defaultvalue: "true"
  display: Merge with Default MIME Types
  name: mergeMimeTypes
  type: 8
  required: false
  section: Collect
- additionalinfo: List of extensions to set "attachment" to Content-Disposition
  display: Attachment extensions
  name: attachmentExtensions
  type: 0
  required: false
  section: Collect
- defaultvalue: read/write
  display: Storage Protection
  name: storageProtection
  options:
  - read/write
  - read-only
  - sandbox
  required: true
  type: 15
  section: Collect
- defaultvalue: 100MB
  display: The maximum repository size
  name: maxStorageSize
  type: 0
  required: false
  section: Collect
- defaultvalue: 1GB
  display: The maximum sandbox repository size
  name: maxSandboxSize
  type: 0
  required: false
  section: Collect
description: |-
  Simple web server with a file uploading console to store small files.
  This is helpful to make your environment ready for testing purpose for your playbooks or automations to download files from a web server.
display: Web File Repository
name: Web File Repository
script:
  commands:
  - arguments: []
    description: Get the service status.
    name: wfr-status
    outputs:
    - contextPath: WebFileRepository.Status.StorageUsage
      description: The current storage usage in bytes.
      type: number
    - contextPath: WebFileRepository.Status.SandboxUsage
      description: The current sandbox usage in bytes.
      type: number
    - contextPath: WebFileRepository.Status.StorageProtection
      description: The storage protection mode.
      type: string
    - contextPath: WebFileRepository.Status.IntercommunicationIP
      description: The IP address of the service to which the internal client connects.
      type: string
    - contextPath: WebFileRepository.Status.IntercommunicationPort
      description: The port number of the service to which the internal client connects.
      type: number
    - contextPath: WebFileRepository.Status.ExternaIP
      description: The external IP address of the service.
    - contextPath: WebFileRepository.Status.ExternalPort
      description: The external port number of the service.
    - contextPath: WebFileRepository.Status.ServerIP
      description: The IP address of the service.
      type: string
    - contextPath: WebFileRepository.Status.ServerPort
      description: The port number of the service.
      type: number
  - arguments: []
    description: Remove all the files from the repository.
    name: wfr-cleanup
  - arguments:
    - description: The entry ID of the file.
      name: entry_id
      required: true
    - description: The name of the file.
      name: file_name
    - auto: PREDEFINED
      defaultValue: "false"
      description: Set to true to extract files to archive files, otherwise false.
      name: extract_archive
      predefined:
      - "true"
      - "false"
    - defaultValue: /
      description: The directory path where to upload.
      name: upload_directory
    description: Upload files to the repository.
    name: wfr-upload-file
  - arguments:
    - name: file_name
      required: true
      description: The name of the file.
    - name: data
      description: Input data to create the file.
    - name: encoding
      auto: PREDEFINED
      predefined:
      - utf-8
      - base64
      description: Encoding type of the input data. Default is utf-8.
      defaultValue: utf-8
    - name: extract_archive
      auto: PREDEFINED
      predefined:
      - "true"
      - "false"
      description: Set to true to extract files to archive files, otherwise false.
      defaultValue: "false"
    - name: upload_directory
      description: The directory path where to upload.
      defaultValue: /
    description: Upload a file from data to the repository.
    name: wfr-upload-as-file
  - arguments:
    - description: The entry ID list of files.
      isArray: true
      name: entry_ids
      required: true
    - auto: PREDEFINED
      defaultValue: "false"
      description: Set to true to extract files to archive files, otherwise false.
      name: extract_archive
      predefined:
      - "true"
      - "false"
    - defaultValue: /
      description: The directory path where to upload.
      name: upload_directory
    description: Upload files to the repository.
    name: wfr-upload-files
  - arguments:
    - defaultValue: /
      description: The directory path where to list files.
      name: directory
    - auto: PREDEFINED
      defaultValue: "false"
      description: Set to true to list subdirectories recursively, otherwise false.
      name: recursive
      predefined:
      - "true"
      - "false"
    description: List files in the repository.
    name: wfr-list-files
    outputs:
    - contextPath: WebFileRepository.Files.Name
      description: The file name.
      type: string
    - contextPath: WebFileRepository.Files.Path
      description: The file path.
      type: string
    - contextPath: WebFileRepository.Files.Size
      description: The file size in bytes.
      type: number
    - contextPath: WebFileRepository.Files.LastModified
      description: The last modified time.
      type: date
  - arguments:
    - description: The list of the file paths.
      isArray: true
      name: paths
      required: true
    description: Remove files from the repository.
    name: wfr-remove-files
  - arguments:
    - description: The file path.
      name: path
      required: true
    - description: The name to give the file to save.
      name: save_as
    description: Download a file from the repository.
    name: wfr-download-file
  - arguments:
    - name: path
      required: true
      description: The file path.
    - name: encoding
      auto: PREDEFINED
      predefined:
      - utf-8
      - base64
      description: Encoding type to convert the file data when setting to the context.
        Default is utf-8.
      defaultValue: utf-8
    outputs:
    - contextPath: WebFileRepository.Files.Name
      description: The file name.
      type: string
    - contextPath: WebFileRepository.Files.Path
      description: The file path.
      type: string
    - contextPath: WebFileRepository.Files.Size
      description: The file size in bytes.
      type: number
    - contextPath: WebFileRepository.Files.Data
      description: The file data encoded in the encoding.
      type: string
    - contextPath: WebFileRepository.Files.Encoding
      description: The encoding name.
      type: string
    description: Retrieve the file data from the repository into the context.
    name: wfr-download-as-text
  - arguments:
    - description: The name to give the archive-file to save.
      name: save_as
    description: Download a file to which all the files are archived.
    name: wfr-archive-zip
  - arguments: []
    description: Reset the repository data.
    name: wfr-reset
  dockerimage: demisto/bottle:1.0.0.10133006
  longRunning: true
  longRunningPort: true
  resetContext: true
  script: ''
  subtype: python3
  type: python
fromversion: 6.0.0
tests:
- No tests (auto formatted)
triggers:
  - conditions:
      - name: engine
        operator: not_exists
      - name: isEngineGroup
        operator: not_exists
    effects:
      - name: longRunningPort
        action:
          hidden: true
          required: false