Skip to content

Commit

Permalink
feat: Add short-lived instance scanning option to agentless terraform
Browse files Browse the repository at this point in the history
  • Loading branch information
wl-smith committed Oct 27, 2023
1 parent dda9292 commit d731d8b
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ resource "lacework_integration_aws_agentless_scanning" "example" {
scan_host_vulnerabilities = true
scan_multi_volume = false
scan_stopped_instances = true
scan_short_lived_instances = false
account_id = var.account_id
bucket_arn = var.bucket_arn
credentials {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ resource "lacework_integration_aws_org_agentless_scanning" "example" {
scan_host_vulnerabilities = true
scan_multi_volume = false
scan_stopped_instances = true
scan_short_lived_instances = false
account_id = var.account_id
bucket_arn = var.bucket_arn
scanning_account = var.scanning_account
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ var awsAgentlessScanningIntegrationSchema = map[string]*schema.Schema{
Default: true,
Description: "Whether to scan stopped instances (true)",
},
"scan_short_lived_instances": {
Type: schema.TypeBool,
Optional: true,
Default: false,
Description: "Whether to scan short-lived (ephemeral) instances",
},
"account_id": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -146,6 +152,7 @@ func resourceLaceworkIntegrationAwsAgentlessScanningCreate(d *schema.ResourceDat
ScanHostVulnerabilities: d.Get("scan_host_vulnerabilities").(bool),
ScanMultiVolume: d.Get("scan_multi_volume").(bool),
ScanStoppedInstances: d.Get("scan_stopped_instances").(bool),
ScanShortLivedInstances: d.Get("scan_short_lived_instances").(bool),
AccountID: d.Get("account_id").(string),
BucketArn: d.Get("bucket_arn").(string),
CrossAccountCreds: api.AwsSidekickCrossAccountCredentials{
Expand Down Expand Up @@ -253,6 +260,7 @@ func resourceLaceworkIntegrationAwsAgentlessScanningUpdate(d *schema.ResourceDat
ScanHostVulnerabilities: d.Get("scan_host_vulnerabilities").(bool),
ScanMultiVolume: d.Get("scan_multi_volume").(bool),
ScanStoppedInstances: d.Get("scan_stopped_instances").(bool),
ScanShortLivedInstances: d.Get("scan_short_lived_instances").(bool),
AccountID: d.Get("account_id").(string),
BucketArn: d.Get("bucket_arn").(string),
CrossAccountCreds: api.AwsSidekickCrossAccountCredentials{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,12 @@ var awsOrgAgentlessScanningIntegrationSchema = map[string]*schema.Schema{
Default: true,
Description: "Whether to scan stopped instances (true)",
},
"scan_short_lived_instances": {
Type: schema.TypeBool,
Optional: true,
Default: false,
Description: "Whether to scan short-lived (ephemeral) instances",
},
"account_id": {
Type: schema.TypeString,
Optional: true,
Expand Down Expand Up @@ -202,6 +208,9 @@ func resourceLaceworkIntegrationAwsOrgAgentlessScanningCreate(d *schema.Resource
ScanFrequency: d.Get("scan_frequency").(int),
ScanContainers: d.Get("scan_containers").(bool),
ScanHostVulnerabilities: d.Get("scan_host_vulnerabilities").(bool),
ScanMultiVolume: d.Get("scan_multi_volume").(bool),
ScanStoppedInstances: d.Get("scan_stopped_instances").(bool),
ScanShortLivedInstances: d.Get("scan_short_lived_instances").(bool),
AccountID: d.Get("account_id").(string),
BucketArn: d.Get("bucket_arn").(string),
ScanningAccount: d.Get("scanning_account").(string),
Expand Down Expand Up @@ -342,6 +351,9 @@ func resourceLaceworkIntegrationAwsOrgAgentlessScanningUpdate(d *schema.Resource
ScanFrequency: d.Get("scan_frequency").(int),
ScanContainers: d.Get("scan_containers").(bool),
ScanHostVulnerabilities: d.Get("scan_host_vulnerabilities").(bool),
ScanMultiVolume: d.Get("scan_multi_volume").(bool),
ScanStoppedInstances: d.Get("scan_stopped_instances").(bool),
ScanShortLivedInstances: d.Get("scan_short_lived_instances").(bool),
AccountID: d.Get("account_id").(string),
BucketArn: d.Get("bucket_arn").(string),
ScanningAccount: d.Get("scanning_account").(string),
Expand Down

0 comments on commit d731d8b

Please sign in to comment.