Changing name of many Security policy from Cli

Reply
Highlighted
L4 Transporter

Changing name of many Security policy from Cli

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

Tags (2)
L5 Sessionator

Re: Changing name of many Security policy from Cli

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.

L4 Transporter

Re: Changing name of many Security policy from Cli

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

 

 

 

 

L4 Transporter

Re: Changing name of many Security policy from Cli

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

L7 Applicator

Re: Changing name of many Security policy from Cli

@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. 

L4 Transporter

Re: Changing name of many Security policy from Cli

Many thanks for replying to the Question.

It is good to have confirmation from you.

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 Live Community as a whole!

The Live Community thanks you for your participation!