-
Notifications
You must be signed in to change notification settings - Fork 518
aws.securityhub_findings*: Fix null reference when extracting host.ip #14264
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Pinging @elastic/security-service-integrations (Team:Security-Service Integrations) |
🚀 Benchmarks reportTo see the full report comment with |
| "IamInstanceProfileArn": "arn:aws:iam::1111111111:instance-profile/eks-00c3ac5a-8d2a-1a50-9bd3-6c1939f83db6", | ||
| "ImageId": "ami-0e0ff40957f238bdd", | ||
| "IpV4Addresses": [ | ||
| "67.43.156.245", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we change those IPs to be within the range reserved for documentation by RFC 5737.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done in 397c0ac
| if (res.Type == 'AwsEcsContainer' && res.Details.AwsEcsContainer?.Name != null) { | ||
| ctx.host.name = res.Details.AwsEcsContainer.Name; | ||
| } | ||
| if (res.Type == 'AwsEc2Instance' && (res.Details.AwsEc2Instance?.IpV4Addresses != null || res.Details.AwsEc2Instance?.IpV6Addresses != null)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this && (res.Details.AwsEc2Instance?.IpV4Addresses != null || res.Details.AwsEc2Instance?.IpV6Addresses != null) is now redundant and could be removed.
Same comment for L1832 and for the full_posture pipeline.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated as per suggestion in 397c0ac
|
💚 Build Succeeded
History
cc @kcreddy |
andrewkroh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
|
Package aws - 3.8.2 containing this change is available at https://epr.elastic.co/package/aws/3.8.2/ |
…elastic#14264) There is no null check on resources[].Details.AwsEc2Instance.IpV4Addresses or resources[].Details.AwsEc2Instance.IpV6Addresses when extracting host.ip leading to pipeline_error. This PR adds the required null check to prevent pipeline_error.




Proposed commit message
Checklist
changelog.ymlfile.How to test this PR locally
Added new pipeline test samples to simulate the behaviour.
Before:
After: