Skip to main content

Rasterize

This Integration is part of the Rasterize Pack.#

Converts URLs, PDF files, and emails to an image file or PDF file.

Docker Security Recommendations#

If you are using the integration to rasterize un-trusted URLs or HTML content, such as those obtained via external emails, we recommend following the instructions at the Docker Network Hardening under the Block Internal Network Access section.

Configure Rasterize on Cortex XSOAR#

  1. Navigate to Settings > Integrations > Servers & Services.
  2. Search for Rasterize.
  3. Click Add instance to create and configure a new integration instance.
ParameterDescriptionRequired
with_errorReturn Errors.False
wait_timeTime to wait before taking a screenshot (in seconds).False
max_page_load_timeMaximum amount of time to wait for a page to load (in seconds).False
chrome_optionsChrome options (Advanced. See Configuration Notes.)False
proxyUse system proxy settings.False
rasterize_modeRasterize Mode. (See Configuration Notes.)False
  1. Click Test to validate the URLs, token, and connection.

Configuration Notes:

  • Return Errors: If this checkbox is not selected, a warning will be returned instead of an error.
  • Chrome options: A comma-separated list of Chrome options to add or remove for rasterization. Use for advanced troubleshooting. If a value contains a comma (for example, when setting the user agent value), escape it with the backslash (\) character. To remove a default option that is used, put the option in square brackets. For example, to add the option --disable-auto-reload and remove the option --disable-dev-shm-usage, set the following value:
--disable-auto-reload,[--disable-dev-shm-usage]
  • Rasterize Mode: It is possible to rasterize either via Chrome WebDriver or Chrome Headless CLI. WebDriver supports more options than Headless CLI. Such as support for the offline option in the rasterize-emails command. There are some urls that do not rasterize well with WebDriver and may succeed with Headless CLI. Thus, it is recommended to use the WebDriver - Preferred mode, which will use WebDriver as a start and fallback to Headless CLI if it fails.
  • Use system proxy settings: Select this checkbox to use the system's proxy settings. Important: this integration does not support proxies which require authentication.

Commands#

You can execute these commands from the Cortex XSOAR 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.

rasterize#


Converts the contents of a URL to an image file or a PDF file.

Base Command#

rasterize

Input#

Argument NameDescriptionRequired
wait_timeTime to wait before taking a screenshot (in seconds ).Optional
max_page_load_timeMaximum time to wait for a page to load (in seconds).Optional
urlThe URL to rasterize. Must be the full URL, including the http prefix.Required
widthThe page width, for example, 1024px. Specify with or without the px suffix.Optional
heightThe page height, for example, 800px. Specify with or without the px suffix.Optional
typeThe file type to which to convert the contents of the URL. Can be "pdf" or "png". Default is "png".Optional
file_nameThe name the file will be saved as. Default is "url".Optional
full_screenGet the full page. The actual page width and height will be auto calculated up to a max value of 8000px. (Marking full_screen as true means that the values for width and height arguments might not be respected).Optional
modeRasterize mode to use (WebDriver or Headless CLI). If not specified, will use according to the integration instance settings.Optional

Context Output#

PathTypeDescription
InfoFile.NamestringFile name.
InfoFile.EntryIDstringFile entry ID.
InfoFile.SizenumberFile size.
InfoFile.TypestringFile type, e.g., "PE"
InfoFile.InfostringBasic information of the file.
InfoFile.ExtensionstringFile extension.

Command Example#

!rasterize url=http://google.com

Context Example#

{
"InfoFile": {
"EntryID": "922@6e069bc4-2a1e-43ea-8ed3-ea558e377751",
"Extension": "png",
"Info": "image/png",
"Name": "url.png",
"Size": 29909,
"Type": "PNG image data, 1024 x 800, 8-bit/color RGBA, non-interlaced"
}
}

Human Readable Output#

!image

rasterize-email#


Converts the body of an email to an image file or a PDF file.

Base Command#

rasterize-email

Input#

Argument NameDescriptionRequired
htmlBodyThe HTML body of the email.Required
widthThe HTML page width, for example, 600px. Specify with or without the px suffix.Optional
heightThe HTML page height, for example, 800px. Specify with or without the px suffix.Optional
typeThe file type to which to convert the email body. Can be "pdf" or "png". Default is "png".Optional
offlineIf "true", will block all outgoing communication.Optional
file_nameThe name the file will be saved as. Default is "email".Optional
full_screenGet the full page. The actual page width and height will be auto calculated up to a max value of 8000px. (Marking full_screen as true means that the values for width and height arguments might not be respected).Optional
modeRasterize mode to use (WebDriver or Headless CLI). If not specified, will use according to the integration instance settings.Optional

Context Output#

PathTypeDescription
InfoFile.NamestringFile name.
InfoFile.EntryIDstringFile entry ID.
InfoFile.SizenumberFile size.
InfoFile.TypestringFile type, e.g., "PE"
InfoFile.InfostringBasic information of the file.
InfoFile.ExtensionstringFile extension.

Command Example#

!rasterize-email htmlBody="<html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"></head><body><br/>---------- TEST FILE ----------<br/></body></html>"

Context Example#

{
"InfoFile": {
"EntryID": "926@6e069bc4-2a1e-43ea-8ed3-ea558e377751",
"Extension": "png",
"Info": "image/png",
"Name": "email.png",
"Size": 5243,
"Type": "PNG image data, 600 x 800, 8-bit/color RGBA, non-interlaced"
}
}

Human Readable Output#

!image

rasterize-image#


Converts an image file to a PDF file.

Base Command#

rasterize-image

Input#

Argument NameDescriptionRequired
EntryIDThe entry ID of the image file.Required
widthThe image width, for example, 600px. Specify with or without the px suffix.Optional
heightThe image height, for example, 800px. Specify with or without the px suffix. If empty, the height is the entire image.Optional
file_nameThe name the file will be saved as. Default is the EntryID.Optional
full_screenGet the full page. The actual page width and height will be auto calculated up to a max value of 8000px. (Marking full_screen as true means that the values for width and height arguments might not be respected).Optional
modeRasterize mode to use (WebDriver or Headless CLI). If not specified, will use according to the integration instance settings.Optional

Context Output#

PathTypeDescription
InfoFile.NamestringFile name.
InfoFile.EntryIDstringFile entry ID.
InfoFile.SizenumberFile size.
InfoFile.TypestringFile type, e.g., "PE"
InfoFile.InfostringBasic information of the file.
InfoFile.ExtensionstringFile extension.

Command Example#

!rasterize-image EntryID=889@6e069bc4-2a1e-43ea-8ed3-ea558e377751

Context Example#

{
"InfoFile": {
"EntryID": "930@6e069bc4-2a1e-43ea-8ed3-ea558e377751",
"Extension": "pdf",
"Info": "application/pdf",
"Name": "889@6e069bc4-2a1e-43ea-8ed3-ea558e377751.pdf",
"Size": 21856,
"Type": "PDF document, version 1.4"
}
}

Human Readable Output#

rasterize-pdf#


Converts a PDF file to an image file.

Base Command#

rasterize-pdf

Input#

Argument NameDescriptionRequired
EntryIDThe entry ID of PDF file.Required
maxPagesThe maximum number of pages to render. Default is "3".Optional
pdfPasswordThe password to access the PDF.Optional
horizontalWhether to stack the pages horizontally. If "true", will stack the pages horizontally. If "false", will stack the pages vertically. Default is "false".Optional
file_nameThe name the file will be saved as. Default is "image".Optional

Context Output#

PathTypeDescription
InfoFile.NamestringFile name.
InfoFile.EntryIDstringFile entry ID.
InfoFile.SizenumberFile size.
InfoFile.TypestringFile type, e.g., "PE"
InfoFile.InfostringBasic information of the file.
InfoFile.ExtensionstringFile extension.

Command Example#

!rasterize-pdf EntryID=897@6e069bc4-2a1e-43ea-8ed3-ea558e377751

Context Example#

{
"InfoFile": {
"EntryID": "934@6e069bc4-2a1e-43ea-8ed3-ea558e377751",
"Extension": "jpeg",
"Info": "image/jpeg",
"Name": "image.jpeg",
"Size": 77514,
"Type": "JPEG image data, JFIF standard 1.01, aspect ratio, density 1x1, segment length 16, baseline, precision 8, 1700x2200, components 3"
}
}

Human Readable Output#

rasterize-html#


Converts an html file to a PDF or PNG file.

Base Command#

rasterize-html

Input#

Argument NameDescriptionRequired
EntryIDThe entry ID of the html file.Required
widthThe html file width, for example, 600px. Specify with or without the px suffix.Optional
heightThe html file height, for example, 800px. Specify with or without the px suffix. If empty, the height is the entire image.Optional
file_nameThe name the file will be saved as. Default is the EntryID.Optional
typeThe file type to which to convert the html file. Can be "pdf" or "png". Default is "png".Optional
full_screenGet the full page. The actual page width and height will be auto calculated up to a max value of 8000px. (Marking full_screen as true means that the values for width and height arguments might not be respected).Optional
wait_timeTime to wait before taking a screenshot (in seconds ).Optional

Context Output#

PathTypeDescription
InfoFile.NamestringFile name.
InfoFile.EntryIDstringFile entry ID.
InfoFile.SizenumberFile size.
InfoFile.TypestringFile type, e.g., "PE"
InfoFile.InfostringBasic information of the file.
InfoFile.ExtensionstringFile extension.

Command Example#

!rasterize-html EntryID=889@6e069bc4-2a1e-43ea-8ed3-ea558e4586751

Context Example#

{
"InfoFile": {
"EntryID": "930@6e069bc4-2a1e-43ea-8ed3-ea558e458651",
"Extension": "png",
"Info": "application/png",
"Name": "image.png",
"Size": 21856,
"Type": "png document, version 1.4"
}
}

Human Readable Output#