Skip to content

Commit

Permalink
Remove 40 char API Key Validation (#145) (#146)
Browse files Browse the repository at this point in the history
* Remove 40 char API Key Validation (#145)

* remove 40char api key validation

* fix migrate button

* changelog

* Cut 4355 improve revert account rules (#148)

* track variable

* remove exe

* changelog

* changelog

* fix gui localusername

* fix MTP with Form

* changelog

* autobind fix

* exe folder

* remove test txt

* skip

* exe

* exe readme + test
  • Loading branch information
kmaranionjc authored Dec 4, 2024
1 parent 34a8fb5 commit c853ba1
Show file tree
Hide file tree
Showing 9 changed files with 79 additions and 74 deletions.
16 changes: 16 additions & 0 deletions ModuleChangelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## 2.7.9

Release Date: November 21, 2024

#### RELEASE NOTES
```
* This release removes 40 char API key validation
* When the migration fails during the account copy/merge processes, the tool would revert and remove the newly created account. We risk deleting user data once we do the account reversal in this step. To combat this, we have added a tracker to not remove the created account profile during account merge failure.
* Remove unused .exe files
```
#### Bug Fixes:
```
* Fix progress form buttons disabled when JCAgent install fails
* Fix issue with JCUsername that have a localUsername where progress form GUI get's stuck during migration when AutoBind is selected
* Fix issue with MTP selection popups when migrating a user that belongs to an MTP
```
## 2.7.8

Release Date: October 14, 2024
Expand Down
4 changes: 4 additions & 0 deletions jumpcloud-ADMU/Exe/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# JumpCloud ADMU EXE

The latest version of the JumpCloud admu including exe files can be found on our releases page.
[https://github.com/TheJumpCloud/jumpcloud-ADMU/releases](https://github.com/TheJumpCloud/jumpcloud-ADMU/releases)
Binary file removed jumpcloud-ADMU/Exe/gui_jcadmu.exe
Binary file not shown.
Binary file removed jumpcloud-ADMU/Exe/uwp_jcadmu.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion jumpcloud-ADMU/JumpCloud.ADMU.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

# Version number of this module.

ModuleVersion = '2.7.8'
ModuleVersion = '2.7.9'

# Supported PSEditions
# CompatiblePSEditions = @()
Expand Down
25 changes: 14 additions & 11 deletions jumpcloud-ADMU/Powershell/Form.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function show-mtpSelection {
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="JumpCloud ADMU 2.7.8"
Title="JumpCloud ADMU 2.7.9"
WindowStyle="SingleBorderWindow"
ResizeMode="NoResize"
Background="White" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Visible" Width="1020" Height="590">
Expand Down Expand Up @@ -525,7 +525,7 @@ Function Test-Button([object]$tbJumpCloudUserName, [object]$tbJumpCloudConnectKe
If (![System.String]::IsNullOrEmpty($lvProfileList.SelectedItem.UserName)) {
If (!(Test-IsNotEmpty $tbJumpCloudUserName.Text) -and (Test-HasNoSpace $tbJumpCloudUserName.Text) -and (($($tbJumpCloudUserName.Text).length) -le 20) `
-and ((Test-CharLen -len 40 -testString $tbJumpCloudConnectKey.Password) -and (Test-HasNoSpace $tbJumpCloudConnectKey.Password) -and ($cb_installjcagent.IsChecked -eq $true))`
-and ((Test-CharLen -len 40 -testString $tbJumpCloudAPIKey.Password) -and (Test-HasNoSpace $tbJumpCloudAPIKey.Password) -and ($cb_autobindjcuser.IsChecked -eq $true))`
-and (!(Test-IsNotEmpty $tbJumpCloudAPIKey.Password) -and ($cb_autobindjcuser.IsChecked -eq $true))`
-and ((Test-CharLen -len 24 -testString $Env:selectedOrgID) -and (Test-HasNoSpace $Env:selectedOrgID) -and ($cb_autobindjcuser.IsChecked -eq $true))`
-and !(Test-IsNotEmpty $tbTempPassword.Text) -and (Test-HasNoSpace $tbTempPassword.Text)`
-and !(($($lvProfileList.selectedItem.Username) -split '\\')[0] -match $WmiComputerSystem.Name)`
Expand All @@ -541,7 +541,7 @@ Function Test-Button([object]$tbJumpCloudUserName, [object]$tbJumpCloudConnectKe
$script:bMigrateProfile.IsEnabled = $true
Return $true
} ElseIf (!(Test-IsNotEmpty $tbJumpCloudUserName.Text) -and (Test-HasNoSpace $tbJumpCloudUserName.Text) -and (($($tbJumpCloudUserName.Text).length) -le 20) `
-and ((Test-CharLen -len 40 -testString $tbJumpCloudAPIKey.Password) -and (Test-HasNoSpace $tbJumpCloudAPIKey.Password) -and ($cb_autobindjcuser.IsChecked -eq $true) -and ($cb_installjcagent.IsChecked -eq $false))`
-and (!(Test-IsNotEmpty $tbJumpCloudAPIKey.Password) -and ($cb_autobindjcuser.IsChecked -eq $true) -and ($cb_installjcagent.IsChecked -eq $false))`
-and ((Test-CharLen -len 24 -testString $Env:selectedOrgID) -and (Test-HasNoSpace $Env:selectedOrgID) -and ($cb_autobindjcuser.IsChecked -eq $true) -and ($cb_installjcagent.IsChecked -eq $false))`
-and !(Test-IsNotEmpty $tbTempPassword.Text) -and (Test-HasNoSpace $tbTempPassword.Text)`
-and !(Test-Localusername $tbJumpCloudUserName.Text)) {
Expand Down Expand Up @@ -629,7 +629,7 @@ $cb_autobindjcuser.Add_Checked( { $cb_bindAsAdmin.IsEnabled = $true })
$cb_bindAsAdmin.Add_Checked( { $script:BindAsAdmin = $true })
$cb_autobindjcuser.Add_Checked( {
Test-Button -tbJumpCloudUserName:($tbJumpCloudUserName) -tbJumpCloudConnectKey:($tbJumpCloudConnectKey) -tbTempPassword:($tbTempPassword) -lvProfileList:($lvProfileList) -tbJumpCloudAPIKey:($tbJumpCloudAPIKey)
If (((Test-CharLen -len 40 -testString $tbJumpCloudAPIKey.Password) -and (Test-HasNoSpace $tbJumpCloudAPIKey.Password)) -eq $false) {
If (Test-IsNotEmpty $tbJumpCloudAPIKey.Password ) {
#$tbJumpCloudAPIKey.Tooltip = "API Key Must be 40chars & Not Contain Spaces"
$tbJumpCloudAPIKey.Background = "#FFC6CBCF"
$tbJumpCloudAPIKey.BorderBrush = "#FFF90000"
Expand All @@ -652,7 +652,7 @@ $cb_autobindjcuser.Add_Unchecked( { $cb_bindAsAdmin.IsChecked = $false })
$cb_bindAsAdmin.Add_Unchecked( { $script:BindAsAdmin = $false })
$cb_autobindjcuser.Add_Unchecked( {
Test-Button -tbJumpCloudUserName:($tbJumpCloudUserName) -tbJumpCloudConnectKey:($tbJumpCloudConnectKey) -tbTempPassword:($tbTempPassword) -lvProfileList:($lvProfileList) -tbJumpCloudAPIKey:($tbJumpCloudAPIKey)
If (((Test-CharLen -len 40 -testString $tbJumpCloudAPIKey.Password) -and (Test-HasNoSpace $tbJumpCloudAPIKey.Password) -or ($cb_autobindjcuser.IsEnabled)) -eq $false) {
If ((!(Test-IsNotEmpty $tbJumpCloudAPIKey.Password) -or ($cb_autobindjcuser.IsEnabled)) -eq $false) {
#$tbJumpCloudAPIKey.Tooltip = "API Key Must be 40chars & Not Contain Spaces"
$tbJumpCloudAPIKey.Background = "#FFC6CBCF"
$tbJumpCloudAPIKey.BorderBrush = "#FFF90000"
Expand Down Expand Up @@ -721,11 +721,11 @@ $tbJumpCloudConnectKey.Add_PasswordChanged( {

$tbJumpCloudAPIKey.Add_PasswordChanged( {
Test-Button -tbJumpCloudUserName:($tbJumpCloudUserName) -tbJumpCloudConnectKey:($tbJumpCloudConnectKey) -tbTempPassword:($tbTempPassword) -lvProfileList:($lvProfileList) -tbJumpCloudAPIKey:($tbJumpCloudAPIKey)
If (((Test-CharLen -len 40 -testString $tbJumpCloudAPIKey.Password) -and (Test-HasNoSpace $tbJumpCloudAPIKey.Password)) -eq $false) {
If (Test-IsNotEmpty $tbJumpCloudAPIKey.Password) {
$tbJumpCloudAPIKey.Background = "#FFC6CBCF"
$tbJumpCloudAPIKey.BorderBrush = "#FFF90000"
$img_apikey_valid.Source = DecodeBase64Image -ImageBase64 $ErrorBase64
$img_apikey_valid.ToolTip = "Jumpcloud API Key must be 40chars & not contain spaces."
$img_apikey_valid.ToolTip = "Please enter a valid JumpCloud API Key"

} Else {
# Get org name/ id
Expand All @@ -741,6 +741,9 @@ $tbJumpCloudAPIKey.Add_PasswordChanged( {
$img_apikey_valid.ToolTip = $null
Test-Button -tbJumpCloudUserName:($tbJumpCloudUserName) -tbJumpCloudConnectKey:($tbJumpCloudConnectKey) -tbTempPassword:($tbTempPassword) -lvProfileList:($lvProfileList) -tbJumpCloudAPIKey:($tbJumpCloudAPIKey)
} catch {
$script:bMigrateProfile.IsEnabled = $false
$img_apikey_valid.Source = DecodeBase64Image -ImageBase64 $ErrorBase64
$img_apikey_valid.ToolTip = "Please enter a valid JumpCloud API Key"
$OrgSelection = ""
$lbl_orgName.Text = ""
$img_apikey_valid.Source = DecodeBase64Image -ImageBase64 $ErrorBase64
Expand Down Expand Up @@ -801,7 +804,7 @@ $bMigrateProfile.Add_Click( {
Write-ToLog "ConnectKey is populated, JumpCloud agent will be installed"
}

$testResult, $JumpCloudUserId, $jcUsername, $JCSystemUsername = Test-JumpCloudUsername -JumpCloudApiKey $tbJumpCloudAPIKey.Password -JumpCloudOrgID $Env:selectedOrgID -Username $tbJumpCloudUserName.Text -Prompt $true
$testResult, $JumpCloudUserId, $JCSystemUsername = Test-JumpCloudUsername -JumpCloudApiKey $tbJumpCloudAPIKey.Password -JumpCloudOrgID $Env:selectedOrgID -Username $tbJumpCloudUserName.Text -Prompt $true
if ($testResult) {
Write-ToLog "Matched $($tbJumpCloudUserName.Text) with user in the JumpCloud Console"
} else {
Expand All @@ -821,13 +824,13 @@ $bMigrateProfile.Add_Click( {
# Create a pop up that warns user then press ok to continue
Write-ToLog "JCSystemUsername $($JCSystemUsername) is the same as the another profile on this system"
$wshell = New-Object -ComObject Wscript.Shell
$message = "The JumpCloud User: $($jcUsername) has a local account username of: $($jcsystemUserName). A local account already exists on this system with username: $($JCSystemUsername), please consider removing either the local account on this system or removing the local user account field from the JumpCloud user."
$message = "The JumpCloud User: $($tbJumpCloudUserName.Text) has a local account username of: $($jcsystemUserName). A local account already exists on this system with username: $($JCSystemUsername), please consider removing either the local account on this system or removing the local user account field from the JumpCloud user."
$var = $wshell.Popup("$message", 0, "JumpCloud SystemUsername and Local Computer Username Validation", 0)
# the user can not continue with migration at this stage
return
}
$wshell = New-Object -ComObject Wscript.Shell
$message = "The JumpCloud User: $($jcUsername) has a local account username of: $($jcsystemUserName). After migration $($SelectedUserName) would be migrated and accessible with the local account username of: $($jcsystemUserName) Would you like to continue?"
$message = "The JumpCloud User: $($tbJumpCloudUserName.Text) has a local account username of: $($jcsystemUserName). After migration $($SelectedUserName) would be migrated and accessible with the local account username of: $($jcsystemUserName) Would you like to continue?"
$var = $wshell.Popup("$message", 0, "JumpCloud Local User Validation", 64 + 4)
# If user selects yes then migrate the local user profile to the JumpCloud User

Expand All @@ -838,7 +841,7 @@ $bMigrateProfile.Add_Click( {
return
}
} else {
Write-ToLog "User $($jcUsername) does not have a local account on this system"
Write-ToLog "User $($tbJumpCloudUserName.Text) does not have a local account on this system"
}
}
# Build FormResults object
Expand Down
2 changes: 1 addition & 1 deletion jumpcloud-ADMU/Powershell/ProgressForm.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ function New-ProgressForm {
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Name="Window" Title="JumpCloud ADMU 2.7.8"
Name="Window" Title="JumpCloud ADMU 2.7.9"
WindowStyle="SingleBorderWindow"
ResizeMode="NoResize"
Background="White" Width="720" Height="550 ">
Expand Down
Loading

0 comments on commit c853ba1

Please sign in to comment.