Skip to content

Commit

Permalink
Adds EC2 metadata httpEndpoint field (#2016)
Browse files Browse the repository at this point in the history
* Adds EC2 metadata httpEndpoint field

Updates dictionary

Fixes plugins, and sets cnquey min version for httpEndpoint

Signed-off-by: Scott Ford <[email protected]>

* update proto version

---------

Signed-off-by: Scott Ford <[email protected]>
Co-authored-by: Dominik Richter <[email protected]>
  • Loading branch information
scottford-io and arlimus authored Oct 2, 2023
1 parent 59f7065 commit 610bdc8
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ gpu
gvnic
hostkeys
iap
iex
ilb
IMDS
ingresstls
iotedge
linux
Expand Down
2 changes: 2 additions & 0 deletions providers/aws/resources/aws.lr
Original file line number Diff line number Diff line change
Expand Up @@ -1640,6 +1640,8 @@ private aws.ec2.instance @defaults("arn state") {
vpc() aws.vpc
// A value of optional for http tokens denotes imdsv1 server compatibility; required is imdsv2
httpTokens string
// Status of the IMDS endpoint is enabled on the instance
httpEndpoint string
// Patch state information about the instance
patchState() dict
// State of the instance (pending, running, stopping, stopped, rebooting, or terminated)
Expand Down
12 changes: 12 additions & 0 deletions providers/aws/resources/aws.lr.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions providers/aws/resources/aws.lr.manifest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,8 @@ resources:
detailedMonitoring: {}
deviceMappings: {}
ebsOptimized: {}
httpEndpoint:
min_mondoo_version: 9.0.0
httpTokens: {}
image: {}
instanceId: {}
Expand Down
1 change: 1 addition & 0 deletions providers/aws/resources/aws_ec2.go
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,7 @@ func (a *mqlAwsEc2) gatherInstanceInfo(instances []ec2types.Reservation, imdsvVe
"publicIp": llx.StringData(convert.ToString(instance.PublicIpAddress)),
"detailedMonitoring": llx.StringData(string(instance.Monitoring.State)),
"httpTokens": llx.StringData(httpTokens),
"httpEndpoint": llx.StringData(string(instance.MetadataOptions.HttpEndpoint)),
"state": llx.StringData(string(instance.State.Name)),
"deviceMappings": llx.ArrayData(mqlDevices, types.Resource("aws.ec2.instance.device")),
"securityGroups": llx.ArrayData(sgs, types.Resource("aws.ec2.securitygroup")),
Expand Down

0 comments on commit 610bdc8

Please sign in to comment.