From b9b5851aaa92f336eed67ecbcdc0f6a2448e80fb Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Fri, 4 Aug 2023 15:38:48 +0200 Subject: [PATCH 1/9] Fix display of Summary Chapiter when there is only 1 entry With PS5, you need to use @(variable).count... --- Src/Private/Get-AbrFgtFirewall.ps1 | 10 +++++----- Src/Private/Get-AbrFgtRoute.ps1 | 6 +++--- Src/Private/Get-AbrFgtUser.ps1 | 10 +++++----- Src/Private/Get-AbrFgtVPNIPsec.ps1 | 4 ++-- Src/Private/Get-AbrFgtVPNSSL.ps1 | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Src/Private/Get-AbrFgtFirewall.ps1 b/Src/Private/Get-AbrFgtFirewall.ps1 index f38c5a3..15ed174 100644 --- a/Src/Private/Get-AbrFgtFirewall.ps1 +++ b/Src/Private/Get-AbrFgtFirewall.ps1 @@ -41,11 +41,11 @@ function Get-AbrFgtFirewall { Paragraph "The following section provides a summary of firewall settings." BlankLine $OutObj = [pscustomobject]@{ - "Address" = $Address.count - "Group" = $Group.count - "IP Pool" = $IPPool.count - "Virtual IP" = $VIP.count - "Policy" = $Policy.count + "Address" = @($Address).count + "Group" = @($Group).count + "IP Pool" = @($IPPool).count + "Virtual IP" = @($VIP).count + "Policy" = @($Policy).count } $TableParams = @{ diff --git a/Src/Private/Get-AbrFgtRoute.ps1 b/Src/Private/Get-AbrFgtRoute.ps1 index 58bc994..62191af 100644 --- a/Src/Private/Get-AbrFgtRoute.ps1 +++ b/Src/Private/Get-AbrFgtRoute.ps1 @@ -39,9 +39,9 @@ function Get-AbrFgtRoute { Paragraph "The following section provides a summary of route settings." BlankLine $OutObj = [pscustomobject]@{ - "Monitor Route" = $MonitorRouterIPv4.count - "Static Route" = $Statics.count - "Policy Based Route" = $PolicyBasedRouting.count + "Monitor Route" = @($MonitorRouterIPv4).count + "Static Route" = @($Statics).count + "Policy Based Route" = @($PolicyBasedRouting).count } $TableParams = @{ diff --git a/Src/Private/Get-AbrFgtUser.ps1 b/Src/Private/Get-AbrFgtUser.ps1 index 88588e7..862d535 100644 --- a/Src/Private/Get-AbrFgtUser.ps1 +++ b/Src/Private/Get-AbrFgtUser.ps1 @@ -43,11 +43,11 @@ function Get-AbrFgtUser { Paragraph "The following section provides a summary of user settings." BlankLine $OutObj = [pscustomobject]@{ - "User" = $Users.count - "Group" = $Groups.count - "LDAP" = $LDAPS.count - "RADIUS" = $RADIUS.count - "SAML" = $SAML.count + "User" = @($Users).count + "Group" = @($Groups).count + "LDAP" = @($LDAPS).count + "RADIUS" = @($RADIUS).count + "SAML" = @($SAML).count } $TableParams = @{ diff --git a/Src/Private/Get-AbrFgtVPNIPsec.ps1 b/Src/Private/Get-AbrFgtVPNIPsec.ps1 index 0d8a5f7..9f10489 100644 --- a/Src/Private/Get-AbrFgtVPNIPsec.ps1 +++ b/Src/Private/Get-AbrFgtVPNIPsec.ps1 @@ -38,8 +38,8 @@ function Get-AbrFgtVPNIPsec { Paragraph "The following section provides a summary of VPN IPsec settings." BlankLine $OutObj = [pscustomobject]@{ - "VPN IPsec Phase 1" = $vpn_ph1.count - "VPN IPsec Phase 2" = $vpn_ph2.count + "VPN IPsec Phase 1" = @($vpn_ph1).count + "VPN IPsec Phase 2" = @($vpn_ph2).count } $TableParams = @{ diff --git a/Src/Private/Get-AbrFgtVPNSSL.ps1 b/Src/Private/Get-AbrFgtVPNSSL.ps1 index d16664e..ca52956 100644 --- a/Src/Private/Get-AbrFgtVPNSSL.ps1 +++ b/Src/Private/Get-AbrFgtVPNSSL.ps1 @@ -39,8 +39,8 @@ function Get-AbrFgtVPNSSL { Paragraph "The following section provides a summary of VPN SSL settings." BlankLine $OutObj = [pscustomobject]@{ - "Portal" = $settings.count - "User (connected)" = $users.Count + "Portal" = @($settings).count + "User (connected)" = @($users).Count } $TableParams = @{ From cc08062bd0809ae6ee53c16f767098967e3e8914 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Fri, 4 Aug 2023 15:52:02 +0200 Subject: [PATCH 2/9] System: Enhance display of Trusted Host Remove display of 'All Network (0.0.0.0 0.0.0.0)' (value by default) Close: #39 --- Src/Private/Get-AbrFgtSystem.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Src/Private/Get-AbrFgtSystem.ps1 b/Src/Private/Get-AbrFgtSystem.ps1 index 09a2ee4..fae05fe 100644 --- a/Src/Private/Get-AbrFgtSystem.ps1 +++ b/Src/Private/Get-AbrFgtSystem.ps1 @@ -215,6 +215,10 @@ function Get-AbrFgtSystem { $trustedHosts += $admin.trusthost9 $trustedHosts += $admin.trusthost10 + $trustedHosts = $trustedHosts -replace "0.0.0.0 0.0.0.0", "" #Remove 'All Network' + if($trustedHosts -eq ""){ + $trustedHosts = "All" #TODO: Add Health Warning ! + } $OutObj += [pscustomobject]@{ "Name" = $admin.name "Profile" = $admin.accprofile From 981c4538f527ce94c7dd58fd824e74bd6be45064 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Fri, 4 Aug 2023 16:00:04 +0200 Subject: [PATCH 3/9] System: Add newline between each trusthost --- Src/Private/Get-AbrFgtSystem.ps1 | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Src/Private/Get-AbrFgtSystem.ps1 b/Src/Private/Get-AbrFgtSystem.ps1 index fae05fe..93dfd7f 100644 --- a/Src/Private/Get-AbrFgtSystem.ps1 +++ b/Src/Private/Get-AbrFgtSystem.ps1 @@ -204,18 +204,18 @@ function Get-AbrFgtSystem { foreach ($admin in $Admins) { - $trustedHosts = $admin.trusthost1 - $trustedHosts += $admin.trusthost2 - $trustedHosts += $admin.trusthost3 - $trustedHosts += $admin.trusthost4 - $trustedHosts += $admin.trusthost5 - $trustedHosts += $admin.trusthost6 - $trustedHosts += $admin.trusthost7 - $trustedHosts += $admin.trusthost8 - $trustedHosts += $admin.trusthost9 - $trustedHosts += $admin.trusthost10 - - $trustedHosts = $trustedHosts -replace "0.0.0.0 0.0.0.0", "" #Remove 'All Network' + $trustedHosts = $admin.trusthost1 + "`n" + $trustedHosts += $admin.trusthost2 + "`n" + $trustedHosts += $admin.trusthost3 + "`n" + $trustedHosts += $admin.trusthost4 + "`n" + $trustedHosts += $admin.trusthost5 + "`n" + $trustedHosts += $admin.trusthost6 + "`n" + $trustedHosts += $admin.trusthost7 + "`n" + $trustedHosts += $admin.trusthost8 + "`n" + $trustedHosts += $admin.trusthost9 + "`n" + $trustedHosts += $admin.trusthost10 + "`n" + + $trustedHosts = $trustedHosts -replace "0.0.0.0 0.0.0.0`n", "" #Remove 'All Network' if($trustedHosts -eq ""){ $trustedHosts = "All" #TODO: Add Health Warning ! } From d7c3f479507200cfa9890e4e2203515d6521e00e Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Fri, 4 Aug 2023 16:02:18 +0200 Subject: [PATCH 4/9] System: Administrator: change ColumnWidths --- Src/Private/Get-AbrFgtSystem.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Private/Get-AbrFgtSystem.ps1 b/Src/Private/Get-AbrFgtSystem.ps1 index 93dfd7f..1b7d5fd 100644 --- a/Src/Private/Get-AbrFgtSystem.ps1 +++ b/Src/Private/Get-AbrFgtSystem.ps1 @@ -230,7 +230,7 @@ function Get-AbrFgtSystem { $TableParams = @{ Name = "Administrator" List = $false - ColumnWidths = 25, 25, 25, 25 + ColumnWidths = 25, 25, 35, 15 } if ($Report.ShowTableCaptions) { From 6c859dd924bec0423f8804334eb8c5b3907a9002 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Mon, 21 Aug 2023 21:58:53 +0200 Subject: [PATCH 5/9] System(Interface): Fix Get Interface when there is a VDOM Close: #44 --- Src/Private/Get-AbrFgtSystem.ps1 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Src/Private/Get-AbrFgtSystem.ps1 b/Src/Private/Get-AbrFgtSystem.ps1 index 1b7d5fd..3b5810b 100644 --- a/Src/Private/Get-AbrFgtSystem.ps1 +++ b/Src/Private/Get-AbrFgtSystem.ps1 @@ -243,6 +243,11 @@ function Get-AbrFgtSystem { $interfaces = Get-FGTSystemInterface + #By 'API' design, it is always return all interfaces (not filtering by vdom) + if ($null -ne $Options.vdom) { + $interfaces = $interfaces | Where-Object {$_.vdom -eq $Options.vdom } + } + if ($interfaces -and $InfoLevel.System -ge 1) { Section -Style Heading3 'Interfaces' { $OutObj = @() From 44760ca5894a276b45ddaf4306a5fca027c524fa Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Mon, 21 Aug 2023 22:01:33 +0200 Subject: [PATCH 6/9] VPN(SSL): Fix columnWitdhs for VPN SSL User Too --- Src/Private/Get-AbrFgtVPNSSL.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Src/Private/Get-AbrFgtVPNSSL.ps1 b/Src/Private/Get-AbrFgtVPNSSL.ps1 index ca52956..fade3b0 100644 --- a/Src/Private/Get-AbrFgtVPNSSL.ps1 +++ b/Src/Private/Get-AbrFgtVPNSSL.ps1 @@ -225,7 +225,7 @@ function Get-AbrFgtVPNSSL { $TableParams = @{ Name = "VPN SSL Users Connected" List = $false - ColumnWidths = 30, 20, 20, 40 + ColumnWidths = 30, 20, 20, 30 } if ($Report.ShowTableCaptions) { From d8e49a8b16c9d9d4f7457e06f9571c3ad28215a1 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Mon, 21 Aug 2023 22:05:01 +0200 Subject: [PATCH 7/9] ChaNGELOG(.md): Updated Fixed to 0.2.1 --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4eab59f..6326aa9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,12 @@ # :arrows_clockwise: Fortinet FortiGate As Built Report Changelog -## [0.2.1] - 2023-06-21 +## [0.2.1] - 2023-08-21 ### Fixed -- VPN SSL: VPN(SSL): fix ColumnWidths for Portal Summary [#35](https://github.com/AsBuiltReport/AsBuiltReport.Fortinet.FortiGate/pull/35) +- VPN SSL: VPN(SSL): fix ColumnWidths for Portal Summary [#35](https://github.com/AsBuiltReport/AsBuiltReport.Fortinet.FortiGate/pull/35) And Users [#48](https://github.com/AsBuiltReport/AsBuiltReport.Fortinet.FortiGate/pull/48) - SAML(User): Don't get when use old Fortigate release (< 6.2.0) [#36](https://github.com/AsBuiltReport/AsBuiltReport.Fortinet.FortiGate/pull/36) +- VDOM options - Interfaces [#44](https://github.com/AsBuiltReport/AsBuiltReport.Fortinet.FortiGate/issues/44) ## [0.2.0] - 2023-05-17 From a6bf9b7366a9d29aca0b7926d571b4f3bc452aa0 Mon Sep 17 00:00:00 2001 From: Tim Carman Date: Wed, 23 Aug 2023 12:16:23 +1000 Subject: [PATCH 8/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0908350..1296264 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@

- +

From 1fbe0db2752f4b1b2393f41af82c34b78ec31178 Mon Sep 17 00:00:00 2001 From: Tim Carman Date: Wed, 23 Aug 2023 12:16:51 +1000 Subject: [PATCH 9/9] Update manifest IconUri --- AsBuiltReport.Fortinet.FortiGate.psd1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AsBuiltReport.Fortinet.FortiGate.psd1 b/AsBuiltReport.Fortinet.FortiGate.psd1 index 60aa497..99abff2 100644 --- a/AsBuiltReport.Fortinet.FortiGate.psd1 +++ b/AsBuiltReport.Fortinet.FortiGate.psd1 @@ -113,7 +113,7 @@ PrivateData = @{ ProjectUri = 'https://github.com/AsBuiltReport/AsBuiltReport.Fortinet.FortiGate' # A URL to an icon representing this module. - IconUri = 'https://raw.githubusercontent.com/AsBuiltReport/AsBuiltReport/master/AsBuiltReport.png' + IconUri = 'https://github.com/AsBuiltReport.png' # ReleaseNotes of this module ReleaseNotes = 'https://raw.githubusercontent.com/AsBuiltReport/AsBuiltReport.Fortinet.FortiGate/master/CHANGELOG.md'