You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add redacted FALCON_DEBUG mode for bash and PowerShell (#522)
Support currently has to reach for `bash -x` or `Set-PSDebug -Trace` to
diagnose a failing install, and both print credentials. This adds an opt-in
debug mode that answers the questions support actually asks, without ever
printing a value that is not known to be safe.
bash gets `FALCON_DEBUG=1` or `--debug`; PowerShell gets `-FalconDebug` or
`$env:FALCON_DEBUG`. Markers cover the detected OS, architecture, kernel and
package manager; the exact FQL sensor query filter and how many installers
matched; which installer was selected, its size and SHA-256 check; the API
route, HTTP status and curl exit code for every call; the resolved sensor
update policy version; and the installed sensor version and AID.
The filter is the point of the whole feature. "No sensor found for OS" and
"why did it pick that version" are unanswerable without seeing the query that
was sent, and it is assembled from four separately derived pieces.
Redaction is fail-closed. Only keys on a fixed allow-list keep their value;
everything else becomes `[DROPPED]`, and a bare token with no key is dropped
entirely. Anything user-supplied that could hold a secret is reported as
presence only, under a distinct `_set` key — `provisioning_token` is not
allow-listed, so a future line that prints it still drops. Customer data is
reported as counts, not contents.
In PowerShell, values that can contain a space are passed through `-Pairs`
rather than a joined string. An FQL filter can hold a multi-word policy name,
and any scheme that splits a joined string would either mangle it or, worse,
glue a bare word onto an allow-listed value and print it.
Debug adds no request of its own. `curl_command` already dumps headers and
buffers the body, so the marker reports the status and exit code it has
computed; the curl invocation is untouched. The exit code is reported inside
`handle_curl_error`, which receives it on every failure path, so no call site
captures `$?` and none of the `||` chains change.
Neither language re-enables tracing. The `set +x` guard and `Set-PSDebug
-Off` both stay, and no curl or Invoke-WebRequest gains a verbose flag. The
PowerShell catch blocks now record a status code instead of serializing the
whole exception object into the on-disk log.
READMEs document the new mode with sample output from real runs, and stop
recommending `bash -x` and `Set-PSDebug -Trace` for support.
Co-authored-by: Carlos Matos <carlos.matos@crowdstrike.com>
|`--get-cid`| N/A |`None`| Get the CID assigned to the API Credentials. |
167
172
|`--list-tags`|`$LISTTAGS`|`False` (Optional) | List all tags available for the selected sensor |
168
173
|`--allow-legacy-curl`|`$ALLOW_LEGACY_CURL`|`False` (Optional) | Deprecated. Accepted and ignored; no longer needed |
174
+
|`--debug`|`$FALCON_DEBUG`|`unset` (Optional) | Print redacted progress markers to stderr. Step, HTTP status, cloud/region and curl exit only; values are dropped unless the key is allow-listed, so secrets cannot appear. Do not use `bash -x` for support. |
169
175
|`-h`, `--help`| N/A |`None`| Display help message |
170
176
171
177
---
@@ -438,3 +444,30 @@ The following example will pull the `falcon-sensor` image for the `x86_64` platf
438
444
--type falcon-sensor \
439
445
--platform x86_64
440
446
```
447
+
448
+
---
449
+
450
+
## Troubleshooting
451
+
452
+
Use the redacted debug mode. It prints, to stderr: the detected OS, architecture,
453
+
kernel and package manager; the exact sensor query filter and how many installers
454
+
matched; which installer was selected, its size and SHA-256 check; the API route,
455
+
HTTP status and curl exit code for every call; and the installed sensor version
456
+
and AID. Values are dropped unless the key is on a fixed allow-list, so
457
+
credentials cannot appear in the output you send to support.
458
+
459
+
```shell
460
+
./falcon-container-sensor-pull.sh \
461
+
--client-id <FALCON_CLIENT_ID> \
462
+
--client-secret <FALCON_CLIENT_SECRET> \
463
+
--type falcon-sensor \
464
+
--debug
465
+
```
466
+
467
+
`FALCON_DEBUG=1` does the same thing, which is useful when the script runs from a
468
+
pipe or a job where you cannot add a flag.
469
+
470
+
Do **not** use `bash -x` for support. It prints every expanded command, including
471
+
`client_secret`, access tokens, the registry password and `Authorization`
472
+
headers. This script turns tracing off at startup and warns when it does, but a
473
+
trace enabled before that point can still expose credentials.
0 commit comments