[Asset Inventory][AWS] Update EC2, ELB and RDS fetchers for InfoSec - #7277
Merged
kubasobon merged 3 commits intoJul 30, 2026
Merged
Conversation
jeniawhite
reviewed
Jul 21, 2026
|
|
||
| // newMockHostResolver creates a new instance of mockHostResolver. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. | ||
| // The first argument is typically a *testing.T value. | ||
| func newMockHostResolver(t interface { |
Collaborator
There was a problem hiding this comment.
I think that these are not being utilized. Is there a reason to implement them?
newMockHostResolver, mockHostResolver, mockHostResolver_Expecter, mockHostResolver_LookupHost_Call
| "PubliclyAccessible": false, // scheme is "internal" | ||
| "AccountID": "123", | ||
| "LoadBalancerType": "classic", | ||
| "State": "active", |
Collaborator
There was a problem hiding this comment.
Does it makes sense to add IPAddresses as well? Because we don't run the DNS resolver (like we do in the actual code to resolve the IPs).
Reference:
https://github.com/elastic/cloudbeat/pull/7277/changes#diff-45e6ce26ce27502d2d082db4502e0999a52d546b187833699c645fbfa297c146R88-R96
Member
Author
|
@jeniawhite Thank you, both good catches. I've pushed an update. |
kubasobon
force-pushed
the
infosec/update-awsfetcher
branch
from
July 23, 2026 16:26
3457d5f to
68c9bab
Compare
kubasobon
changed the base branch from
main
to
asset-inventory/fix-entity-attributes
July 23, 2026 16:46
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
kubasobon
force-pushed
the
infosec/update-awsfetcher
branch
from
July 23, 2026 16:56
68c9bab to
c765c38
Compare
kubasobon
merged commit Jul 30, 2026
3bc1c9d
into
asset-inventory/fix-entity-attributes
4 checks passed
Merged
1 task
kubasobon
added a commit
that referenced
this pull request
Aug 3, 2026
…fetchers for InfoSec (#7482) ### Summary of your changes > [!NOTE] > **Stacked on #7473.** This PR is based on `asset-inventory/fix-entity-attributes`, which renames the `entity.attributes` (flattened) bag to `entity.Details` to fix the Entity Store generic-extraction bug. All new fields below are therefore emitted under **`entity.Details.*`** (not `entity.attributes.*`). Please review/merge #7473 first; this PR's diff shows only the InfoSec fetcher changes on top of it. | Resource | Field | Change | | -------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | | **EC2** | `entity.Details.Role` | Added `LookupTag(tags, "role")` in `buildDetails` | | **RDS** | `entity.Details.DBInstanceStatus` | Added `Status` field to wrapper struct; mapped from `DBInstanceStatus` in provider; emitted in fetcher | | **ELB v2** (ALB/NLB) | `entity.Details.IPAddresses` | `GetIPAddresses()` now also collects `PrivateIPv4Address` and `IPv6Address` per AZ address (previously only `IpAddress`) | | **ELB v1** (Classic) | `entity.Details.State` | `GetState()` returns `"active"` (hardcoded as classic API exposes no state field) | | **ELB v1** (Classic) | `entity.Details.IPAddresses` | DNS-resolves the ELB `DNSName` at fetch time via injectable `hostResolver`; soft-fails to empty on error | ### Related Issues Closes https://github.com/elastic/security-team/issues/18294 ### Checklist - [x] I have added tests that prove my fix is effective or that my feature works <hr>This is an automatic backport of pull request #7277 done by [Mergify](https://mergify.com). Co-authored-by: Kuba Soboń <wtty.fool@gmail.com>
This was referenced Sep 1, 2026
kubasobon
added a commit
that referenced
this pull request
Sep 8, 2026
…7277) ### Summary of your changes > [!NOTE] > **Stacked on #7473.** This PR is based on `asset-inventory/fix-entity-attributes`, which renames the `entity.attributes` (flattened) bag to `entity.Details` to fix the Entity Store generic-extraction bug. All new fields below are therefore emitted under **`entity.Details.*`** (not `entity.attributes.*`). Please review/merge #7473 first; this PR's diff shows only the InfoSec fetcher changes on top of it. | Resource | Field | Change | | -------------------- | --------------------------------- | ------------------------------------------------------------------------------------------------------------------------ | | **EC2** | `entity.Details.Role` | Added `LookupTag(tags, "role")` in `buildDetails` | | **RDS** | `entity.Details.DBInstanceStatus` | Added `Status` field to wrapper struct; mapped from `DBInstanceStatus` in provider; emitted in fetcher | | **ELB v2** (ALB/NLB) | `entity.Details.IPAddresses` | `GetIPAddresses()` now also collects `PrivateIPv4Address` and `IPv6Address` per AZ address (previously only `IpAddress`) | | **ELB v1** (Classic) | `entity.Details.State` | `GetState()` returns `"active"` (hardcoded as classic API exposes no state field) | | **ELB v1** (Classic) | `entity.Details.IPAddresses` | DNS-resolves the ELB `DNSName` at fetch time via injectable `hostResolver`; soft-fails to empty on error | ### Related Issues Closes elastic/security-team#18294 ### Checklist - [x] I have added tests that prove my fix is effective or that my feature works
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.
Summary of your changes
Note
Stacked on #7473. This PR is based on
asset-inventory/fix-entity-attributes, which renames theentity.attributes(flattened) bag toentity.Detailsto fix the Entity Store generic-extraction bug. All new fields below are therefore emitted underentity.Details.*(notentity.attributes.*). Please review/merge #7473 first; this PR's diff shows only the InfoSec fetcher changes on top of it.entity.Details.RoleLookupTag(tags, "role")inbuildDetailsentity.Details.DBInstanceStatusStatusfield to wrapper struct; mapped fromDBInstanceStatusin provider; emitted in fetcherentity.Details.IPAddressesGetIPAddresses()now also collectsPrivateIPv4AddressandIPv6Addressper AZ address (previously onlyIpAddress)entity.Details.StateGetState()returns"active"(hardcoded as classic API exposes no state field)entity.Details.IPAddressesDNSNameat fetch time via injectablehostResolver; soft-fails to empty on errorRelated Issues
Closes https://github.com/elastic/security-team/issues/18294
Checklist