Skip to content

Commit

Permalink
Add more fields to aws.autoscaling.group, aws.ssm.instance, and aws.e…
Browse files Browse the repository at this point in the history
…c2.networkacl.entry (#2601)

* Add more fields to aws.autoscaling.group

Also fix a bad type in the redshift resource

```json
aws.autoscaling.groups.first: {
  createdAt: 2022-10-20 21:58:49.852 -0700 PDT
  healthCheckGracePeriod: 0
  launchConfigurationName: null
  maxSize: 50
  minSize: 0
  arn: "arn:aws:autoscaling:ap-south-1:123456789:autoScalingGroup:abcdef12345:autoScalingGroupName/mondoo-scanning-asg"
  loadBalancerNames: []
  tags: {
    Created By: "Mondoo"
    Mondoo Docs: "https://mondoo.com/docs/cloud/aws/overview"
    Mondoo Integration Mrn: "//integration.api.mondoo.app/spaces/..."
    Mondoo Support: "[email protected]"
    Name: "ebs-scanner"
    mondoo_scanner_type: "ASG"
  }
  name: "mondoo-scanning-asg"
  healthCheckType: "EC2"
  region: "ap-south-1"
  defaultCooldown: 300
}
```

Signed-off-by: Tim Smith <[email protected]>

* Expand SSM data and improve default fields

Signed-off-by: Tim Smith <[email protected]>

* Expand ACL entry data

Signed-off-by: Tim Smith <[email protected]>

---------

Signed-off-by: Tim Smith <[email protected]>
  • Loading branch information
tas50 authored Nov 20, 2023
1 parent a70844c commit cb0adc0
Show file tree
Hide file tree
Showing 7 changed files with 192 additions and 24 deletions.
2 changes: 1 addition & 1 deletion .github/actions/spelling/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ cavium
cdn
certificatechains
cmek
Cooldown
cryptokey
customresources
datapath
Ddos
DIRECTORYID
dfw
DIRECTORYID
dlq
Expand Down
32 changes: 26 additions & 6 deletions providers/aws/resources/aws.lr
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,18 @@ private aws.autoscaling.group @defaults("name region") {
tags map[string]string
// The region of the Auto Scaling group
region string
// The minimum number of instances to scale down to
minSize int
// The maximum number of instances to scale up to
maxSize int
// The time to wait after scaling up / down before the next scaling event is started
defaultCooldown int
// The name of the launch configuration
launchConfigurationName string
// The grace period in seconds before an instance with a failing health check will be replaced
healthCheckGracePeriod int
// Time when the autoscaling group was created
createdAt time
}

// AWS Elastic Load Balancing
Expand Down Expand Up @@ -1436,7 +1448,7 @@ private aws.redshift.cluster @defaults("dbName clusterVersion clusterStatus regi
// Version of the Redshift engine running on the cluster
clusterVersion string
// Cluster creation timestamp
createdAt string
createdAt time
// Name of the initial database that was created when the cluster was created
dbName string
// Whether the cluster is encrypted at rest
Expand Down Expand Up @@ -1596,12 +1608,12 @@ private aws.lambda.function @defaults("arn") {
}

// Amazon Systems Manager
aws.ssm {
aws.ssm @defaults("instances") {
instances() []aws.ssm.instance
}

// Amazon SSM instance
private aws.ssm.instance {
private aws.ssm.instance @defaults("instanceId region platformName platformVersion ipAddress") {
// Instance ID for the SSM Instance
instanceId string
// Ping status (e.g., online) for the SSM Instance
Expand All @@ -1610,6 +1622,10 @@ private aws.ssm.instance {
ipAddress string
// Platform name for the SSM Instance, as described by AWS
platformName string
// The type of for the SSM Instance, as described by AWS (Windows, Linux, etc)
platformType string
// Platform version for the SSM Instance, as described by AWS
platformVersion string
// Region where the SSM instance is located
region string
// ARN for the SSM instance
Expand Down Expand Up @@ -1641,7 +1657,7 @@ aws.ec2 {
}

// Amazon EC2 network ACL
private aws.ec2.networkacl @defaults("arn") {
private aws.ec2.networkacl @defaults("id region") {
// ARN for the network ACL
arn string
// ID for the network ACL
Expand All @@ -1653,19 +1669,23 @@ private aws.ec2.networkacl @defaults("arn") {
}

// Amazon EC2 network ACL entry
private aws.ec2.networkacl.entry {
private aws.ec2.networkacl.entry @defaults("id egress ruleAction cidrBlock portRange") {
// Whether this is an entry for egress rules
egress bool
// Allow or deny
ruleAction string
// The rule number
ruleNumber int
// Port range for the ACL entry
portRange() aws.ec2.networkacl.entry.portrange
// CIDR block for the ACL entry
cidrBlock string
// ID for the ACL entry rule
id string
}

// Amazon EC2 network ACL entry port range
private aws.ec2.networkacl.entry.portrange {
private aws.ec2.networkacl.entry.portrange @defaults("from to") {
// Starting port for port range
from int
// Ending port for port range
Expand Down
128 changes: 124 additions & 4 deletions providers/aws/resources/aws.lr.go

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

Loading

0 comments on commit cb0adc0

Please sign in to comment.