Skip to content

Conversation

@navnit-elastic
Copy link
Contributor

@navnit-elastic navnit-elastic commented Nov 18, 2025

Proposed commit message

crowdstrike: provide alternate endpoint to query host data for GovCloud CIDs

This change adds a toggle in the host data stream manifest
to switch between two different device endpoints to query host data.

The "/devices/combined/devices/v1" endpoint is not supported in GovCloud CIDs,
which was introduced in this PR[1]. This impacted GovCloud users to encounter errors
when enabling the host data stream.

This change provides an option for GovCloud users to query an alternate endpoint,
"/devices/entities/devices/v2".

If the GovCloud flag is disabled, the CEL program inspects the base URL to infer
whether the integration is pointed at a GovCloud environment. If the
URL matches a known GovCloud domain, the integration avoids calling the unsupported
combined endpoint and instead uses "/devices/entities/devices/v2".

[1] https://github.com/elastic/integrations/pull/15419

Checklist

  • I have reviewed tips for building integrations and this pull request is aligned with them.
  • I have verified that all data streams collect metrics or logs.
  • I have added an entry to my package's changelog.yml file.
  • I have verified that Kibana version constraints are current according to guidelines.
  • I have verified that any added dashboard complies with Kibana's Dashboard good practices

Author's Checklist

  • [ ]

How to test this PR locally

System Tests:

--- Test results for package: crowdstrike - START ---
╭─────────────┬─────────────┬───────────┬─────────────┬────────┬───────────────╮
│ PACKAGE     │ DATA STREAM │ TEST TYPE │ TEST NAME   │ RESULT │  TIME ELAPSED │
├─────────────┼─────────────┼───────────┼─────────────┼────────┼───────────────┤
│ crowdstrike │ host        │ system    │ common      │ PASS   │ 44.078286575s │
│ crowdstrike │ host        │ system    │ govcloud    │ PASS   │ 44.100005811s │
│ crowdstrike │ host        │ system    │ govcloudurl │ PASS   │ 44.272329058s │
╰─────────────┴─────────────┴───────────┴─────────────┴────────┴───────────────╯
--- Test results for package: crowdstrike - END   ---
Done

Related issues

Screenshots

screencapture-localhost-5602-app-fleet-integrations-crowdstrike-2-8-1-add-integration-2025-11-19-15_49_47

@navnit-elastic navnit-elastic added documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. Integration:crowdstrike CrowdStrike bugfix Pull request that fixes a bug issue Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] Team:Sit-Crest Crest developers on the Security Integrations team [elastic/sit-crest-contractors] labels Nov 18, 2025
@navnit-elastic navnit-elastic self-assigned this Nov 18, 2025
@elastic-vault-github-plugin-prod
Copy link

elastic-vault-github-plugin-prod bot commented Nov 18, 2025

🚀 Benchmarks report

To see the full report comment with /test benchmark fullreport

@navnit-elastic navnit-elastic marked this pull request as ready for review November 19, 2025 08:06
@navnit-elastic navnit-elastic requested a review from a team as a code owner November 19, 2025 08:07
@elasticmachine
Copy link

Pinging @elastic/security-service-integrations (Team:Security-Service Integrations)

Copy link
Contributor

@kcreddy kcreddy left a comment

Choose a reason for hiding this comment

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

@navnit-elastic, can you add screenshot how the new option would show to the users?
cc: @narph

@navnit-elastic
Copy link
Contributor Author

@navnit-elastic, can you add screenshot how the new option would show to the users? cc: @narph

@kcreddy - added it in the commit message.

@elasticmachine
Copy link

💚 Build Succeeded

History

cc @navnit-elastic

Comment on lines +2 to +5
- version: "2.8.1"
changes:
- description: Provide an alternate endpoint to query host data for GovCloud CIDs.
type: bugfix
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is an enhancement. This is an additional feature, not a fix for an incorrect behaviour.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

(size(body.?errors.orValue([])) > 0) ?
{
"events": body.errors.map(error,
// This logic determines which CrowdStrike devices endpoint to call. The
Copy link
Contributor

Choose a reason for hiding this comment

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

If we can automagically determine the correct behaviour from the URL, why are we adding a configuration toggle? Is it the case that the known URLs are not an exhaustive enumeration of all GovCloud base URLs?

Copy link
Contributor

@ShourieG ShourieG Nov 20, 2025

Choose a reason for hiding this comment

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

I personally feel we should not even try to switch the request flow based on url parsing as it obfuscates the control flow and undermines the entire presence of the toggle

Copy link
Contributor

Choose a reason for hiding this comment

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

Agree. We should do one or the other. If we can always determine the correct behaviour from the URL, we should do that, if it is less than always, we should not even try and just use a configuration.

Copy link
Contributor

Choose a reason for hiding this comment

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

The approach was discussed in #15795 and since there was no alternate proposals, this was taken up. I can see that the URL check will give us correct behaviour all the time until a new GovCloud URL is launched by Crowdstrike, in such case a toggle can help quicken the SDH resolution.
I do agree that having both might be confusing and reduces each other's efficacy.

Copy link
Contributor

@ShourieG ShourieG Nov 21, 2025

Choose a reason for hiding this comment

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

If there's a chance that new GovCloud URLs can be launched in future, I feel it's best to just stick to a toggle based approach for clarity purposes. When a failure occurs (if the toggle in not configured), it would be a clear signal to indicate the real issue in every case. Also it's easier for support to resolve without creating a SDH if the behaviour is singular and known in advance. A dual mechanism, though efficient and less intrusive can obfuscate the behaviour and lead to confusion in some scenarios down the line.

Comment on lines +51 to +52
// This dual-check mechanism ensures that GovCloud users do not encounter errors
// even if they forget to enable the "gov_cloud" flag in the manifest.
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not convinced of the value of this convenience.

Copy link
Contributor

Choose a reason for hiding this comment

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

+1

// This dual-check mechanism ensures that GovCloud users do not encounter errors
// even if they forget to enable the "gov_cloud" flag in the manifest.
(
state.gov_cloud || state.url.trim_right("/") in ["https://api.laggar.gcw.crowdstrike.com", "https://api.us-gov-2.crowdstrike.mil"] ?
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a comment saying that this is the GovCloud branch.

(this is a long program, so some navigation aids will be helpful)

)
)
:
state.with(
Copy link
Contributor

Choose a reason for hiding this comment

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

Add comment that this is the non-GovCloud branch.

"error": {
"code": string(get_resp.StatusCode),
"id": string(get_resp.Status),
"message": "GET:" + (
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"message": "GET:" + (
"message": "GET: " + (

"error": {
"code": string(post_resp.StatusCode),
"id": string(post_resp.Status),
"message": "POST:" + (
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"message": "POST:" + (
"message": "POST: " + (

type: bool
title: GovCloud
description: >-
GovCloud CIDs should enable this. When enabled, the integration will automatically use CrowdStrike’s GovCloud-supported devices endpoint (`/devices/entities/devices/v2`) instead of the standard combined endpoint (`/devices/combined/devices/v1`).
Copy link
Contributor

@ShourieG ShourieG Nov 20, 2025

Choose a reason for hiding this comment

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

Suggested change
GovCloud CIDs should enable this. When enabled, the integration will automatically use CrowdStrike’s GovCloud-supported devices endpoint (`/devices/entities/devices/v2`) instead of the standard combined endpoint (`/devices/combined/devices/v1`).
GovCloud CIDs should enable this. When enabled, the integration will use CrowdStrike’s GovCloud-supported devices endpoint (`/devices/entities/devices/v2`) instead of the standard combined endpoint (`/devices/combined/devices/v1`).

If we are enabling the toggle, then it's no longer automatic. As for the dual safety mechanism, it undermines the presence of the toggle.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Pull request that fixes a bug issue documentation Improvements or additions to documentation. Applied to PRs that modify *.md files. Integration:crowdstrike CrowdStrike Team:Security-Service Integrations Security Service Integrations team [elastic/security-service-integrations] Team:Sit-Crest Crest developers on the Security Integrations team [elastic/sit-crest-contractors]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Crowdstrike] - "combined/devices" API endpoint is only available in Crowdstrike Commercial Cloud CID's

5 participants