-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Add/Set/Remove cmdlet for Firewall VIP/VIPGRP/AddressGroup #51
Comments
for the second question, it's possible to do the following but requires breaking out the input names with a foreach - many PS modules will handle this internally (I'd prefer SET- than this though :) ) (Get-FGTFirewallAddressgroup -connection $FG -vdom root | where name -like "MySpecialGroup").member.name|%{ Get-FGTFirewallAddress -vdom root -connection $FG -name $_} |
Hi @poundy Welcome on PowerFGT ! I'm busy by some other module actually... For first question, there is already Add-FGTAddress cmdlet for add address and i will be not not too complicated to add member on addressgroup, do you need some other stuff ? for second question, it is planned to have a better filtering stuff (using direclty API) |
The whole Quartet please :) I'm often in "append" mode - so much so that I wrote a PowerShell text substitution script to create my standard named members, append them to a group, and add a policy. Oh yeah, I need the whole Quintuple, policies too please :) here's example of one of the "shell" substitution tables I use
|
What I have done with this above powershell is what I'd prefer to directly do via PowerFGT if possible - take minimal input and then add all the components together. That's what I see that any programmatic driven access to the device should strive to do - make it simple to do the simple and repeatable tasks that you need to do frequently so you get a return on improving the process. Infrequently performed tasks are in my view less important to me to expose programmatically, because I am likely to have developed a detailed implementation plan around that and not going to worry about a few CLI commands versus a single powershell command instead. But the big things, I want to cut out manual errors and streamline the job and PS is the go to. So in the above example I'd want to do an Add-FGTFirewallAddress followed by Get-FGTFirewallAddressGrp | {something to add-member}. Therein lies one of the complexities in multi-value elements like Member... I'm no powershell architect, but a process like Get-FGTFirewallAddressGroup | Append-FGTMember $SavedNewAddress might work? |
Hi poundy,
Yes it is my idea too but need time for make this...
Yes, it will be possible
and I'm not against a little help (i can explain how to make this with API |
OK, sleeves rolled up... not sure how helpful I'll be, but I'll take a stab. I've looked at the code a bit, and think I'll look at VIPs first, to support ADD/SET. I however think i might need some hand holding in actually converting from a code change into something I can test/use, so any guidance there would be massively appreciated :) I have a server that is in use by others that has 0.3.0 currently installed, and ideally would be able to coexist on that (but understand that may not be possible). Then I'll start breaking into the code more and replicating the approach *-FGTFirewallAddress etc does. |
i start to work on VIP and addrgrp, i will push a PR soon (next day) |
Abort! |
I have seen your two PRs but haven't had a chance to deal with it yet or figure out how best for me to test things :) Other priorities right now :( |
Hi @poundy No problem, need more work (on filtering stuff) and i hope release a version for end of year... For VIP, do you need to can configure port ? For add / Change / Remove policy, it will see (need some work for support all case and option..) but for basic policy, we can use Invoke-FGTRestMethod |
I working to add (and remove) policy rule (#65) and it will be release a new release with VIP and AddressGroup Add/remove/Set support I hope, it will be available for end of year |
Hello, PowerFGT 0.4.0 is available !
Look Add-FGTFirewallAddress (Already exist with 0.3.0 !)
Look Add-FGTFirewallAddressGroup and Add-FGTFirewallAddressMember
Look Add-FGTFirewallPolicy |
Thanks for the update ! Sorry I didn't get a chance to assist in the testing - I was struggling to get time to do anything firewall in my day-job before the holidays, and now I'm on leave so there's even less time ;-) Am still yet to find a good guide to set up a decent dev environment to allow editing of this project, but that's a separate issue to this :) |
Hi @poundy No problem ! Good holiday ! (it will also take day off too) for dev env, it is "easy" fork this projet and git clone your repo after go on the PowerFGT folder and use import-module ./PowerFGT (you can use -force) |
One of the most common things that I have to do that I'd love to script is to add a new IP address, then add that as a member to an addressgroup. When do you think we might see SET-* and ADD-* capabilities ?
As a side question, I'm still digging in to the capabilities, but wondered is there an easy way to pipeline entries from the member list of an address group to get the address values? Here's a hypothetical example of what I'm talking about:
The text was updated successfully, but these errors were encountered: