Changing name of many Security policy from Cli

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Please sign in to see details of an important advisory in our Customer Advisories area.

Changing name of many Security policy from Cli

Cyber Elite
Cyber Elite

Is ther any way to change the name of all existing security policies from the cli at once?

MP

Help the community: Like helpful comments and mark solutions.
2 accepted solutions

Accepted Solutions

If you have a list of names (or just pull them from the config in the "set" formatting), you could probably script something out pretty quick with the "rename" statement in the cli.

 

Example from Panorama:

rename device-group grpGlobal pre-rulebase security rules grpGlobal-BlockKnownMalicious to grpWhateverYouWant

 

Example directly on Firewall:

rename rulebase security rules toBeChanged to newRuleName

 

 

 

 

View solution in original post

@MP18,

The method that @jeremy.larsen described would work perfectly fine for what you need to do. The expedition tool can also do this as @LukeBullimore mentioned but I personally don't really like setting up the tool for something this easy. The CLI method would be fast and easy; you could also export the XML file, make the changes required, and them import and load the configuration back to the firewall. 

View solution in original post

5 REPLIES 5

L5 Sessionator

Hey @MP18 

 

I don't think it's possible to edit a rule's name from the CLI; besides, for bulk changes, I'd recommend that you take a look at Palo Alto's 'Expedition' tool. The tool allows for things that you can't do natively on the firewall such as Multi-Edits, Bulk Changes etc.

 

https://www.paloaltonetworks.com/products/secure-the-network/next-generation-firewall/migration-tool

 

Cheers,

Luke.

If you have a list of names (or just pull them from the config in the "set" formatting), you could probably script something out pretty quick with the "rename" statement in the cli.

 

Example from Panorama:

rename device-group grpGlobal pre-rulebase security rules grpGlobal-BlockKnownMalicious to grpWhateverYouWant

 

Example directly on Firewall:

rename rulebase security rules toBeChanged to newRuleName

 

 

 

 

That seems very handy what i need to do is as we have 30 rules say with name

 

corp_security  1

corp_security 2  all the way 30 30

 

I need to only change the corp to say xyz like

 

xyz_security 1  and so on 

 

is this possible?

 

Thanks for the help

MP

Help the community: Like helpful comments and mark solutions.

@MP18,

The method that @jeremy.larsen described would work perfectly fine for what you need to do. The expedition tool can also do this as @LukeBullimore mentioned but I personally don't really like setting up the tool for something this easy. The CLI method would be fast and easy; you could also export the XML file, make the changes required, and them import and load the configuration back to the firewall. 

Many thanks for replying to the Question.

It is good to have confirmation from you.

MP

Help the community: Like helpful comments and mark solutions.
  • 2 accepted solutions
  • 8367 Views
  • 5 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!