Changing Profiles assigned to security Rule

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing Profiles assigned to security Rule

L3 Networker

just in the process of switching to a vulnerability profile which is not shared to vsys specific vulneability profile. Is there an easy way to change a vulnerability profile in 250 security rules without having to manually visist every rule?

1 accepted solution

Accepted Solutions

Lets assume your antivirus profile is AV and you want to replace it with Antivirus.

 

admin@PA-VM> set cli config-output-format set
admin@PA-VM> configure
Entering configuration mode
[edit]
admin@PA-VM# show rulebase security | match AV
set rulebase security rules Test1 profile-setting profiles virus AV
set rulebase security rules Test2 profile-setting profiles virus AV
set rulebase security rules Test3 profile-setting profiles virus AV
set rulebase security rules Test4 profile-setting profiles virus AV
[edit]
admin@PA-VM#

 

Copy lines that start with "set" to notepad.

Replace all set entries with delete (CTRL+H to open replace window).

 

delete rulebase security rules Test1 profile-setting profiles virus AV
delete rulebase security rules Test2 profile-setting profiles virus AV
delete rulebase security rules Test3 profile-setting profiles virus AV
delete rulebase security rules Test4 profile-setting profiles virus AV

 

Paste result into cli window

Now change delete to set again and replace all AV entries with Antivirus.

 

Paste output back into cli window.

set rulebase security rules Test1 profile-setting profiles virus Antivirus
set rulebase security rules Test2 profile-setting profiles virus Antivirus
set rulebase security rules Test3 profile-setting profiles virus Antivirus
set rulebase security rules Test4 profile-setting profiles virus Antivirus

 

And commit.

 

 

 

Enterprise Architect, Security @ Cloud Carib Ltd
Palo Alto Networks certified from 2011

View solution in original post

3 REPLIES 3

L4 Transporter

Hi clewis,

 

You could export your configuration then do a find and replace in the XML. Be careful with this though and make sure you take a backup.

 

For the future you may want to use Security Profile Groups. That way you just modify the profile in the group and it will change the rules that use this group.

 

hope this helps,

Ben

Lets assume your antivirus profile is AV and you want to replace it with Antivirus.

 

admin@PA-VM> set cli config-output-format set
admin@PA-VM> configure
Entering configuration mode
[edit]
admin@PA-VM# show rulebase security | match AV
set rulebase security rules Test1 profile-setting profiles virus AV
set rulebase security rules Test2 profile-setting profiles virus AV
set rulebase security rules Test3 profile-setting profiles virus AV
set rulebase security rules Test4 profile-setting profiles virus AV
[edit]
admin@PA-VM#

 

Copy lines that start with "set" to notepad.

Replace all set entries with delete (CTRL+H to open replace window).

 

delete rulebase security rules Test1 profile-setting profiles virus AV
delete rulebase security rules Test2 profile-setting profiles virus AV
delete rulebase security rules Test3 profile-setting profiles virus AV
delete rulebase security rules Test4 profile-setting profiles virus AV

 

Paste result into cli window

Now change delete to set again and replace all AV entries with Antivirus.

 

Paste output back into cli window.

set rulebase security rules Test1 profile-setting profiles virus Antivirus
set rulebase security rules Test2 profile-setting profiles virus Antivirus
set rulebase security rules Test3 profile-setting profiles virus Antivirus
set rulebase security rules Test4 profile-setting profiles virus Antivirus

 

And commit.

 

 

 

Enterprise Architect, Security @ Cloud Carib Ltd
Palo Alto Networks certified from 2011

Thanks Radio, your method seems the easiest.

  • 1 accepted solution
  • 6637 Views
  • 3 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!