-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds security hardening to JEA profiles by always prohibit certain cm…
…dlets
- Loading branch information
1 parent
fcd2d52
commit 406ea20
Showing
10 changed files
with
123 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
function Deny-IcingaJEACommand() | ||
{ | ||
param ( | ||
[string]$Command = $null, | ||
[string]$FileComments = $null | ||
); | ||
|
||
if ([string]::IsNullOrEmpty($Command) -eq $FALSE) { | ||
# Ensure certain commands are not added to the JEA profile | ||
switch ($Command.ToLower()) { | ||
'Register-ScheduledTask'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Start-ScheduledTask'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Unregister-ScheduledTask'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'New-ScheduledTaskAction'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Invoke-IcingaWindowsScheduledTask'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Start-IcingaWindowsScheduledTaskRenewCertificate'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Register-IcingaWindowsScheduledTaskRenewCertificate'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Stop-Process'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Remove-EventLog'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Unregister-IcingaEventLog'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Remove-Item'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Remove-ItemSecure'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Stop-Service'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Restart-Service'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Copy-ItemSecure'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Copy-Item'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Move-Item'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Restart-IcingaService'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Restart-IcingaForWindows'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Stop-IcingaWindowsService'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Stop-IcingaService'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Restart-IcingaService'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Restart-IcingaForWindows'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Remove-IcingaPowerShellConfig'.ToLower() { | ||
return $TRUE; | ||
}; | ||
'Add-Content'.ToLower() { | ||
return $TRUE; | ||
}; | ||
} | ||
} | ||
|
||
if ([string]::IsNullOrEmpty($FileComments) -eq $FALSE) { | ||
if ($FileComments.ToLower().Contains('ignorejea')) { | ||
return $TRUE; | ||
} | ||
} | ||
|
||
return $FALSE; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters