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

Add Local User (Add/Set/Remove) #190

Merged
merged 34 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
8247ec4
Add Add-FGTUserLocal function
May 30, 2022
087abc6
Add remove function
May 30, 2022
22144c0
Add Set function
May 31, 2022
799c488
Add Confirm function
May 31, 2022
d6e6d16
Add Tests
May 31, 2022
74ad428
Add pester variable
May 31, 2022
96235d4
add password variable
May 31, 2022
79587b3
Add password in ADD function
May 31, 2022
f316a35
Fix confirm.ps1
May 31, 2022
3b226a1
Fix typo
May 31, 2022
654fad2
Fix Tests (Add two-factor)
May 31, 2022
17dcb9f
Fix set function and tests
May 31, 2022
78b9b37
Fix tests
May 31, 2022
9554af5
Add Confirm-FGTUserLocal to set and remove
May 31, 2022
a42efd3
Change password to securestring
May 31, 2022
284323a
Change password to securestring on set function
May 31, 2022
9318d92
remove variable not used
May 31, 2022
d59e4e0
Fix after review
Jun 14, 2022
1d7bebb
Fix after review on Confirm.ps1
Jun 14, 2022
bc04ab5
Fix after review on local.ps1
Jun 14, 2022
25c7980
Changes after review (mostly MFA and Secure Password)
Aug 26, 2024
f7e1146
Change password to securestring for Tests User
Aug 26, 2024
c431a96
Change test file (Wrong variable)
Aug 26, 2024
182392a
Remove RADIUS/TACACS+ and merge two_factor and two_factor_authentication
Aug 30, 2024
6af9efd
Fix SMS and add -data
Aug 30, 2024
33208c5
Fix -data
Aug 30, 2024
208141f
Add -data in Tests
Aug 30, 2024
c45ff78
Remove two_factor_authentication from confirm.ps1
Aug 30, 2024
51e43a1
Fix tests
Aug 30, 2024
601ce0f
Fix Set test
Sep 2, 2024
1c745fc
Fix Powershell 5 -AsPLainText on ConvertFrom-SecureString
Sep 3, 2024
fe190b0
Add Meta tests
Sep 4, 2024
1e57479
Fix meta tests
Sep 4, 2024
71729c6
fix meta tests (remove count test)
Sep 4, 2024
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
48 changes: 48 additions & 0 deletions PowerFGT/Private/Confirm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -386,3 +386,51 @@ Function Confirm-FGTVpnIpsecPhase2Interface {

$true
}

Function Confirm-FGTUserLocal {

Param (
[Parameter (Mandatory = $true)]
[object]$argument
)

if ( -not ( $argument | get-member -name name -Membertype Properties)) {
throw "Element specified does not contain a name property."
}
if ( -not ( $argument | get-member -name status -Membertype Properties)) {
throw "Element specified does not contain a status property."
}
if ( -not ( $argument | get-member -name type -Membertype Properties)) {
throw "Element specified does not contain a type property."
}
if ( -not ( $argument | get-member -name passwd -Membertype Properties)) {
throw "Element specified does not contain a passwd property."
}
if ( -not ( $argument | get-member -name ldap-server -Membertype Properties)) {
throw "Element specified does not contain a ldap-server property."
}
if ( -not ( $argument | get-member -name radius-server -Membertype Properties)) {
throw "Element specified does not contain a radius-server property."
}
if ( -not ( $argument | get-member -name tacacs+-server -Membertype Properties)) {
throw "Element specified does not contain a tacacs+-server property."
}
if ( -not ( $argument | get-member -name two-factor -Membertype Properties)) {
throw "Element specified does not contain a two-factor property."
}
if ( -not ( $argument | get-member -name two-factor-authentication -Membertype Properties)) {
throw "Element specified does not contain a two-factor-authentication property."
}
if ( -not ( $argument | get-member -name fortitoken -Membertype Properties)) {
throw "Element specified does not contain a fortitoken property."
}
if ( -not ( $argument | get-member -name email-to -Membertype Properties)) {
throw "Element specified does not contain an email-to property."
}
if ( -not ( $argument | get-member -name sms-server -Membertype Properties)) {
throw "Element specified does not contain a sms-server property."
}

$true

}
Loading
Loading