cloudmersive.virusscan
Module cloudmersive.virusscan
API
Definitions
ballerinax/cloudmersive.virusscan Ballerina library
Overview
The Cloudmersive Virus Scan connector lets Ballerina applications scan files, websites and cloud storage objects for viruses, malware and other content threats using the Cloudmersive Virus Scan API. It supports version v1 of the API, which combines signature-based virus detection with configurable content policies such as blocking executables, scripts, macros and invalid files.
Key features
- Scan uploaded files for viruses and malware
- Apply advanced threat rules that block executables, scripts, macros, HTML and unsafe archives, or restrict accepted file types
- Scan websites for malware, phishing and forced downloads
- Scan files in Azure Blob Storage, AWS S3, Google Cloud Storage and SharePoint Online without downloading them
- Run cloud storage scans as batch jobs and retrieve their status and results
Setup guide
To use the connector, you need a Cloudmersive API key.
-
Sign up for a Cloudmersive account and sign in to the Cloudmersive management portal.
-
Open the API Keys page and create a new API key, or copy an existing one.
Note: Batch job operations require a Cloudmersive Managed Instance or Private Cloud deployment.
Quickstart
To use the Cloudmersive Virus Scan connector in your Ballerina application, update the .bal file as follows:
Step 1: Import the module
import ballerina/io; import ballerinax/cloudmersive.virusscan;
Step 2: Create a Config.toml file
apiKey = "<Cloudmersive API key>"
Step 3: Create a client
configurable string apiKey = ?; final virusscan:Client scanner = check new ({apikey: apiKey});
Step 4: Invoke an operation
public function main() returns error? { byte[] content = check io:fileReadBytes("sample.pdf"); virusscan:VirusScanResult _ = check scanner->scanFile({inputFile: {fileContent: content, fileName: "sample.pdf"}}); }
Examples
The Cloudmersive Virus Scan connector provides practical examples illustrating usage in various scenarios. Explore these examples, covering the following use cases:
- Upload threat screening - Scans an uploaded file with the basic and advanced scans, reports threats, and checks the linked website.
- Cloud blob batch scan - Starts an advanced Azure Blob scan as a batch job and polls its status until it completes.
Clients
cloudmersive.virusscan: Client
The Cloudmersive Virus Scan API lets you scan files and content for viruses and identify security issues with content.
Constructor
Gets invoked to initialize the connector.
init (ApiKeysConfig apiKeyConfig, ConnectionConfig config, string serviceUrl)- apiKeyConfig ApiKeysConfig - API keys for authorization
- config ConnectionConfig {} - The configurations to be used when initializing the
connector
- serviceUrl string "https://api.cloudmersive.com/virus/scan" - URL of the target service
scanFile
function scanFile(ScanFileRequest payload, map<string|string[]> headers) returns VirusScanResult|errorScan a file for viruses
Parameters
- payload ScanFileRequest - File to scan for viruses, uploaded as multipart form data
Return Type
- VirusScanResult|error - Virus scan result for the uploaded file, including whether it is clean and any viruses found
scanFileAdvanced
function scanFileAdvanced(ScanFileRequest payload, ScanFileAdvancedHeaders headers) returns VirusScanAdvancedResult|errorAdvanced Scan a file for viruses
Parameters
- payload ScanFileRequest - File to scan, uploaded as multipart form data; scan options are sent as headers
- headers ScanFileAdvancedHeaders (default {}) - Headers to be sent with the request
Return Type
- VirusScanAdvancedResult|error - Advanced scan result for the uploaded file, including threat rule findings and content information
scanWebsite
function scanWebsite(WebsiteScanRequest payload, map<string|string[]> headers) returns WebsiteScanResult|errorScan a website for malicious content and threats
Parameters
- payload WebsiteScanRequest - Website URL to scan for malicious content and threats
Return Type
- WebsiteScanResult|error - Website scan result, including the threat type detected and the website's HTTP response code
scanAzureBlob
function scanAzureBlob(ScanAzureBlobHeaders headers) returns CloudStorageVirusScanResult|errorScan an Azure Blob for viruses
Parameters
- headers ScanAzureBlobHeaders - Headers to be sent with the request
Return Type
- CloudStorageVirusScanResult|error - Virus scan result for the Azure Blob, including whether it is clean and any viruses found
scanAzureBlobAdvanced
function scanAzureBlobAdvanced(ScanAzureBlobAdvancedHeaders headers) returns CloudStorageAdvancedVirusScanResult|errorAdvanced Scan an Azure Blob for viruses
Parameters
- headers ScanAzureBlobAdvancedHeaders - Headers to be sent with the request
Return Type
- CloudStorageAdvancedVirusScanResult|error - Advanced scan result for the Azure Blob, including threat rule findings and content information
scanAzureBlobAdvancedBatchJob
function scanAzureBlobAdvancedBatchJob(ScanAzureBlobAdvancedBatchJobHeaders headers) returns ScanCloudStorageBatchJobCreateResult|errorAdvanced Scan an Azure Blob for viruses via a batch job
Parameters
- headers ScanAzureBlobAdvancedBatchJobHeaders - Headers to be sent with the request
Return Type
- ScanCloudStorageBatchJobCreateResult|error - Batch job created for the Azure Blob scan, with the job ID to use when checking its status
scanAwsS3FileAdvancedBatchJob
function scanAwsS3FileAdvancedBatchJob(map<string|string[]> headers) returns ScanCloudStorageBatchJobCreateResult|errorAdvanced Scan an AWS S3 file for viruses via a batch job
Return Type
- ScanCloudStorageBatchJobCreateResult|error - Batch job created for the AWS S3 file scan, with the job ID to use when checking its status
scanGcpStorageFileAdvancedBatchJob
function scanGcpStorageFileAdvancedBatchJob(map<string|string[]> headers) returns ScanCloudStorageBatchJobCreateResult|errorAdvanced Scan an Google Cloud Platform (GCP) Storage file for viruses via a batch job
Return Type
- ScanCloudStorageBatchJobCreateResult|error - Batch job created for the GCP Storage file scan, with the job ID to use when checking its status
scanAwsS3File
function scanAwsS3File(ScanAwsS3FileHeaders headers) returns CloudStorageVirusScanResult|errorScan an AWS S3 file for viruses
Parameters
- headers ScanAwsS3FileHeaders - Headers to be sent with the request
Return Type
- CloudStorageVirusScanResult|error - Virus scan result for the AWS S3 file, including whether it is clean and any viruses found
scanAwsS3FileAdvanced
function scanAwsS3FileAdvanced(ScanAwsS3FileAdvancedHeaders headers) returns CloudStorageAdvancedVirusScanResult|errorAdvanced Scan an AWS S3 file for viruses
Parameters
- headers ScanAwsS3FileAdvancedHeaders - Headers to be sent with the request
Return Type
- CloudStorageAdvancedVirusScanResult|error - Advanced scan result for the AWS S3 file, including threat rule findings and content information
scanSharePointOnlineFile
function scanSharePointOnlineFile(ScanSharePointOnlineFileHeaders headers) returns CloudStorageVirusScanResult|errorVirus Scan a file in a SharePoint Online Site Drive
Parameters
- headers ScanSharePointOnlineFileHeaders - Headers to be sent with the request
Return Type
- CloudStorageVirusScanResult|error - Virus scan result for the SharePoint Online file, including whether it is clean and any viruses found
scanSharePointOnlineFileAdvanced
function scanSharePointOnlineFileAdvanced(ScanSharePointOnlineFileAdvancedHeaders headers) returns CloudStorageAdvancedVirusScanResult|errorAdvanced Virus Scan a file in a SharePoint Online Site Drive
Parameters
- headers ScanSharePointOnlineFileAdvancedHeaders - Headers to be sent with the request
Return Type
- CloudStorageAdvancedVirusScanResult|error - Advanced scan result for the SharePoint Online file, including threat rule findings and content information
scanGcpStorageFile
function scanGcpStorageFile(ScanGcpStorageFileHeaders headers, ScanGcpStorageFileRequest payload) returns CloudStorageVirusScanResult|errorScan an Google Cloud Platform (GCP) Storage file for viruses
Parameters
- headers ScanGcpStorageFileHeaders - Headers to be sent with the request
- payload ScanGcpStorageFileRequest - GCP service account JSON credential file used to access the storage bucket
Return Type
- CloudStorageVirusScanResult|error - Virus scan result for the GCP Storage file, including whether it is clean and any viruses found
scanGcpStorageFileAdvanced
function scanGcpStorageFileAdvanced(ScanGcpStorageFileAdvancedHeaders headers, ScanGcpStorageFileRequest payload) returns CloudStorageAdvancedVirusScanResult|errorAdvanced Scan an Google Cloud Platform (GCP) Storage file for viruses
Parameters
- headers ScanGcpStorageFileAdvancedHeaders - Headers to be sent with the request
- payload ScanGcpStorageFileRequest - GCP service account JSON credential file; scan options are sent as headers
Return Type
- CloudStorageAdvancedVirusScanResult|error - Advanced scan result for the GCP Storage file, including threat rule findings and content information
getAsyncJobStatus
function getAsyncJobStatus(map<string|string[]> headers, *GetAsyncJobStatusQueries queries) returns ScanCloudStorageJobStatusResult|errorGet the status and result of a Scan Cloud Storage Batch Job
Parameters
- queries *GetAsyncJobStatusQueries - Queries to be sent with the request
Return Type
- ScanCloudStorageJobStatusResult|error - Status of the batch job, with the scan result once the job has completed
Records
cloudmersive.virusscan: AdditionalAdvancedScanInformation
Additional non-threat content verification information
Fields
- hashSHA1? string - SHA1 hash of input file
- containsJSON? boolean - True if the input file contains JSON data, false otherwise; this is not a threat signal
- isAuthenticodeSigned? boolean - True if there is a valid Authenticode signature, False otherwise
- relevantSubfileName? string - Relevant subfile name in an archive format for identified threats, if any
- containsImage? boolean - True if the input file contains an image
- containsXML? boolean - True if the input file contains XML data, false otherwise; this is not a threat signal
- relevantSubfileHashSHA1? string - SHA1 hash of relevant subfile name in an archive format for identified threats, if any
cloudmersive.virusscan: ApiKeysConfig
Provides API key configurations needed when communicating with a remote HTTP endpoint.
Fields
- apikey string - API Key Authentication
cloudmersive.virusscan: CloudStorageAdvancedVirusScanResult
Result of running an advanced virus scan on cloud storage
Fields
- errorDetailedDescription? string - Detailed error message if the operation was not successful
- containsInvalidFile? boolean - True if the scan contained an invalid file (such as a PDF that is not a valid PDF, Word Document that is not a valid Word Document, etc.), which can be a significant risk factor
- containsRestrictedFileFormat? boolean - True if the uploaded file is of a type that is not allowed based on the optional restrictFileTypes parameter, false otherwise; if restrictFileTypes is not set, this will always be false
- containsScript? boolean - True if the scan contained a script (such as a PHP script, Python script, etc.) which can be a significant risk factor
- containsOleEmbeddedObject? boolean - True if the uploaded file contains an OLE embedded object, which can be a significant risk factor
- foundViruses? CloudStorageVirusFound[] - Array of viruses found, if any
- contentInformation? AdditionalAdvancedScanInformation -
- containsMacros? boolean - True if the uploaded file contains embedded Macros of other embedded threats within the document, which can be a significant risk factor
- containsXmlExternalEntities? boolean - True if the uploaded file contains embedded XML External Entity threats of other embedded threats within the document, which can be a significant risk factor
- successful? boolean - True if the operation of retrieving the file, and scanning it were successfully completed, false if the file could not be downloaded from cloud storage, or if the file could not be scanned. Note that successful completion does not mean the file is clean; for the output of the virus scanning operation itself, use the CleanResult and FoundViruses parameters
- cleanResult? boolean - True if the scan contained no viruses, false otherwise
- containsInsecureDeserialization? boolean - True if the uploaded file contains embedded Insecure Deserialization threats of other embedded threats within the document, which can be a significant risk factor
- containsHtml? boolean - True if the uploaded file contains HTML, which can be a significant risk factor
- containsExecutable? boolean - True if the scan contained an executable (application code), which can be a significant risk factor
- verifiedFileFormat? string - For file format verification-supported file formats, the contents-verified file format of the file. Null indicates that the file format is not supported for contents verification. If a Virus or Malware is found, this field will always be set to Null
- containsUnsafeArchive? boolean - True if the uploaded file contains unsafe archive (e.g. zip) content, such as a Zip Bomb, or other configurations of a zip file that could lead to an unsafe extraction
- containsPasswordProtectedFile? boolean - True if the scan contained a password protected or encrypted file, which can be a significant risk factor
- fileSize? int - Size in bytes of the file that was retrieved and scanned
cloudmersive.virusscan: CloudStorageVirusFound
Virus positively identified
Fields
- fileName? string - Name of the file containing the virus
- virusName? string - Name of the virus that was found
cloudmersive.virusscan: CloudStorageVirusScanResult
Result of running a virus scan on cloud storage
Fields
- errorDetailedDescription? string - Detailed error message if the operation was not successful
- containsInvalidFile? boolean - True if the scan contained an invalid file (such as a PDF that is not a valid PDF, Word Document that is not a valid Word Document, etc.), which can be a significant risk factor
- containsRestrictedFileFormat? boolean - True if the uploaded file is of a type that is not allowed based on the optional restrictFileTypes parameter, false otherwise; if restrictFileTypes is not set, this will always be false
- foundViruses? CloudStorageVirusFound[] - Array of viruses found, if any
- containsScript? boolean - True if the scan contained a script (such as a PHP script, Python script, etc.) which can be a significant risk factor
- containsOleEmbeddedObject? boolean - True if the uploaded file contains an OLE embedded object, which can be a significant risk factor
- containsMacros? boolean - True if the uploaded file contains embedded Macros of other embedded threats within the document, which can be a significant risk factor
- containsXmlExternalEntities? boolean - True if the uploaded file contains embedded XML External Entity threats of other embedded threats within the document, which can be a significant risk factor
- successful? boolean - True if the operation of retrieving the file, and scanning it were successfully completed, false if the file could not be downloaded from cloud storage, or if the file could not be scanned. Note that successful completion does not mean the file is clean; for the output of the virus scanning operation itself, use the CleanResult and FoundViruses parameters
- cleanResult? boolean - True if the scan contained no viruses, false otherwise
- containsInsecureDeserialization? boolean - True if the uploaded file contains embedded Insecure Deserialization threats of other embedded threats within the document, which can be a significant risk factor
- containsHtml? boolean - True if the uploaded file contains HTML, which can be a significant risk factor
- containsContentModerationRejection? boolean - Set to true when using NSFW Content Moderation in the Cloudmersive Storage Protect product (disabled by default)
- containsExecutable? boolean - True if the scan contained an executable (application code), which can be a significant risk factor
- verifiedFileFormat? string - For file format verification-supported file formats, the contents-verified file format of the file. Null indicates that the file format is not supported for contents verification. If a Virus or Malware is found, this field will always be set to Null
- containsUnsafeArchive? boolean - True if the uploaded file contains unsafe archive (e.g. zip) content, such as a Zip Bomb, or other configurations of a zip file that could lead to an unsafe extraction
- containsPasswordProtectedFile? boolean - True if the scan contained a password protected or encrypted file, which can be a significant risk factor
- fileSize? int - Size in bytes of the file that was retrieved and scanned
cloudmersive.virusscan: ConnectionConfig
Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.
Fields
- httpVersion HttpVersion(default http:HTTP_2_0) - The HTTP version understood by the client
- http1Settings ClientHttp1Settings(default {}) - Configurations related to HTTP/1.x protocol
- http2Settings ClientHttp2Settings(default {}) - Configurations related to HTTP/2 protocol
- timeout decimal(default 30) - The maximum time to wait (in seconds) for a response before closing the connection
- forwarded string(default "disable") - The choice of setting
forwarded/x-forwardedheader
- followRedirects? FollowRedirects - Configurations associated with Redirection
- poolConfig? PoolConfiguration - Configurations associated with request pooling
- cache CacheConfig(default {}) - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding) header
- circuitBreaker? CircuitBreakerConfig - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig? RetryConfig - Configurations associated with retrying
- cookieConfig? CookieConfig - Configurations associated with cookies
- responseLimits ResponseLimitConfigs(default {}) - Configurations associated with inbound response size limits
- secureSocket? ClientSecureSocket - SSL/TLS-related options
- proxy? ProxyConfig - Proxy server related options
- socketConfig ClientSocketConfig(default {}) - Provides settings related to client socket configuration
- validation boolean(default true) - Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default
- laxDataBinding boolean(default true) - Enables relaxed data binding on the client side. When enabled,
nilvalues are treated as optional, and absent fields are handled asnilabletypes. Enabled by default.
cloudmersive.virusscan: GetAsyncJobStatusQueries
Represents the Queries record for the operation: getAsyncJobStatus
Fields
- asyncJobID string -
cloudmersive.virusscan: ScanAwsS3FileAdvancedHeaders
Represents the Headers record for the operation: scanAwsS3FileAdvanced
Fields
- bucketRegion string - Name of the region of the S3 bucket, such as 'US-East-1'
- allowExecutables? boolean - Set to false to block executable files (program code) from being allowed in the input file. Default is false (recommended)
- bucketName string - Name of the S3 bucket
- allowPasswordProtectedFiles? boolean - Set to false to block password protected and encrypted files, such as encrypted zip and rar files, and other files that seek to circumvent scanning through passwords. Set to true to allow these file types. Default is false (recommended)
- secretKey string - AWS S3 secret key for the S3 bucket; you can get this from My Security Credentials in the AWS console
- allowMacros? boolean - Set to false to block macros and other threats embedded in document files, such as Word, Excel and PowerPoint embedded Macros, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended)
- keyName string - Key name (also called file name) of the file in S3 that you wish to scan for viruses. If the key name contains Unicode characters, you must base64 encode the key name and prepend it with 'base64:', such as: 'base64:6ZWV6ZWV6ZWV6ZWV6ZWV6ZWV'
- allowXmlExternalEntities? boolean - Set to false to block XML External Entities and other threats embedded in XML files, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended)
- allowHtml? boolean - Set to false to block HTML input in the top level file; HTML can contain XSS, scripts, local file accesses and other threats. Set to true to allow these file types. Default is false (recommended) [for API keys created prior to the release of this feature default is true for backward compatability]
- allowScripts? boolean - Set to false to block script files, such as a PHP files, Python scripts, and other malicious content or security threats that can be embedded in the file. Set to true to allow these file types. Default is false (recommended)
- accessKey string - AWS S3 access key for the S3 bucket; you can get this from My Security Credentials in the AWS console
- allowInvalidFiles? boolean - Set to false to block invalid files, such as a PDF file that is not really a valid PDF file, or a Word Document that is not a valid Word Document. Default is false (recommended)
- restrictFileTypes? string - Specify a restricted set of file formats to allow as clean as a comma-separated list of file formats, such as .pdf,.docx,.png would allow only PDF, PNG and Word document files. All files must pass content verification against this list of file formats, if they do not, then the result will be returned as CleanResult=false. Set restrictFileTypes parameter to null or empty string to disable; default is disabled
- roleArn? string - Optional: Role ARN for STS Credential-based access. This is for advanced access using the Security Token Service and is not required. If the roleArn contains Unicode characters, you must base64 encode the key name and prepend it with 'base64:', such as: 'base64:6ZWV6ZWV6ZWV6ZWV6ZWV6ZWV'
- allowUnsafeArchives? boolean - Set to false to block unsafe archives such as Zip Bombs, and other archives that can cause unsafe extraction outcomes. Default is false (recommended). If set to true, unsafe archives will be allowed
- options? string - Comma separated set of configuration operations. Include permitJavascriptAndHtmlInPDFs to allow JavaScript and HTML in PDF files. Include blockOfficeXmlOleEmbeddedFile to block embedded OLE files in Office Documents using the modern file format. Default is no options
- allowInsecureDeserialization? boolean - Set to false to block Insecure Deserialization and other threats embedded in JSON and other object serialization files, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended)
- allowOleEmbeddedObject? boolean - Set to false to block OLE embedded objects, which can contain vulnerabilities and executable code. Default is false (recommended). If set to true, OLE embedded objects will be allowed
- allowUnwantedAction? boolean - Set to false to block unwanted or undesired actions, which can contain execute or open links or content when the file is viewed. Default is false (recommended). If set to true, unwanted actions will be allowed
cloudmersive.virusscan: ScanAwsS3FileHeaders
Represents the Headers record for the operation: scanAwsS3File
Fields
- bucketRegion string - Name of the region of the S3 bucket, such as 'US-East-1'
- bucketName string - Name of the S3 bucket
- secretKey string - AWS S3 secret key for the S3 bucket; you can get this from My Security Credentials in the AWS console
- accessKey string - AWS S3 access key for the S3 bucket; you can get this from My Security Credentials in the AWS console
- roleArn? string - Optional: Role ARN for STS Credential-based access. This is for advanced access using the Security Token Service and is not required. If the roleArn contains Unicode characters, you must base64 encode the key name and prepend it with 'base64:', such as: 'base64:6ZWV6ZWV6ZWV6ZWV6ZWV6ZWV'
- keyName string - Key name (also called file name) of the file in S3 that you wish to scan for viruses. If the key name contains Unicode characters, you must base64 encode the key name and prepend it with 'base64:', such as: 'base64:6ZWV6ZWV6ZWV6ZWV6ZWV6ZWV'
cloudmersive.virusscan: ScanAzureBlobAdvancedBatchJobHeaders
Represents the Headers record for the operation: scanAzureBlobAdvancedBatchJob
Fields
- connectionString string - Connection string for the Azure Blob Storage Account; you can get this connection string from the Access Keys tab of the Storage Account blade in the Azure Portal
- allowExecutables? boolean - Set to false to block executable files (program code) from being allowed in the input file. Default is false (recommended)
- allowPasswordProtectedFiles? boolean - Set to false to block password protected and encrypted files, such as encrypted zip and rar files, and other files that seek to circumvent scanning through passwords. Set to true to allow these file types. Default is false (recommended)
- allowMacros? boolean - Set to false to block macros and other threats embedded in document files, such as Word, Excel and PowerPoint embedded Macros, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended)
- blobPath string - Path to the blob within the container, such as 'hello.pdf' or '/folder/subfolder/world.pdf'. If the blob path contains Unicode characters, you must base64 encode the blob path and prepend it with 'base64:', such as: 'base64:6ZWV6ZWV6ZWV6ZWV6ZWV6ZWV'
- allowXmlExternalEntities? boolean - Set to false to block XML External Entities and other threats embedded in XML files, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended)
- allowHtml? boolean - Set to false to block HTML input in the top level file; HTML can contain XSS, scripts, local file accesses and other threats. Set to true to allow these file types. Default is false (recommended) [for API keys created prior to the release of this feature default is true for backward compatability]
- allowScripts? boolean - Set to false to block script files, such as a PHP files, Python scripts, and other malicious content or security threats that can be embedded in the file. Set to true to allow these file types. Default is false (recommended)
- allowInvalidFiles? boolean - Set to false to block invalid files, such as a PDF file that is not really a valid PDF file, or a Word Document that is not a valid Word Document. Default is false (recommended)
- restrictFileTypes? string - Specify a restricted set of file formats to allow as clean as a comma-separated list of file formats, such as .pdf,.docx,.png would allow only PDF, PNG and Word document files. All files must pass content verification against this list of file formats, if they do not, then the result will be returned as CleanResult=false. Set restrictFileTypes parameter to null or empty string to disable; default is disabled
- containerName string - Name of the Blob container within the Azure Blob Storage account
- allowUnsafeArchives? boolean - Set to false to block unsafe archives such as Zip Bombs, and other archives that can cause unsafe extraction outcomes. Default is false (recommended). If set to true, unsafe archives will be allowed
- options? string - Comma separated set of configuration operations. Include permitJavascriptAndHtmlInPDFs to allow JavaScript and HTML in PDF files. Include blockOfficeXmlOleEmbeddedFile to block embedded OLE files in Office Documents using the modern file format. Include scanMultipartFile to scan multi-part files such as split zip files. Default is no options
- allowInsecureDeserialization? boolean - Set to false to block Insecure Deserialization and other threats embedded in JSON and other object serialization files, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended)
- allowOleEmbeddedObject? boolean - Set to false to block OLE embedded objects, which can contain vulnerabilities and executable code. Default is false (recommended). If set to true, OLE embedded objects will be allowed
- allowUnwantedAction? boolean - Set to false to block unwanted or undesired actions, which can contain execute or open links or content when the file is viewed. Default is false (recommended). If set to true, unwanted actions will be allowed
cloudmersive.virusscan: ScanAzureBlobAdvancedHeaders
Represents the Headers record for the operation: scanAzureBlobAdvanced
Fields
- connectionString string - Connection string for the Azure Blob Storage Account; you can get this connection string from the Access Keys tab of the Storage Account blade in the Azure Portal
- allowExecutables? boolean - Set to false to block executable files (program code) from being allowed in the input file. Default is false (recommended)
- allowPasswordProtectedFiles? boolean - Set to false to block password protected and encrypted files, such as encrypted zip and rar files, and other files that seek to circumvent scanning through passwords. Set to true to allow these file types. Default is false (recommended)
- allowMacros? boolean - Set to false to block macros and other threats embedded in document files, such as Word, Excel and PowerPoint embedded Macros, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended)
- blobPath string - Path to the blob within the container, such as 'hello.pdf' or '/folder/subfolder/world.pdf'. If the blob path contains Unicode characters, you must base64 encode the blob path and prepend it with 'base64:', such as: 'base64:6ZWV6ZWV6ZWV6ZWV6ZWV6ZWV'
- allowXmlExternalEntities? boolean - Set to false to block XML External Entities and other threats embedded in XML files, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended)
- allowHtml? boolean - Set to false to block HTML input in the top level file; HTML can contain XSS, scripts, local file accesses and other threats. Set to true to allow these file types. Default is false (recommended) [for API keys created prior to the release of this feature default is true for backward compatability]
- allowScripts? boolean - Set to false to block script files, such as a PHP files, Python scripts, and other malicious content or security threats that can be embedded in the file. Set to true to allow these file types. Default is false (recommended)
- allowInvalidFiles? boolean - Set to false to block invalid files, such as a PDF file that is not really a valid PDF file, or a Word Document that is not a valid Word Document. Default is false (recommended)
- restrictFileTypes? string - Specify a restricted set of file formats to allow as clean as a comma-separated list of file formats, such as .pdf,.docx,.png would allow only PDF, PNG and Word document files. All files must pass content verification against this list of file formats, if they do not, then the result will be returned as CleanResult=false. Set restrictFileTypes parameter to null or empty string to disable; default is disabled
- containerName string - Name of the Blob container within the Azure Blob Storage account
- allowUnsafeArchives? boolean - Set to false to block unsafe archives such as Zip Bombs, and other archives that can cause unsafe extraction outcomes. Default is false (recommended). If set to true, unsafe archives will be allowed
- options? string - Comma separated set of configuration operations. Include permitJavascriptAndHtmlInPDFs to allow JavaScript and HTML in PDF files. Include blockOfficeXmlOleEmbeddedFile to block embedded OLE files in Office Documents using the modern file format. Include scanMultipartFile to scan multi-part files such as split zip files. Default is no options
- allowInsecureDeserialization? boolean - Set to false to block Insecure Deserialization and other threats embedded in JSON and other object serialization files, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended)
- allowOleEmbeddedObject? boolean - Set to false to block OLE embedded objects, which can contain vulnerabilities and executable code. Default is false (recommended). If set to true, OLE embedded objects will be allowed
- allowUnwantedAction? boolean - Set to false to block unwanted or undesired actions, which can contain execute or open links or content when the file is viewed. Default is false (recommended). If set to true, unwanted actions will be allowed
cloudmersive.virusscan: ScanAzureBlobHeaders
Represents the Headers record for the operation: scanAzureBlob
Fields
- connectionString string - Connection string for the Azure Blob Storage Account; you can get this connection string from the Access Keys tab of the Storage Account blade in the Azure Portal
- containerName string - Name of the Blob container within the Azure Blob Storage account
- blobPath string - Path to the blob within the container, such as 'hello.pdf' or '/folder/subfolder/world.pdf'. If the blob path contains Unicode characters, you must base64 encode the blob path and prepend it with 'base64:', such as: 'base64:6ZWV6ZWV6ZWV6ZWV6ZWV6ZWV'
cloudmersive.virusscan: ScanCloudStorageBatchJobCreateResult
Result of performing a convert documentbatch job operation
Fields
- asyncJobID? string - When creating a job, an Async Job ID is returned. Use the GetAsyncJobStatus API to check on the status of this job using the AsyncJobID and get the result when it finishes
- successful? boolean - True if successful, false otherwise
cloudmersive.virusscan: ScanCloudStorageJobStatusResult
Status of the scan cloud storage job
Fields
- jobDuration? string - Duration of a completed job
- asyncJobID? string - Job ID of the async batch job
- errorMessage? string - Error message (if any)
- successful? boolean - Tru eif the operation to check the status of the job was successful, false otherwise
- asyncJobStatus? string - Returns the job status of the Async Job, if applicable. Possible states are STARTED and COMPLETED
- result? CloudStorageAdvancedVirusScanResult -
cloudmersive.virusscan: ScanFileAdvancedHeaders
Represents the Headers record for the operation: scanFileAdvanced
Fields
- allowExecutables? boolean - Set to false to block executable files (program code) from being allowed in the input file. Default is false (recommended)
- fileName? string - Optional: specify the original file name of the file being scanned. By default the file name is taken from inputFile parameter, but if this is not provided, or you wish to override it, you can specify the original file name using this parameter
- allowPasswordProtectedFiles? boolean - Set to false to block password protected and encrypted files, such as encrypted zip and rar files, and other files that seek to circumvent scanning through passwords. Set to true to allow these file types. Default is false (recommended)
- allowMacros? boolean - Set to false to block macros and other threats embedded in document files, such as Word, Excel and PowerPoint embedded Macros (including support for .DOCX, .XLSX, .PPTX, .DOC and .XLS), and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended)
- allowXmlExternalEntities? boolean - Set to false to block XML External Entities and other threats embedded in XML files, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended)
- allowHtml? boolean - Set to false to block HTML input in the top level file; HTML can contain XSS, scripts, local file accesses and other threats. Set to true to allow these file types. Default is false (recommended) [for API keys created prior to the release of this feature default is true for backward compatability]. If set to true, HTML files containing script tags will be allowed, but ContainsScript will be set to true if script tags are present
- allowScripts? boolean - Set to false to block script files, such as a PHP files, Python scripts, BAT scripts, JS scripts, and other malicious content or security threats that can be embedded in the file. Set to true to allow these file types. Default is false (recommended)
- allowInvalidFiles? boolean - Set to false to block invalid files, such as a PDF file that is not really a valid PDF file, or a Word Document that is not a valid Word Document. Default is false (recommended)
- restrictFileTypes? string - Specify a restricted set of file formats to allow as clean as a comma-separated list of file formats, such as .pdf,.docx,.png would allow only PDF, PNG and Word document files. All files must pass content verification against this list of file formats, if they do not, then the result will be returned as CleanResult=false. Set restrictFileTypes parameter to null or empty string to disable; default is disabled
- allowUnsafeArchives? boolean - Set to false to block unsafe archives such as Zip Bombs, and other archives that can cause unsafe extraction outcomes. Default is false (recommended). If set to true, unsafe archives will be allowed
- options? string - Comma separated set of configuration operations. Include permitJavascriptAndHtmlInPDFs to allow JavaScript and HTML in PDF files. Include permitJavascriptInHtml to allow JavaScript in HTML files. Include blockOfficeXmlOleEmbeddedFile to block embedded OLE files in Office Documents using the modern file format. Include blockInvalidUris to block invalid URIs in Office documents. Include permitAuthenticodeSignedExecutables to allow executables if they have a valid Authenticode signature. Include scanMultipartFile to scan multi-part files such as split zip files. Include ignoreRestrictFileTypesForAttachments to ignore restrictFileTypes setting for file attachments. Include permitJavascript, permitShellScript, permitPython, permitPhp, permitBatScript, permitVbScript, permitPowershellScript to allow specific script types. Include permitElf, permitExe, permitDll, permitSys, permitAnyWindowsExecutable, permitMsi, permitMacho, permitJar, permitApk, permitClass, permitLnk to allow specific executable types. Include permitMacroWithoutAutoExecute to allow macros that do not automatically execute. Default is no options
- allowInsecureDeserialization? boolean - Set to false to block Insecure Deserialization and other threats embedded in JSON and other object serialization files, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended)
- allowOleEmbeddedObject? boolean - Set to false to block OLE embedded objects, which can contain vulnerabilities and executable code. Default is false (recommended). If set to true, OLE embedded objects will be allowed
- allowUnwantedAction? boolean - Set to false to block unwanted or undesired actions, which can contain execute or open links or content when the file is viewed. Default is false (recommended). If set to true, unwanted actions will be allowed
cloudmersive.virusscan: ScanFileRequest
Fields
- inputFile record { fileContent byte[], fileName string } - Input file to perform the operation on
cloudmersive.virusscan: ScanGcpStorageFileAdvancedHeaders
Represents the Headers record for the operation: scanGcpStorageFileAdvanced
Fields
- allowExecutables? boolean - Set to false to block executable files (program code) from being allowed in the input file. Default is false (recommended)
- bucketName string - Name of the bucket in Google Cloud Storage
- allowPasswordProtectedFiles? boolean - Set to false to block password protected and encrypted files, such as encrypted zip and rar files, and other files that seek to circumvent scanning through passwords. Set to true to allow these file types. Default is false (recommended)
- allowMacros? boolean - Set to false to block macros and other threats embedded in document files, such as Word, Excel and PowerPoint embedded Macros, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended)
- allowXmlExternalEntities? boolean - Set to false to block XML External Entities and other threats embedded in XML files, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended)
- allowHtml? boolean - Set to false to block HTML input in the top level file; HTML can contain XSS, scripts, local file accesses and other threats. Set to true to allow these file types. Default is false (recommended) [for API keys created prior to the release of this feature default is true for backward compatability]
- allowScripts? boolean - Set to false to block script files, such as a PHP files, Python scripts, and other malicious content or security threats that can be embedded in the file. Set to true to allow these file types. Default is false (recommended)
- allowInvalidFiles? boolean - Set to false to block invalid files, such as a PDF file that is not really a valid PDF file, or a Word Document that is not a valid Word Document. Default is false (recommended)
- restrictFileTypes? string - Specify a restricted set of file formats to allow as clean as a comma-separated list of file formats, such as .pdf,.docx,.png would allow only PDF, PNG and Word document files. All files must pass content verification against this list of file formats, if they do not, then the result will be returned as CleanResult=false. Set restrictFileTypes parameter to null or empty string to disable; default is disabled
- allowUnsafeArchives? boolean - Set to false to block unsafe archives such as Zip Bombs, and other archives that can cause unsafe extraction outcomes. Default is false (recommended). If set to true, unsafe archives will be allowed
- options? string - Comma separated set of configuration operations. Include permitJavascriptAndHtmlInPDFs to allow JavaScript and HTML in PDF files. Include blockOfficeXmlOleEmbeddedFile to block embedded OLE files in Office Documents using the modern file format. Default is no options
- objectName string - Name of the object or file in Google Cloud Storage. If the object name contains Unicode characters, you must base64 encode the object name and prepend it with 'base64:', such as: 'base64:6ZWV6ZWV6ZWV6ZWV6ZWV6ZWV'
- allowInsecureDeserialization? boolean - Set to false to block Insecure Deserialization and other threats embedded in JSON and other object serialization files, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended)
- allowOleEmbeddedObject? boolean - Set to false to block OLE embedded objects, which can contain vulnerabilities and executable code. Default is false (recommended). If set to true, OLE embedded objects will be allowed
- allowUnwantedAction? boolean - Set to false to block unwanted or undesired actions, which can contain execute or open links or content when the file is viewed. Default is false (recommended). If set to true, unwanted actions will be allowed
cloudmersive.virusscan: ScanGcpStorageFileHeaders
Represents the Headers record for the operation: scanGcpStorageFile
Fields
- bucketName string - Name of the bucket in Google Cloud Storage
- objectName string - Name of the object or file in Google Cloud Storage. If the object name contains Unicode characters, you must base64 encode the object name and prepend it with 'base64:', such as: 'base64:6ZWV6ZWV6ZWV6ZWV6ZWV6ZWV'
cloudmersive.virusscan: ScanGcpStorageFileRequest
Fields
- jsonCredentialFile record { fileContent byte[], fileName string } - Service Account credential for Google Cloud stored in a JSON file
cloudmersive.virusscan: ScanSharePointOnlineFileAdvancedHeaders
Represents the Headers record for the operation: scanSharePointOnlineFileAdvanced
Fields
- allowExecutables? boolean - Set to false to block executable files (program code) from being allowed in the input file. Default is false (recommended)
- clientID string - Client ID access credentials; see description above for instructions on how to get the Client ID from the Azure Active Directory portal
- allowPasswordProtectedFiles? boolean - Set to false to block password protected and encrypted files, such as encrypted zip and rar files, and other files that seek to circumvent scanning through passwords. Set to true to allow these file types. Default is false (recommended)
- allowMacros? boolean - Set to false to block macros and other threats embedded in document files, such as Word, Excel and PowerPoint embedded Macros, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended)
- filePath? string - Path to the file within the drive, such as 'hello.pdf' or '/folder/subfolder/world.pdf'. If the file path contains Unicode characters, you must base64 encode the file path and prepend it with 'base64:', such as: 'base64:6ZWV6ZWV6ZWV6ZWV6ZWV6ZWV'
- sharepointDomainName string - SharePoint Online domain name, such as mydomain.sharepoint.com
- allowXmlExternalEntities? boolean - Set to false to block XML External Entities and other threats embedded in XML files, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended)
- itemID? string - SharePoint itemID, such as a DriveItem Id
- allowHtml? boolean - Set to false to block HTML input in the top level file; HTML can contain XSS, scripts, local file accesses and other threats. Set to true to allow these file types. Default is false (recommended) [for API keys created prior to the release of this feature default is true for backward compatability]
- allowScripts? boolean - Set to false to block script files, such as a PHP files, Python scripts, and other malicious content or security threats that can be embedded in the file. Set to true to allow these file types. Default is false (recommended)
- allowInvalidFiles? boolean - Set to false to block invalid files, such as a PDF file that is not really a valid PDF file, or a Word Document that is not a valid Word Document. Default is false (recommended)
- restrictFileTypes? string - Specify a restricted set of file formats to allow as clean as a comma-separated list of file formats, such as .pdf,.docx,.png would allow only PDF, PNG and Word document files. All files must pass content verification against this list of file formats, if they do not, then the result will be returned as CleanResult=false. Set restrictFileTypes parameter to null or empty string to disable; default is disabled
- allowUnsafeArchives? boolean - Set to false to block unsafe archives such as Zip Bombs, and other archives that can cause unsafe extraction outcomes. Default is false (recommended). If set to true, unsafe archives will be allowed
- tenantID? string - Optional; Tenant ID of your Azure Active Directory
- siteID string - Site ID (GUID) of the SharePoint site you wish to retrieve the file from
- clientSecret string - Client Secret access credentials; see description above for instructions on how to get the Client Secret from the Azure Active Directory portal
- allowInsecureDeserialization? boolean - Set to false to block Insecure Deserialization and other threats embedded in JSON and other object serialization files, and other files that contain embedded content threats. Set to true to allow these file types. Default is false (recommended)
- allowOleEmbeddedObject? boolean - Set to false to block OLE embedded objects, which can contain vulnerabilities and executable code. Default is false (recommended). If set to true, OLE embedded objects will be allowed
- allowUnwantedAction? boolean - Set to false to block unwanted or undesired actions, which can contain execute or open links or content when the file is viewed. Default is false (recommended). If set to true, unwanted actions will be allowed
cloudmersive.virusscan: ScanSharePointOnlineFileHeaders
Represents the Headers record for the operation: scanSharePointOnlineFile
Fields
- itemID? string - SharePoint itemID, such as a DriveItem Id
- clientID string - Client ID access credentials; see description above for instructions on how to get the Client ID from the Azure Active Directory portal
- filePath string - Path to the file within the drive, such as 'hello.pdf' or '/folder/subfolder/world.pdf'. If the file path contains Unicode characters, you must base64 encode the file path and prepend it with 'base64:', such as: 'base64:6ZWV6ZWV6ZWV6ZWV6ZWV6ZWV'
- tenantID? string - Optional; Tenant ID of your Azure Active Directory
- siteID string - Site ID (GUID) of the SharePoint site you wish to retrieve the file from
- clientSecret string - Client Secret access credentials; see description above for instructions on how to get the Client Secret from the Azure Active Directory portal
- sharepointDomainName string - SharePoint Online domain name, such as mydomain.sharepoint.com
cloudmersive.virusscan: VirusFound
Virus positively identified
Fields
- fileName? string - Name of the file containing the virus
- virusName? string - Name of the virus that was found
cloudmersive.virusscan: VirusScanAdvancedResult
Result of running an advanced virus scan
Fields
- containsInvalidFile? boolean - True if the scan contained an invalid file (such as a PDF that is not a valid PDF, Word Document that is not a valid Word Document, etc.), which can be a significant risk factor
- containsRestrictedFileFormat? boolean - True if the uploaded file is of a type that is not allowed based on the optional restrictFileTypes parameter, false otherwise; if restrictFileTypes is not set, this will always be false
- containsUnwantedAction? boolean - True if the uploaded file contains an unwanted automatic action, which can be a significant risk factor
- containsScript? boolean - True if the scan contained a script (such as a PHP script, Python script, etc.) which can be a significant risk factor
- containsOleEmbeddedObject? boolean - True if the uploaded file contains an OLE embedded object, which can be a significant risk factor
- foundViruses? VirusFound[] - Array of viruses found, if any
- contentInformation? AdditionalAdvancedScanInformation -
- containsMacros? boolean - True if the uploaded file contains embedded Macros of other embedded threats within the document, which can be a significant risk factor
- containsXmlExternalEntities? boolean - True if the uploaded file contains embedded XML External Entity threats of other embedded threats within the document, which can be a significant risk factor
- cleanResult? boolean - True if the scan contained no viruses, false otherwise
- containsInsecureDeserialization? boolean - True if the uploaded file contains embedded Insecure Deserialization threats of other embedded threats within the document, which can be a significant risk factor
- containsHtml? boolean - True if the uploaded file contains HTML, which can be a significant risk factor
- containsExecutable? boolean - True if the scan contained an executable (application code), which can be a significant risk factor
- verifiedFileFormat? string - For file format verification-supported file formats, the contents-verified file format of the file. Null indicates that the file format is not supported for contents verification. If a Virus or Malware is found, this field will always be set to Null
- containsUnsafeArchive? boolean - True if the uploaded file contains unsafe archive (e.g. zip) content, such as a Zip Bomb, or other configurations of a zip file that could lead to an unsafe extraction
- containsPasswordProtectedFile? boolean - True if the scan contained a password protected or encrypted file, which can be a significant risk factor
cloudmersive.virusscan: VirusScanResult
Result of running a virus scan
Fields
- foundViruses? VirusFound[] - Array of viruses found, if any
- cleanResult? boolean - True if the scan contained no viruses, false otherwise
cloudmersive.virusscan: WebsiteScanRequest
Request to scan a website for malicious content
Fields
- url? string - URL of the website to scan; should begin with http:// or https://
cloudmersive.virusscan: WebsiteScanResult
Result of running a website scan
Fields
- websiteHttpResponseCode? Signed32 - The remote server URL HTTP reasponse code; useful for debugging issues with scanning; typically if the remote server returns a 200 or 300-series code this means a successful response, while a 400 or 500 series code would represent an error returned from the remote server for the provided URL
- foundViruses? VirusFound[] - Array of viruses found, if any
- cleanResult? boolean - True if the scan contained no threats, false otherwise
- websiteThreatType? "None"|"Malware"|"Phishing"|"ForcedDownload"|"UnableToConnect" - Type of threat returned; can be None, Malware, ForcedDownload or Phishing
Import
import ballerinax/cloudmersive.virusscan;Metadata
Released date: 1 day ago
Version: 2.0.0
License: Apache-2.0
Security
Direct vulnerabilities: No known direct vulnerabilities
Indirect vulnerabilities:
Checked on 2026-11-21 via OSV.dev
Compatibility
Platform: any
Ballerina version: 2201.12.0
GraalVM compatible: Yes
Pull count
Total: 42
Current verison: 1
Weekly downloads
Keywords
Vendor/Cloudmersive
Area/Security & Identity
Type/Connector
Contributors