Skip to content

Commit 01a3582

Browse files
authored
Add 2 new AWS fields necessary for writing additional checks (#6673)
These are blocking 2 new checks in the AWS policy Signed-off-by: Tim Smith <tsmith84@gmail.com>
1 parent 53a8b12 commit 01a3582

File tree

5 files changed

+39
-1
lines changed

5 files changed

+39
-1
lines changed

providers/aws/resources/aws.lr

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1952,6 +1952,8 @@ private aws.ecs.cluster @defaults("name region status runningTasksCount pendingT
19521952
registeredContainerInstancesCount int
19531953
// Configuration for the cluster
19541954
configuration dict
1955+
// Cluster settings (e.g., Container Insights)
1956+
settings map[string]string
19551957
// Status of the cluster
19561958
status string
19571959
// List of AWS ECS task definitions
@@ -4094,6 +4096,8 @@ private aws.ec2.networkacl.entry @defaults("id egress ruleAction cidrBlock portR
40944096
ruleAction string
40954097
// Rule number
40964098
ruleNumber int
4099+
// Protocol number (-1 for all, 6 for TCP, 17 for UDP)
4100+
protocol string
40974101
// Port range for the ACL entry
40984102
portRange() aws.ec2.networkacl.entry.portrange
40994103
// CIDR block for the ACL entry

providers/aws/resources/aws.lr.go

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

providers/aws/resources/aws.lr.versions

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,7 @@ aws.ec2.networkacl.entry.portrange 9.0.0
598598
aws.ec2.networkacl.entry.portrange.from 9.0.0
599599
aws.ec2.networkacl.entry.portrange.id 9.0.0
600600
aws.ec2.networkacl.entry.portrange.to 9.0.0
601+
aws.ec2.networkacl.entry.protocol 11.12.3
601602
aws.ec2.networkacl.entry.ruleAction 9.0.0
602603
aws.ec2.networkacl.entry.ruleNumber 9.1.8
603604
aws.ec2.networkacl.id 9.0.0
@@ -723,6 +724,7 @@ aws.ecs.cluster.region 9.0.0
723724
aws.ecs.cluster.registeredContainerInstancesCount 9.0.0
724725
aws.ecs.cluster.runningTasksCount 9.0.0
725726
aws.ecs.cluster.services 11.5.114
727+
aws.ecs.cluster.settings 11.12.3
726728
aws.ecs.cluster.status 9.0.0
727729
aws.ecs.cluster.tags 9.0.0
728730
aws.ecs.cluster.tasks 9.0.0

providers/aws/resources/aws_ec2.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ func (a *mqlAwsEc2Networkacl) entries() ([]any, error) {
357357
"egress": llx.BoolData(egress),
358358
"ruleAction": llx.StringData(string(entry.RuleAction)),
359359
"ruleNumber": llx.IntDataDefault(entry.RuleNumber, 0),
360+
"protocol": llx.StringDataPtr(entry.Protocol),
360361
"cidrBlock": llx.StringDataPtr(entry.CidrBlock),
361362
"ipv6CidrBlock": llx.StringDataPtr(entry.Ipv6CidrBlock),
362363
"id": llx.StringData(entryId),

providers/aws/resources/aws_ecs.go

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ func initAwsEcsCluster(runtime *plugin.Runtime, args map[string]*llx.RawData) (m
177177

178178
svc := conn.Ecs(region)
179179
ctx := context.Background()
180-
clusterDetails, err := svc.DescribeClusters(ctx, &ecs.DescribeClustersInput{Clusters: []string{a}, Include: []ecstypes.ClusterField{ecstypes.ClusterFieldConfigurations, ecstypes.ClusterFieldTags}})
180+
clusterDetails, err := svc.DescribeClusters(ctx, &ecs.DescribeClustersInput{Clusters: []string{a}, Include: []ecstypes.ClusterField{ecstypes.ClusterFieldConfigurations, ecstypes.ClusterFieldSettings, ecstypes.ClusterFieldTags}})
181181
if err != nil {
182182
return nil, nil, err
183183
}
@@ -198,6 +198,13 @@ func initAwsEcsCluster(runtime *plugin.Runtime, args map[string]*llx.RawData) (m
198198
args["runningTasksCount"] = llx.IntData(int64(c.RunningTasksCount))
199199
args["status"] = llx.StringDataPtr(c.Status)
200200
args["tags"] = llx.MapData(ecsTagsToMap(c.Tags), types.String)
201+
settingsMap := make(map[string]any)
202+
for _, s := range c.Settings {
203+
if s.Value != nil {
204+
settingsMap[string(s.Name)] = *s.Value
205+
}
206+
}
207+
args["settings"] = llx.MapData(settingsMap, types.String)
201208
return args, nil, nil
202209
}
203210

0 commit comments

Comments
 (0)