Replies: 9 comments 9 replies
-
Fantastic, been trying to figure out how to do this - have saved me a BUNCH |
Beta Was this translation helpful? Give feedback.
-
Based on the error message ... Child CID <child_cid> tried to edit parent CID <parent_cid> policy <policy_id> ... it seems something was put in place that prevents you from assigning Custom IOA rule groups to an inherited policy. In that case, you'd need to duplicate the inherited policy and assign the Custom IOA rule groups to that policy instead. This isn't how it always worked, so it's possible that this is not intended. I'll see what I can find out... |
Beta Was this translation helpful? Give feedback.
-
Other test scenarios checked after posting: 1 2 3 Happy to try any suggestions |
Beta Was this translation helpful? Give feedback.
-
Hello, Another attempt to get this going. Using macOS with Powershell installed. # Connect to MSSP
Request-SecretToken mykey
# Export
export-falconconfig -Select IoaGroup, PreventionPolicy
# Close Connection
Revoke-falcontoken
# Connect to CID under MSSP
Request-SecretToken mykey RANDOMSTRINGCIDCODE
# Try to import
Import-FalconConfig -Path ./FalconConfig_20241029T1754322527.zip -AssignExisting -ModifyExisting PreventionPolicy, IoaGroup -WhatIf
# Also tried with
Import-FalconConfig -Path ./FalconConfig_20241029T1816271048.zip -WhatIf Removing -WhatIf doesn't change anything, when tested in our lab CID Getting the following errors # Heaps of lines with:
551 | $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 the command again.
Import-FalconConfig: 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 the command again.
Invoke-FalconPreventionPolicyAction: /Users/$HOME/.local/share/powershell/Modules/PSFalcon/2.2.7/public/psf-config.ps1:551
# And:
Import-FalconConfig: 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 the command again. I'm at a loss for what to try next, any suggestions would be amazing. Thanks, |
Beta Was this translation helpful? Give feedback.
-
Hi BK, looking into why we're seeing there missing ID: seems there might be a cleanup job required. I'm not sure where to start though? The exports from our MSSP shows the following from [
{
"id": "XXXCORRECT-RANDOM-STRINGXXX",
"cid": "XXXCORRECT-RANDOM-STRINGXXX",
"name": "Phase 1 - Rapid Deployment of Windows Sensor",
"description": "Used for Rapid Deployment, can be used alongside PRE-EXISTING AV when on-boarding client.\nPolicy Created under MSSP - Primary",
"platform_name": "Windows",
"groups": [
{
"id": "",
"name": "",
"description": "",
"created_by": "",
"created_timestamp": null,
"modified_by": "",
"modified_timestamp": null
},
{
"id": "",
"name": "",
"description": "",
"created_by": "",
"created_timestamp": null,
"modified_by": "",
"modified_timestamp": null
},
{
"id": "",
"name": "",
"description": "",
"created_by": "",
"created_timestamp": null,
"modified_by": "",
"modified_timestamp": null
},
...
# dozens of them for all the prevention policy Checking an export from one of the child CID, does not have these same empty groups. The strange thing is if I export from a child CID, then attempt to upload back to same testing/NFR CID after deleting one of the customIOA from web UI. I get the same error again. Line |
551 | $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 the command again.
Import-FalconConfig: 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 the command again.
#and
Import-FalconConfig: 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 the command again.
PSFalcon Vers Version Name Repository Description
------- ---- ---------- -----------
2.2.7 PSFalcon PSGallery PowerShell for the CrowdStrike Falcon OAuth2 APIs Is what I'm trying to do intended use for export and import functions? Use the Web UI to create the desired configuration in MSSP, and then use export to grab what doesn't automatically filter down to child CID and import to desired CID. |
Beta Was this translation helpful? Give feedback.
-
I've attached the 2x transcripts. Hopefully sanitised... Importing-ExportFrom-NFR-PowerShell_transcript.Mac.rK1LVtKP.20241114194933.txt Importing-ExportFromMSSP_transcript.MB.BYxUgmYr.20241114200326.txt #Prevention Policy with issue in 'groups'
➜ Get-FalconPreventionPolicy -Detailed | where "name" -eq "Phase 3 - Well Protected"
id : 9a7b125ed1fababababababd1f6627cc6b
cid : d13e47abababababaabababab13cb343
name : Phase 3 - Well Protected
description : Maximum Security for Linux hosts.
Created 2024-05-10
platform_name : Linux
groups : {@{id=; name=; description=; created_by=; created_timestamp=; modified_by=; modified_timestamp=}, @{id=; name=; description=; created_by=; created_timestamp=; modified_by=; modified_timestamp=}, @{id=; name=; description=;
created_by=; created_timestamp=; modified_by=; modified_timestamp=}, @{id=; name=; description=; created_by=; created_timestamp=; modified_by=; modified_timestamp=}…}
enabled : True
created_by : my@email.com
created_timestamp : 2024-05-09T22:36:35.887838507Z
modified_by : my@email.com
modified_timestamp : 2024-05-09T22:41:55.516411433Z
prevention_settings : {@{name=User-Mode Capabilities; settings=System.Object[]}, @{name=Enhanced Visibility; settings=System.Object[]}, @{name=Cloud Machine Learning; settings=System.Object[]}, @{name=Sensor Machine Learning;
settings=System.Object[]}…}
ioa_rule_groups : {}
#Brand new Prevention Policy with no groups present as expected.
➜ Get-FalconPreventionPolicy -Detailed | where "name" -eq "NewTestPolicy"
id : dc8c128cdcdcdcdcdcdcdcdcd32a8133
cid : d13e47abababababaabababab13cb343
name : NewTestPolicy
description : Checking if this policy has Device groups with blank ID assigned
platform_name : Linux
groups : {}
enabled : True
created_by : my@email.com
created_timestamp : 2024-11-13T04:53:45.681879086Z
modified_by : my@email.com
modified_timestamp : 2024-11-13T04:55:10.278126548Z
prevention_settings : {@{name=User-Mode Capabilities; settings=System.Object[]}, @{name=Enhanced Visibility; settings=System.Object[]}, @{name=Cloud Machine Learning; settings=System.Object[]}, @{name=Sensor Machine Learning;
settings=System.Object[]}…}
ioa_rule_groups : {}
The empty groups in the exported .json look like this: {
"id": "9a7b12512121212121212121212627cc6b",
"cid": "d13e471212121212121212121212cb343",
"name": "Phase 3 - Well Protected",
"description": "Maximum Security for Linux hosts.\nCreated 2024-05-10",
"platform_name": "Linux",
"groups": [
{
"id": "",
"name": "",
"description": "",
"created_by": "",
"created_timestamp": null,
"modified_by": "",
"modified_timestamp": null
},
{
"id": "",
"name": "",
"description": "",
"created_by": "",
"created_timestamp": null,
"modified_by": "",
"modified_timestamp": null
},
{
"id": "",
"name": "",
"description": "",
"created_by": "",
"created_timestamp": null,
"modified_by": "",
"modified_timestamp": null
},
{
"id": "",
"name": "",
"description": "",
"created_by": "",
"created_timestamp": null,
"modified_by": "",
"modified_timestamp": null
},
{
"id": "",
"name": "",
"description": "",
"created_by": "",
"created_timestamp": null,
"modified_by": "",
"modified_timestamp": null
},
{
"id": "",
"name": "",
"description": "",
"created_by": "",
"created_timestamp": null,
"modified_by": "",
"modified_timestamp": null
}
],
"enabled": true,
"created_by": "my@email.com",
"created_timestamp": "2024-05-09T22:36:35.887838507Z",
"modified_by": "my@email.com",
"modified_timestamp": "2024-05-09T22:41:55.516411433Z",
"prevention_settings": [
{
"name": "User-Mode Capabilities",
"settings": [
{
"id": "UnknownDetectionRelatedExecutables",
"name": "Unknown Detection-Related Executables",
"type": "toggle",
"description": "Upload all unknown detection-related executables for advanced analysis in the cloud.",
"value": {
"enabled": true
}
},
These empty groups can't be seen in the web ui. Importing-ExportFrom-NFR-PowerShell_transcript.Mac.rK1LVtKP.20241114194933.txt Importing-ExportFromMSSP_transcript.MB.BYxUgmYr.20241114200326.txt |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
All good, Flight control is lacking some behaviours, where not all configurations made in our Primary MSSP CID filter down to our customer CID. I was hoping to be able to make the MSSP Parent CID our master config, with our recommended base config. When I imported only the CustomIOA, it added them, but didn't assign to the Prevention policy. We would still need to go in by hand and manually assign, or build a more complex script to then perform a secondary action to find all the customIOA, and assign to Prevention policy. Do we need to look at scrapping this method of export/import, and look at crafting the customIOA in json format, then use psfalcon to create them and assign to desired prevention policy inside each targeted CID? Or potentially create new versions of our 3 phased prevention policy in MSSP CID. make sure they don't have these mysterious empty groups assigned. then reattempt? Cheers, |
Beta Was this translation helpful? Give feedback.
-
Amazing, thanks BK. |
Beta Was this translation helpful? Give feedback.
-
How can we import IoaGroup from our MSSP CID 'master' into new CID which only has the Prevention Policies from "Your MSSP" pushed down to it.
Reading through the docs:
https://github.com/CrowdStrike/psfalcon/wiki/Import-FalconConfig
Have tried both:
AssignExisting and ModifyExisting parameters to try and import the Custom IoaGroup and have it applied to the same prevention plan name in the target as it is in source/master CID
But I can only get the IoaGroup to be added, not the Prevention policy assigned the same as in the 'master' CID.
Error received during the command suggesting there is an issue. I have no idea why though.
The Export and import is specifically IoaGroup.
Terminal output below:
Beta Was this translation helpful? Give feedback.
All reactions