Navigation

    Netgate Discussion Forum
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    Block upload file to internet

    General pfSense Questions
    2
    6
    8274
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Y
      yahav02 last edited by

      Does anyone know how to block users to upload files to internet with squid + squid guard???
      Thanks

      1 Reply Last reply Reply Quote 0
      • J
        javcasta last edited by

        Hi.

        For block download files by extension with SquidGuard.

        https://doc.pfsense.org/index.php/SquidGuard_package#Block_download_by_Extension

        For block upload files, I do not know how to, but in this link maybe help you to configure one acl or advanced option is squid:

        How To Block File Uploads Using Squid ACL’s
        http://nanlyx.blogspot.ie/2013/04/how-to-block-file-uploads-using-squid.html

        Regards.

        Javier Castañón
        Técnico de comunicaciones, soporte y sistemas.

        Mi web: https://javcasta.com/

        Soporte scripting/pfSense https://javcasta.com/soporte/

        1 Reply Last reply Reply Quote 0
        • Y
          yahav02 last edited by

          Thanks
          Is it possible to configure it from GUI on pfsense?

          1 Reply Last reply Reply Quote 0
          • J
            javcasta last edited by

            Hi.

            The gui part: I suppose in the Services > Proxy Server: General Settings > General > (show advanced options) Advanced Features:
            Custom ACLS (After Auth)

            acl all src all
            http_port 3128
            access_log /var/log/squid/access.log squid
            
            external_acl_type request_body %{Content-Length} /usr/bin/upload.sh
            # 1MB max upload
            acl noupload external request_body 1024000
            
            http_access deny !noupload
            http_access allow all
            

            And create the file: /usr/bin/upload.sh with execute permissions (via shell: chmod +x /usr/bin/upload.sh )

            
            #!/bin/sh
            while read size limit; do
              if [ "${size}" -gt "${limit}" ]; then
                echo ERR
              else
                echo OK
              fi
            done
            
            

            But I have not tried this procedure in pfsense

            Regards.

            Javier Castañón
            Técnico de comunicaciones, soporte y sistemas.

            Mi web: https://javcasta.com/

            Soporte scripting/pfSense https://javcasta.com/soporte/

            1 Reply Last reply Reply Quote 0
            • Y
              yahav02 last edited by

              hi javcasta
              this script work on https web site ?

              thenks

              1 Reply Last reply Reply Quote 0
              • J
                javcasta last edited by

                Hi.

                @yahav02:

                hi javcasta
                this script work on https web site ?

                thenks

                It is not my script.
                You must go to the source: How To Block File Uploads Using Squid ACL’s
                http://nanlyx.blogspot.ie/2013/04/how-to-block-file-uploads-using-squid.html

                Regards

                Javier Castañón
                Técnico de comunicaciones, soporte y sistemas.

                Mi web: https://javcasta.com/

                Soporte scripting/pfSense https://javcasta.com/soporte/

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post