Close Menu
MyKnowTech
    MyKnowTech
    • Technical Blogs
    • Career
    • Partner Spotlight
    • Videos
    • Pega News
    • Services
    LinkedIn YouTube Facebook
    MyKnowTech
    Videos

    How to Secure Attachments in Pega – Virus Scanning

    Editorial TeamBy Editorial TeamMay 25, 2026Updated:May 26, 2026No Comments3 Mins Read
    Share LinkedIn Telegram Email WhatsApp Copy Link

    Attachments are one of the most common attack surfaces in enterprise applications. A user uploads a file – and if you are not checking what is in it or what type it is, you are accepting risk.

    Pega gives you three layers of attachment security.

    1. Attachment category privileges control who can create, read, edit and delete.
    2. Virus scanning checks file content against an antivirus server.
    3. File type restriction blocks uploads that do not match your allowed extensions. This post covers the second and third.

    Virus Scanning – The Architecture

    On Pega Cloud, Pega handles virus scanning automatically. Nothing to configure.

    For client-managed or on-premise deployments, you are responsible. The approach is to connect Pega to an external antivirus server via API call from a custom extension activity.

    Pega ships an out-of-the-box extension activity called CallVirusCheck.

    By default it does nothing – it just exits. The design is intentional. You save as this activity into your implementation ruleset, add your own virus scanning logic, and Pega calls it automatically whenever a file is attached.

    In the below video, the steps were explained how to use ClamAV anti-virus software to perform the virus scan.

    File Type Restriction

    Virus scanning checks content. File type restriction checks the extension. Both are useful – they catch different things.

    The simplest approach is to extend the same CallVirusCheck activity with a few lines of Java code. Get the file name from pxAttachName, extract the extension and compare it against your allowed list. If the extension is not in the allowed set, set the same failure flag as you would for a virus detection. The upload is blocked with an error message.

    For example, if you only want to allow PDF uploads – get the extension, check if it equals PDF (case insensitive), and if not, flag it as an error.

    A practical note – do not apply this restriction blindly across the whole application. Different parts of your application may need different allowed file types. Consider whether the restriction should apply at the attachment category level, the case type level or the specific form where the upload happens.

    Watch the Full Walkthrough

    In the video below I walk through the full setup – running ClamAV in Docker, importing the Java client JAR, specialising the Check for Virus activity, testing with a clean file and a simulated virus file, then adding file type restriction and testing with both PDF and non-PDF uploads.

    Attachment security is one of those things that gets skipped until an incident happens. Setting it up properly is not complicated – and it is a lot easier to do before go-live than after.

    Advanced
    Editorial Team

    An insightful team dedicated to empowering the Pega ecosystem with in-depth knowledge, guided by Premkumar Ganesan's vision.

    Related Posts

    Videos

    Application URL Alias in Pega

    May 25, 2026
    Videos

    Understanding Components in Pega

    May 25, 2026
    Videos

    Understanding CORS Policy in Pega

    May 25, 2026
    Videos

    Content Security Policy in Pega

    May 25, 2026
    Videos

    Five Best Practices for Creating Connectors in Pega

    May 25, 2026
    Videos

    How to Plan a Pega Upgrade – A Practical Guide

    May 25, 2026
    Videos

    How to Analyse a Heap Dump in Pega

    May 25, 2026
    Videos

    How to Store Case Attachments in External File Storage in Pega

    May 25, 2026
    Videos

    Data Encryption in Pega Using HashiCorp Vault

    May 25, 2026
    Videos

    Understanding Stack Memory in Pega

    May 25, 2026
    Search through the blog
    Tags
    activity Advanced authentication background-processing Beginner case-management Constellation data-model declarative-processing email-processing file-processing Integration pega-core-concepts pega-integration process reporting security system-administration user-interface validation
    Pega Courses

    Pega courses can be accessed at https://myknowacademy.com

    About

    MyKnowTech is a boutique Pega enablement and consulting firm – helping organizations build internal Pega capability through structured training programs, Centre of Excellence setup and hands-on architecture guidance.

    Company
    • About
    • Leadership
    • Career
    • Contact
    Resources
    • Technical Blogs
    • Career
    • Partner Spotlight
    • Videos
    • Pega News
    • Services

    ©  MyKnowTech B.V. All Rights Reserved.

    • Sitemap
    • Terms & Conditions
    • Privacy Policy