Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add short-lived instance scanning option to agentless terraform #568

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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