How to restrict user for not posting malicious file like virus or malware in Multi-part Message Type or attachment of Azure Web API/Logic APp/Azure function?

Ashwani kumar 16 Reputation points
2020-08-27T15:17:17.547+00:00

I am designing a Multi-part Message Type Web API/Logic APP to post different types of file like Zip, jpg, pdf etc.

The size of the file could very from 1 MB to 500 MB.

One of the attachment is of type *.ZIP.. I am not sure how to ensure that they should not post malicious file like virus or malware etc as an zipped content.

As a part of PaaS offering - do we have anything to validate the Web API attached files or its automatically going to be handled by Azure or firewall.

Regards,
Ashwani

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,751 questions
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,839 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,865 questions
{count} votes

3 answers

Sort by: Most helpful
  1. Pramod Valavala 20,516 Reputation points Microsoft Employee
    2020-08-28T10:21:10.177+00:00

    I believe there aren't any first-party PaaS offerings for this and Azure Firewall doesn't have the ability to scan file uploads either. You could however build your own pipeline to scan file uploads before processing them.

    To scan the files, you could leverage one of the logic app connectors available for virus scanning but note that these rely on external services to perform the scanning. A customer solution would involve using an open-source engine like ClamAV that you could call from Azure Functions for example. This blog shows how you can approach this.

    To ensure infected files never reach your internal storage, you could first store it in a temporay blob container, scan it and then move it to the actual location where you need it for processing.

    1 person found this answer helpful.
    0 comments No comments

  2. Rupesh Kumar Tiwari 1 Reputation point
    2021-05-07T18:12:11.357+00:00

    I agree with @Pramod Valavala

    0 comments No comments

  3. Faraz Ahmed SH Shaikh 1 Reputation point
    2021-06-02T09:16:44.267+00:00

    Have you considered using Application Gateway and WAF?

    0 comments No comments