Using Edge Secure Web Gateway (ProxySG) you wish to block the download of files based on filename of the download.
A) Block filenames with the phrase "sample" in the filename
B) Block any URL containing the phrase "sample" (eg: https://example.com/sample)
A) The filename of downloaded file is present in the Http header 'content-disposition'. Use the below CPL to block based on this field.
<proxy>
response.header.Content-Disposition="sample" Deny
B) Implement with the below CPL:
<proxy>
url.path.substring="sample" deny
url.host.substring="sample" deny