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

[ ENHANCEMENT ] Force lowercase for Cid parameter when using Add-FalconRole #401

Closed
cl6227 opened this issue Apr 29, 2024 · 2 comments
Closed
Assignees
Labels
enhancement New feature or request

Comments

@cl6227
Copy link

cl6227 commented Apr 29, 2024

Add-FalconRole command with -Cid parameter:
In a multi-Cid environment (Parent/Child) the -Cid provided is case sensitive and appears to require lowercase. Requesting an enhancement to silently auto-lowercase the value provided for the "-Cid" parameter.

In addition, and totally optional, to detect if a Cid checksum value was provided, and extract and use the Cid from it. The Cid checksum is available on the sensor downloads page, and easily copied from the CRWD UI, which is why one might get confused.

For instance, in the example below, the "c" characters are the Cid, and the additional "-xx" is the checksum; to be removed.
cccccccccccccccccccccccccccccccc-xx

Existing error when providing a wrong-case (uppercase) Cid:

> Add-FalconRole -Cid <cid here> -UserId <users id here> -Ids <roles(s) here>
Write-Result : {"code":404,"message":"customer with ID=\u0027<our Cid here>\u0027 not found"}
At C:\Users\<myusername>\Documents\WindowsPowerShell\Modules\PSFalcon\2.2.6\private\Private.ps1:663 char:9
+	Write-Result $Object
+	~~~~~~~~~~~~~~~~~~~~
	+ CategoryInfo	: InvalidResult: (@{errors=System.Object[]}:PSObject) [Write-Results], Exception
	+ FullyQualifiedErrorId : Write-Result
@bk-cs bk-cs changed the title Request to auto-lowercase Cid parameter for Add-FalconRole command - optionally parse Cid out of checksum. [ENHANCEMENT] Force lowercase for Cid parameter when using Add-FalconRole Apr 29, 2024
@bk-cs bk-cs self-assigned this Apr 29, 2024
@bk-cs bk-cs added the enhancement New feature or request label Apr 29, 2024
@bk-cs bk-cs changed the title [ENHANCEMENT] Force lowercase for Cid parameter when using Add-FalconRole [ ENHANCEMENT ] Force lowercase for Cid parameter when using Add-FalconRole Apr 30, 2024
bk-cs added a commit that referenced this issue May 22, 2024
Added `Confirm-CidValue` private function to check `Cid` input for checksum, remove it when present, and return the `Cid` value in lower case.
@bk-cs
Copy link
Collaborator

bk-cs commented May 22, 2024

I added a private function to validate Cid input and return only valid Cid values in lowercase. I've updated every command that accepts Cid as input to use this function and these changes will be included in the next PSFalcon release.

@bk-cs
Copy link
Collaborator

bk-cs commented Sep 4, 2024

This improvement is included in the 2.2.7 release.

@bk-cs bk-cs closed this as completed Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants