Debian Codegraph @

ansible_collections/amazon/aws/extensions/audit/event_query.yml

raw
1 ---
2 # COMPUTE
3
4 amazon.aws.ec2_instance_info:
5 query: >-
6 .instances[] | select(. != null) | {
7 name: (.name // .tags.Name // "UNKNOWN"), # unique identifier for the resource
8 canonical_facts: {
9 id: .instance_id,
10 status: .state.name,
11 tags: (.tags // {}),
12 },
13 facts: {
14 infra_type: "PublicCloud",
15 infra_bucket: "Compute",
16 device_type: "EC2"
17 },
18 }
19
20 # NETWORKING
21
22 amazon.aws.elb_application_lb_info:
23 query: >-
24 .load_balancers[] | select(. != null) |
25 {
26 canonical_facts: {
27 name: .load_balancer_name,
28 status: .state.code,
29 tags: (.tags // {}),
30 },
31 facts: {
32 infra_type: "PublicCloud",
33 infra_bucket: "Networking",
34 device_type: "ApplicationLoadBalancer"
35 },
36 }
37
38 amazon.aws.elb_classic_lb_info:
39 query: >-
40 .elbs[] | select(. != null) |
41 {
42 canonical_facts: {
43 name: .load_balancer_name,
44 tags: (.tags // {}),
45 },
46 facts: {
47 infra_type: "PublicCloud",
48 infra_bucket: "Networking",
49 device_type: "ClassicLoadBalancer"
50 },
51 }
52
53 amazon.aws.ec2_vpc_net_info:
54 query: >-
55 .vpcs[] | select(. != null) | {
56 name: (.name // .tags.Name // "UNKNOWN"),
57 canonical_facts: {
58 id: .id,
59 status: .state,
60 tags: (.tags // {})
61 },
62 facts: {
63 infra_type: "PublicCloud",
64 infra_bucket: "Networking",
65 device_type: "VPC"
66 }
67 }
68
69 amazon.aws.ec2_vpc_subnet_info:
70 query: >-
71 .subnets[] | select(. != null) | {
72 canonical_facts: {
73 id: .id,
74 status: .state,
75 tags: (.tags // {})
76 },
77 facts: {
78 infra_type: "PublicCloud",
79 infra_bucket: "Networking",
80 device_type: "Subnet"
81 }
82 }
83
84 amazon.aws.ec2_vpc_nat_gateway_info:
85 query: >-
86 .result[] | select(. != null) |
87 {
88 canonical_facts: {
89 id: .nat_gateway_id,
90 status: .state,
91 tags: (.tags // {})
92 },
93 facts: {
94 infra_type: "PublicCloud",
95 infra_bucket: "Networking",
96 device_type: "NAT Gateway"
97 }
98 }
99
100 amazon.aws.ec2_vpc_igw_info:
101 query: >-
102 .internet_gateways[] | select(. != null) |
103 {
104 canonical_facts: {
105 id: .internet_gateway_id,
106 status: (.attachments | map({vpc_id: .vpc_id, status: .state})),
107 tags: (.tags // {})
108 },
109 facts: {
110 infra_type: "PublicCloud",
111 infra_bucket: "Networking",
112 device_type: "Internet Gateway"
113 }
114 }
115
116 amazon.aws.ec2_vpc_vgw_info:
117 query: >-
118 .virtual_gateways[] | select(. != null) |
119 {
120 canonical_facts: {
121 id: .vpn_gateway_id,
122 status: .state,
123 tags: (.resource_tags // {})
124 },
125 facts: {
126 infra_type: "PublicCloud",
127 infra_bucket: "Networking",
128 device_type: "Virtual Gateway"
129 }
130 }
131
132 amazon.aws.ec2_vpc_route_table_info:
133 query: >-
134 .route_tables[] | select(. != null) |
135 {
136 canonical_facts: {
137 id: .route_table_id,
138 tags: (.tags // {})
139 },
140 facts: {
141 infra_type: "PublicCloud",
142 infra_bucket: "Networking",
143 device_type: "Route table"
144 }
145 }
146
147 amazon.aws.ec2_vpc_vpn_info:
148 query: >-
149 .vpn_connections[] | select(. != null) |
150 {
151 canonical_facts: {
152 id: .vpn_connection_id,
153 status: .state,
154 tags: (.tags // {})
155 },
156 facts: {
157 infra_type: "PublicCloud",
158 infra_bucket: "Networking",
159 device_type: "VPN Connection"
160 }
161 }
162
163 amazon.aws.ec2_vpc_peering_info:
164 query: >-
165 .vpc_peering_connections[] | select(. != null) |
166 {
167 canonical_facts: {
168 id: .vpc_peering_connection_id,
169 status: .status.code,
170 tags: (.tags // {})
171 },
172 facts: {
173 infra_type: "PublicCloud",
174 infra_bucket: "Networking",
175 device_type: "VPC Peering"
176 }
177 }
178
179 # STORAGE
180
181 amazon.aws.s3_bucket_info:
182 query: >-
183 .buckets[] | select(. != null) |
184 {
185 canonical_facts: {
186 name: .name,
187 tags: (.bucket_tagging // {})
188 },
189 facts: {
190 infra_type: "PublicCloud",
191 infra_bucket: "Storage",
192 device_type: "Bucket"
193 }
194 }
195
196 amazon.aws.s3_object_info:
197 query: >-
198 .object_info[] | select(. != null) |
199 {
200 canonical_facts: {
201 name: .object_name,
202 tags: (.object_tagging // {})
203 },
204 facts: {
205 infra_type: "PublicCloud",
206 infra_bucket: "Storage",
207 device_type: "Object"
208 }
209 }
210
211 # DATABASE
212
213 amazon.aws.rds_instance_info:
214 query: >-
215 .instances[] | select(. != null) |
216 {
217 canonical_facts: {
218 id: .dbi_resource_id, # AWS Region-unique, immutable identifier for the DB instance.
219 name: .db_instance_identifier, # The user-supplied DB cluster identifier.
220 tags: (.tags // {}),
221 status: .db_instance_status
222
223 },
224 facts: {
225 infra_type: "PublicCloud",
226 infra_bucket: "Database",
227 device_type: "Instance"
228 }
229 }
230
231 amazon.aws.rds_cluster_info:
232 query: >-
233 .clusters[] | select(. != null) |
234 {
235 canonical_facts: {
236 id: .db_cluster_resource_id, # The AWS Region-unique, immutable identifier for the DB cluster.
237 name: .db_cluster_identifier, # The user-supplied DB cluster identifier.
238 tags: (.tags // {}),
239 status: .status
240
241 },
242 facts: {
243 infra_type: "PublicCloud",
244 infra_bucket: "Database",
245 device_type: "Cluster"
246 }
247 }