Skip to content
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

ServiceCustom: Add Add/Set/Remove Custom Serivce #295

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
8048324
Feat(ServiceCustom): Add Add-FGTFirewallServiceCustom
alagoutte Feb 4, 2025
f28262d
feat(servicecustom): Add Remove-FGTFirewallCustomService
alagoutte Feb 4, 2025
3121f4d
fix(servicecustom): Fix typo
alagoutte Feb 4, 2025
6bce394
feat(serviceCustom): Add Set-FGTFirewallserviceCustom
alagoutte Feb 4, 2025
2895a36
fix(customeservice): fix typo on variable name
alagoutte Feb 4, 2025
cf5f29f
fix(servicecustom): fix Parameter
alagoutte Feb 6, 2025
e0c9264
fix(servicecustom): fix sctp_port...
alagoutte Feb 6, 2025
2932eac
fix(servicecustom): fix missing protocol
alagoutte Feb 6, 2025
13c2e4b
feat(servicecustom): Add Tests
alagoutte Feb 6, 2025
11271e9
fix(customservice): Remove uuid of Confirm-FGTServiceCustom
alagoutte Feb 6, 2025
4f89701
fix(customservice): fix Tests with uuid
alagoutte Feb 7, 2025
d6391e4
fix(customservice): fix Tests when using FortiOS 7.6.x
alagoutte Feb 7, 2025
4e842fc
fix(customservice): fix ICMP (not supported before 6.4.0)
alagoutte Feb 7, 2025
b475fb3
ServiceCustom: Add test for change name of Service Custom
alagoutte Feb 11, 2025
a9fd27a
ServiceCustom: Add Set (TCP/UDP/STCP/IP/ICMP) Tests
alagoutte Feb 17, 2025
4c4dd2a
ServiceCustom(Tests): Add Set with -data
alagoutte Feb 17, 2025
c201a81
ServiceCustom(Tests): Fix Set when using FOrtiOS 7.6.0
alagoutte Feb 17, 2025
9c37c60
ServiceCustom: Add Category parameter (for Add and Set)
alagoutte Feb 17, 2025
3aa4379
ServiceCustom: Fix typo
alagoutte Feb 17, 2025
d463d3d
ServiceCustom: Fix variable name 'customservice' -> 'servicecustom'
alagoutte Feb 17, 2025
db03344
README(.md): Add Chapiter about Service Custom
alagoutte Feb 17, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
README(.md): Add Chapiter about Service Custom
  • Loading branch information
alagoutte committed Feb 17, 2025
commit db033449f511fddec68ff8972e8401dab8c9e2c9
66 changes: 65 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ With this module (version 0.9.0) you can manage:
- [Router OSPF](#ospf) (Get/Set)
- RoutePolicy (Get)
- [SDN Connector](#sdn-connector) (Get)
- Service (Get)
- [Service Custom](#service-custom) (Add/Get/Set/Remove)
- Service Group (Get)
- [Static Route](#static-route) (Add/Get/Remove)
- System Admin / Virtual Switch (Get)
Expand Down Expand Up @@ -1707,6 +1707,70 @@ or delete it `Remove-FGTSystemSDNConnector`.
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y
```

### Service Custom

You can create a new Service Custom `Add-FGTFirewallServiceCustom`,
retrieve its information `Get-FGTFirewallServiceCustom`, modify its properties `Set-FGTFirewallServiceCustom`
or delete it `Remove-FGTFirewallServiceCustom`.

```powershell

# Create a new Service Custom (TCP 8080)
Add-FGTFirewallServiceCustom -Name MyServiceCustomTCP8080 -tcp_port 8080

name : MyServiceCustomTCP8080
q_origin_key : MyServiceCustomTCP8080
proxy : disable
category :
protocol : TCP/UDP/SCTP
helper : auto
iprange : 0.0.0.0
fqdn :
tcp-portrange : 8080
udp-portrange :
sctp-portrange :
[...]


# Get information about ALL Service Custom (using Format Table)
Get-FGTFirewallServiceCustom | Format-Table

name q_origin_key proxy category protocol helper iprange fqdn tcp-portrange
---- ------------ ----- -------- -------- ------ ------- ---- -------------
DNS DNS disable Network Services TCP/UDP/SCTP auto 0.0.0.0 53
HTTP HTTP disable Web Access TCP/UDP/SCTP auto 0.0.0.0 80
HTTPS HTTPS disable Web Access TCP/UDP/SCTP auto 0.0.0.0 443
IMAP IMAP disable Email TCP/UDP/SCTP auto 0.0.0.0 143
IMAPS IMAPS disable Email TCP/UDP/SCTP auto 0.0.0.0 993
[...]

# Modify a Service Custom (tcp_port, comment ...)
Get-FGTFirewallServiceCustom MyServiceCustomTCP8080 | Set-fGTFirewallServiceCustom -tcp_port 8080-8081 -comment "My new Comment"

name : MyServiceCustomTCP8080
q_origin_key : MyServiceCustomTCP8080
proxy : disable
category :
protocol : TCP/UDP/SCTP
helper : auto
iprange : 0.0.0.0
fqdn :
tcp-portrange : 8080-8081
udp-portrange :q
sctp-portrange :
[...]
comment : My new Comment
[...]

# Remove a Service Custom
Get-FGTFirewallServiceCustom MyServiceCustomTCP8080 | Remove-FGTFirewallServiceCustom

Confirm
Are you sure you want to perform this action?
Performing the operation "Remove Firewall Service Custom" on target "MyServiceCustomTCP8080".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y
```

### VPN IPsec

#### VPN IPsec Interface Phase 1
Expand Down