prisma_cloud.misconfiguration: Fix token expiry during pagination#17660
Merged
kcreddy merged 2 commits intoelastic:mainfrom Mar 5, 2026
Merged
prisma_cloud.misconfiguration: Fix token expiry during pagination#17660kcreddy merged 2 commits intoelastic:mainfrom
kcreddy merged 2 commits intoelastic:mainfrom
Conversation
Prisma Cloud JWT tokens expire after 10 minutes. The misconfiguration dataset's CEL program previously skipped authentication during pagination (want_more == true), reusing the initial token for all subsequent page requests. When data collection took longer than 10 minutes, the token expired and API calls failed with 401. Remove the skip-auth conditional so every invocation calls /login before fetching data. Use state.with() to merge only changing properties into state instead of rebuilding the full state object in every branch, which removes the repetition of constant fields (url, user, password, batch_size). Preserve pageToken through the auth step so pagination continues from the correct page. Clear next in both error paths to prevent stale pageTokens from persisting into the next collection cycle. Fixes elastic#17028
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
Contributor
Author
|
/test |
🚀 Benchmarks reportTo see the full report comment with |
💚 Build Succeeded
cc @kcreddy |
efd6
approved these changes
Mar 5, 2026
Contributor
efd6
left a comment
There was a problem hiding this comment.
I think we need to keep an eye on this for the impact on effort since we're getting a token for each request. If this is a problem, we can revisit and keep the token until before the TTL expires.
Also, the incident_audit has a similar pattern, but it has a TTL of 30m, so it's less likely to be a concern.
|
Package prisma_cloud - 4.0.2 containing this change is available at https://epr.elastic.co/package/prisma_cloud/4.0.2/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Proposed commit message
Checklist
changelog.ymlfile.How to test this PR locally
System tests pass successfully.
Related issues