Improvement: Keep Track of S3 Processing
- Dominant language
- Python
- Stars
- 2.9k
- Forks
- 324
- PR merge metrics
- No merged PRs in 30d
Description
## Background
When StreamAlert processes files from S3, there's a chance that the amount of parsed records could be very high (over 10k). In this case, the rule processor has the potential to Timeout during processing. Commonly, this is due to Firehose backing off too much while sending record batches, resulting in an Invocation Failure. Lambda then retries this same request, and sends the same batch of records back out repeatedly.
### Steps to Reproduce
Configure the `rule_processor` to accept `s3_events` as input with very large files, and also have Firehose enabled.
## Desired Change
The goal is to not process duplicate records from S3. This could be accomplished with something like this:
* Create a DDB table, with the S3 object name as the primary key
* Track how many alerts were sent, and if alert processing completed
* Track how many records were sent to Firehose
* When processing repetitive S3 objects, load state and resume where it left off
Contributor guide
Research direction
Start by tracing the rule_processor path for s3_events and the Firehose delivery flow. Review how repeated S3 objects and Lambda retries are currently handled; done means duplicate records are avoided and processing can resume with the requested alert and Firehose counts preserved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- backend, cloud, data-engineering
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100