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

[ BUG ] Import-FalconConfig failing on PowerShell Core with Key cannot be null error #241

Closed
quantmn5 opened this issue Sep 15, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@quantmn5
Copy link

Describe the bug
I'm still facing issues with build 2.2.2 while importing a previously exported falcon-config.
Importing host-groups, prevention policy and response policies are all failing.
I try to import a config-export for a freshly provisioned Customer ID (no config set besides default prevention policies).

Not sure if i'm doing anything wrong here.. it all worked fine in the second last version. PSFalcon 2.2.1 did not work, neither is the current version.

To Reproduce
Simply using the import-FalconConfig with or without -assignexisting /-modifyexisting / -modifydefault flags results in the errors you can find in the attached screenshot.

Expected behavior
I expect the config to be imported properly.

Environment (please complete the following information):

  • OS: Windows11
  • PowerShell: 7.2.6
  • PSFalcon: 2.2.2

Import_Config
Additional context

Transcript content
Invoke-FalconPreventionPolicyAction: C:\Users\username\Documents\Powershell\Modules\PSFalcon\2.2.2\Public\psf.config.ps1:340

$PolicyID | & "Invoke-Falcon$($Type)Action" -Name $Action
Cannot validate argument on parameter 'Id'. The argument " " does not match the "^[a-fA-F0-9]${32}$" pattern.
Supply an argument that matches "^[a-fA-F0-9]${32}$" and try again.

@quantmn5 quantmn5 added the bug Something isn't working label Sep 15, 2022
@bk-cs
Copy link
Collaborator

bk-cs commented Sep 15, 2022

I was able to narrow down the error (which only occurs when using PowerShell Core) to the Confirm-Parameter private function. Through some testing, I believe I have an updated version of Confirm-Parameter that will fix this problem.

Can you replace the contents of the Private\Private.ps1 file in your local PSFalcon module with the contents of the file below?

https://raw.githubusercontent.com/CrowdStrike/psfalcon/2.2.3/Private/Private.ps1

Once complete, you'll need to reload PowerShell, re-import PSFalcon and retry Import-FalconConfig.

@bk-cs bk-cs changed the title [ BUG ] Import-FalconConfig still not importing configured settings [ BUG ] Import-FalconConfig failing on PowerShell Core Sep 15, 2022
bk-cs added a commit that referenced this issue Sep 15, 2022
Issue #241: Updated `Confirm-Parameter` to eliminate `Cannot validate argument on parameter 'Array'. Key cannot be null. (Parameter 'key')` errors generated when using `Import-FalconConfig`.
@bk-cs bk-cs changed the title [ BUG ] Import-FalconConfig failing on PowerShell Core [ BUG ] Import-FalconConfig failing on PowerShell Core with Key cannot be null error Sep 15, 2022
@quantmn5
Copy link
Author

Works perfectly fine with the new Private.ps1 file. Thanks for your support!

@bk-cs
Copy link
Collaborator

bk-cs commented Sep 19, 2022

Leaving open in case others run into this issue before the 2.2.3 release.

@bk-cs bk-cs reopened this Sep 19, 2022
@bk-cs bk-cs mentioned this issue Oct 31, 2022
2 tasks
@bk-cs
Copy link
Collaborator

bk-cs commented Oct 31, 2022

Resolved in v2.2.3 release.

@bk-cs bk-cs closed this as completed Oct 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants