Wie man die Erstellung und Änderung von Dateisperren durch das Erstellen und Ändern von Dateisperren beschleunigt CLI

Wie man die Erstellung und Änderung von Dateisperren durch das Erstellen und Ändern von Dateisperren beschleunigt CLI

23470
Created On 03/27/20 16:48 PM - Last Modified 10/17/25 14:25 PM


Objective


  • In bestimmten Situationen, wenn Sie das Hinzufügen und Entfernen von Dateisperren von "Dateitypen" konfigurieren, kann dies eine entmutigende Aufgabe sein, da die aktuelle GUI Option keine Kontrollkästchen oder andere einfache Methoden bietet.
  • Für jeden Dateityp in der unterstützten Liste wäre es erforderlich, auf Hinzufügen und Suchen des Dateityps durch Scrollen zu klicken, um die Regel anzupassen.


Environment


  • PA-5250
  • PAN-OS v.8.1 und höher


Procedure


Um das Hinzufügen oder Entfernen von Dateitypen in einem Dateiblockierungsprofil zu beschleunigen, kann man CLI :

Hinzufügen über GUI

1 verwenden. Passen Sie das CLI Ausgabeformat auf 'set' an.
admin@ PA-VM > cli config-output-format set

2. Zeigen Sie die aktuell unterstützte Datei unter Verwendung eines neuen Profilnamens an, der erstellt wurde.
Um die unterstützten Dateitypen anzuzeigen, verwenden Sie das Fragezeichen (?) am Ende des Befehls.
 

admin@PA-VM> configure
admin@PA-VM# set profiles file-blocking "File Blocking Profile File Type" rules "Exclude Encrypted" file-type ?
admin@PA-VM# set profiles file-blocking "File Blocking Profile File Type" rules "Exclude Encrypted" file-type
  [                      Start a list of values.
  7z                     file-type 7z
  Multi-Level-Encoding   file-type Multi-Level-Encoding
  PE                     file-type PE
  access-shortcut        file-type access-shortcut
  ace                    file-type ace
  ade                    file-type ade
  adp                    file-type adp
  ai                     file-type ai
  aip-encrypted-docx     file-type aip-encrypted-docx
  aip-encrypted-pptx     file-type aip-encrypted-pptx
  aip-encrypted-xlsx     file-type aip-encrypted-xlsx
  any                    All file types
  apk                    file-type apk
  arj                    file-type arj
  asp                    file-type asp
  avi                    file-type avi
 

.
.
Die Ausgabe wurde absichtlich reduziert, um sie prägnant zu machen.

3. Um sie auf eine ausgewählte Liste von Dateitypen einzugrenzen, können die Dateitypen in eckigen Klammern [] durch Leerzeichen getrennt aufgelistet werden.
Zum Zeitpunkt dieses Schreibens Die vollständige Liste der unterstützten Dateitypen in einer Zeile ist:

[ 7z Multi-Level-Encoding PE access-Shortcut ace ade adp ai aip-encrypted-docx aip-encrypted-pptx aip-encrypted-xlsx any apk arj asp avi avi-divx avi-xvid bas bat bmp bmp-upload bzip2 cab catpart cdr ch m cin class cmd com cpl csv deflate64-zip der dll dmg doc docm docx dpx dsn dwf dwg dxf edif elf emf encrypted-7z encrypted-doc encrypted-doc2007 encrypted-pdf encrypted-ppt encrypted-pptx encrypted-rar encrypted-xls encrypted-xlsx encrypted-zip eps exe exr flash flv gds gif gif-upload gzip hlp hta hwp hwpx ichitaro iff inf ins iqy iso its iwork-keynote iwork-numbers iwork-pages jar jpg jpg-upload jse lnk lzh ma macapp mach-o mb mda mdb mdi mif mkv mov mp3 mp4 mpeg mpeg-ts mpkg msc msi msoffice msp ocx pbix pbm pcl pdf pem pgp pif pkg pl png png-upload powershell ppt pptx prg psd py rar reg renamed-zip rla rm rpf rtf scf scr sgi sh sh shs slk softimg split-cab split-rar stp svg sys tar tdb tif tiff tmp torrent url vb vbe vbs vxd webm wmf wmv wri wsf wsh xll xls xlsx xpm zcompressed zip ]

- Bearbeiten Sie die Liste in Sie sind Ihre Lieblings-Texteditor und fügen Sie die gewünschte Liste an den Befehl.Als Beispiel wurde Notepad++ verwendet, um verschlüsselte Dateitypen selektiv auszuschließen, um Blockaktionen anzuwenden.

Im folgenden Beispiel wurden Dateitypen mit verschlüsseltem Schlüsselwort ausgeschlossen:
 

[edit]
admin@PA-VM# set profiles file-blocking "File Blocking Profile File Type" rules "Exclude Encrypted" file-type [ aip-encrypted-docx aip-encrypted-pptx aip-encrypted-xlsx encrypted-7z encrypted-doc encrypted-docx encrypted-office2007 encrypted-pdf encrypted-ppt encrypted-pptx encrypted-rar encrypted-xls encrypted-xlsx encrypted-zip ]
admin@PA-VM# set profiles file-blocking "File Blocking Profile File Type" rules "Exclude Encrypted" action block
admin@PA-VM# set profiles file-blocking "File Blocking Profile File Type" rules "Exclude Encrypted" application any
 



admin@ PA-VM - Set Profile Datei-Blocking "File Blocking Profile File Type" Regeln "Andere" Dateityp [ 7z Multi-Level-Encoding PE access-Shortcut ace ade adp ai any apk arj asp avi avi-divx avi-xvid bas bat bmp bmp-upload bzip2 cab catpart cdr chm cin class cmd com c pl csv deflate64-zip der dll dmg doc docm docx dpx dsn dwf dwg dxf edif elf emf eps exe exr flash flv gds gif gif-upload gzip hlp hta hwp hwpx ichitaro iff inf ins iqy iso its iwork-keynote iwork-numbers i work-pages jar jpg jpg-upload js jse lnk lzh ma macapp mach-o mb mda mdb mdi mdt mdw mdz mht microsoft-shell mif mkv mov mp3 mp4 mpeg mpeg-ts mpkg msc msi msoffice msp ocx pbix pbm pcl pdf pem pgp pif p kg pl png png-upload powershell ppt pptx prg psd py rar reg renamed-zip rla rm rpf rtf scf scr sgi sh shk shs slk softimg split-cab split-rar stp svg sys tar tdb tif tiff tmp torrent url vb vbe vbs vxd webm wmf wmv wri wsf wsh xll xls xlsx xpm zcompressed zip ]
 

admin@PA-VM# set profiles file-blocking "File Blocking Profile File Type" rules "Others" action alert
admin@PA-VM# set profiles file-blocking "File Blocking Profile File Type" rules Others application any
admin@PA-VM# commit
 



Ergebnis kann in GUI

Näherer Blick

Das Ergebnis kann weiter überprüft GUI werden, um geringfügige Anpassungen vorzunehmen.
Übernehmen Sie die Änderungen, und wenden Sie das Profil auf eine policy an. Dies kann für zusätzliche Profilregeln wie gewünscht repliziert werden.


*Bitte beachten Sie:

Der Dateityp "any" ist in der Liste aus Schritt 2 enthalten.Der Dateityp "jeder" wird oft übersehen, bitte beachten Sie.



 



Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA10g000000PPIrCAO&lang=de&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail

Choose Language