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 Dialogs to ESC1 #189

Merged
merged 3 commits into from
Dec 11, 2024
Merged

Add Dialogs to ESC1 #189

merged 3 commits into from
Dec 11, 2024

Conversation

jakehildreth
Copy link
Owner

This PR adds a couple questions to Modes 1, 3 and 4 when an ESC1 is identified:

  1. Does [Security Principal] need to Enroll in the [Template Name] template? [y/n/unsure]
  • If 'n', provide guidance on using GUI to remove Enroll/Autoenroll rights.
  • If 'y' or 'unsure', ask next question.
  1. Is the [Template Name] certificate frequently requested? [y/n/unsure]
  • If 'n', provide code for enabling Manager Approval.
  • If 'y', report that Locksmith is unsure of the best option and provide 3 options.

This should resolve #151. I decided ESC2s and ESC3s should always require Manager Approval.

@jakehildreth jakehildreth changed the title Add Dialogs to ESC1-3 Add Dialogs to ESC1 Dec 4, 2024
Copy link

github-actions bot commented Dec 4, 2024

🦙 MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Elapsed time
⚠️ COPYPASTE jscpd yes 21 2.02s
⚠️ EDITORCONFIG editorconfig-checker 6 1 0.25s
⚠️ MARKDOWN markdownlint 1 11 0.73s
⚠️ MARKDOWN markdown-link-check 1 8 2.85s
✅ MARKDOWN markdown-table-formatter 1 0 0.76s
⚠️ POWERSHELL powershell 5 4 10.29s
✅ POWERSHELL powershell_formatter 5 0 7.15s
⚠️ REPOSITORY checkov yes 1 14.07s
✅ REPOSITORY gitleaks yes no 0.9s
✅ REPOSITORY git_diff yes no 0.01s
✅ REPOSITORY grype yes no 19.99s
✅ REPOSITORY secretlint yes no 0.88s
✅ REPOSITORY trivy yes no 5.66s
✅ REPOSITORY trivy-sbom yes no 1.77s
✅ REPOSITORY trufflehog yes no 7.03s
⚠️ SPELL cspell 7 177 6.22s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

Get-ADObject `$Object | Set-ADObject -Replace @{'msPKI-Enrollment-Flag' = 0}
"@
}
}

This comment was marked as duplicate.

# 5. Check the "Enroll" and/or "Autoenroll" boxes depending on your specific needs.
# 6. Click OK.
"@
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The strict no-indent on here-strings makes it hard to keep track of which closing brace corresponds with which block. # end if ___ tags might be helpful for these two closing braces. But that's purely for code review and wouldn't make any functional difference.

@@ -19,14 +19,14 @@ function Update-ESC4Remediation {
This function updates ESC4 remediations customized to the user's needs.

.EXAMPLE
$Target = Get-Target
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is plural now?

@@ -83,6 +83,11 @@ Get-ADObject `$Object | Set-ADObject -Replace @{'msPKI-Enrollment-Flag' = 0}
"@
Technique = 'ESC1'
}

if ( $Mode -in @(1, 3, 4) ) {
Update-ESC1Remediation -Issue $Issue
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haven't tested, but I feel like you need to capture the updated remediation in $Issue before continuing to return $Issue at the end of the function. (And I could be totally wrong.) Should this be something like:

if ( $Mode -in @(1, 3, 4) ) {
    $Issue = Update-ESC1Remediation -Issue $Issue
}

$Issue

Copy link
Collaborator

@SamErde SamErde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved with one question to catch me up and help me understand. :)

@jakehildreth jakehildreth merged commit 18cd70f into testing Dec 11, 2024
3 checks passed
@jakehildreth jakehildreth deleted the add-dialogs-to-esc1-3 branch December 13, 2024 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants