Skip to content

Conversation

@narenvivek
Copy link

@narenvivek narenvivek commented Dec 25, 2025

Problem

CrowdStrike connector crashes with KeyError: 'resources' when users lack the "indicator" API scope, preventing import of reports and actors.

Root Cause

API returns a 403 error response without a "resources" field, but code tried to access it directly without validation.

Solution

  • Added defensive check for response structure before accessing 'resources'
  • Handle 403 errors gracefully with warnings instead of crashing
  • Changed 403 logging from ERROR to WARNING level
  • Applied Black formatting

Testing

  • ✅ Actors imported successfully
  • ✅ Reports imported successfully
  • ✅ No KeyError crashes
  • ✅ Backward compatible

Impact

  • Fixes crash for users without "indicator" scope
  • No breaking changes
  • No configuration changes needed

Proposed changes

Related issues

Checklist

  • I consider the submitted work as finished
  • I have signed my commits using GPG key.
  • I tested the code for its functionality using different use cases
  • I added/update the relevant documentation (either on github or on notion)
  • Where necessary I refactored code to improve the overall quality

Further comments

…ike report importer

- Add defensive check for API response structure before accessing 'resources' field
- Log warning and continue report import when indicator scope is not permitted (403)
- Allows reports to import successfully even without indicator scope access
- Fixes KeyError crash when users lack indicator scope in API credentials

Co-Authored-By: Warp <agent@warp.dev>
narenvivek and others added 2 commits December 25, 2025 06:56
…API client

- Change 403 (permission denied) errors from ERROR to WARNING level
- Prevents misleading error logs when scope is not permitted
- 403 errors are now handled gracefully in the connector logic
- Other 4xx/5xx errors remain at ERROR level for visibility

Co-Authored-By: Warp <agent@warp.dev>
Co-Authored-By: Warp <agent@warp.dev>
@narenvivek
Copy link
Author

Closing this PR in favor of #5577, which follows the proper naming conventions ([connector_name] format) and has GPG-signed commits as required by the project guidelines.

@narenvivek narenvivek closed this Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant