Commit f0a31e3
feat(aws): add blast propagation from security groups to instances vi… (#3284)
## Summary
- Add blast radius propagation from Security Groups to EC2 instances via
Network Interfaces
- Enable `ec2-network-interface` adapter to search by security group ID
using AWS's `group-id` filter
- Fix issue where changing a Security Group would not show affected EC2
instances in blast radius
## Problem
When analyzing the blast radius of a Security Group change, Overmind
wasn't discovering the EC2 instances attached to that security group.
This was because:
1. The `ec2-security-group` adapter only linked **outward** to VPCs and
other security groups
2. The `ec2-instance` adapter linked **to** security groups with `In:
true, Out: false`
3. Since blast radius starts from the changing resource (SG) and follows
outward links, instances were never discovered
This meant users would see no risks when modifying security groups, even
when instances were actively using them.
## Solution
Added a forward link from Security Groups → Network Interfaces →
Instances:
```
SG change → ec2-network-interface (SEARCH by sg-id) → ec2-instance (existing link with Out: true)
```
Changes:
- `ec2-security-group`: Added `LinkedItemQuery` to search for ENIs using
this SG
- `ec2-network-interface`: Added `InputMapperSearch` that filters by
`group-id` when query starts with `sg-`
## Test plan
- [x] Unit tests pass for `TestNetworkInterfaceInputMapperSearch`
- [x] Unit tests pass for `TestSecurityGroupOutputMapper` with new ENI
link
- [ ] Manual test: Create SG with attached instances, run change
analysis, verify instances appear in blast radius
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> Enables blast radius from security groups to instances by linking SGs
to ENIs and adding ENI search by security group ID (and ARN).
>
> - **Adapters**
> - `ec2-network-interface`:
> - Add `InputMapperSearch` supporting `sg-*` via `group-id` filter and
parsing ARN `network-interface/eni-*`.
> - Wire `InputMapperSearch` into adapter; update metadata
`SearchDescription`.
> - `ec2-security-group`:
> - Add linked SEARCH to `ec2-network-interface` by SG ID with outward
blast propagation.
> - Update `PotentialLinks` to include `ec2-network-interface`.
> - **Tests**
> - Add `TestNetworkInterfaceInputMapperSearch` and extend
`TestSecurityGroupOutputMapper` for new ENI link.
>
> <sup>Written by [Cursor
Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit
436e0e83739023d73b97f54f16127d3febf09443. This will update automatically
on new commits. Configure
[here](https://cursor.com/dashboard?tab=bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
GitOrigin-RevId: c1f547771af266b06d2d84390444dd171217873b1 parent f277499 commit f0a31e3
File tree
4 files changed
+156
-4
lines changed- aws-source/adapters
4 files changed
+156
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
| 7 | + | |
6 | 8 | | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
| |||
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
24 | 66 | | |
25 | 67 | | |
26 | 68 | | |
| |||
252 | 294 | | |
253 | 295 | | |
254 | 296 | | |
255 | | - | |
256 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
257 | 300 | | |
258 | 301 | | |
259 | 302 | | |
| |||
270 | 313 | | |
271 | 314 | | |
272 | 315 | | |
273 | | - | |
| 316 | + | |
274 | 317 | | |
275 | 318 | | |
276 | 319 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
43 | 125 | | |
44 | 126 | | |
45 | 127 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
67 | 88 | | |
68 | 89 | | |
69 | 90 | | |
| |||
108 | 129 | | |
109 | 130 | | |
110 | 131 | | |
111 | | - | |
| 132 | + | |
112 | 133 | | |
113 | 134 | | |
114 | 135 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
104 | 110 | | |
105 | 111 | | |
106 | 112 | | |
| |||
0 commit comments