Skip to content

Commit

Permalink
feat: Require org_id for gcp agentless integration
Browse files Browse the repository at this point in the history
Signed-off-by: Lei Jin <lei.jin@lacework.net>
  • Loading branch information
leijin-lw committed Jul 17, 2024
1 parent e18c4b9 commit 4925411
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
5 changes: 3 additions & 2 deletions cli/cdk/go/proto/v1/cdk.pb.go

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

1 change: 1 addition & 0 deletions cli/cdk/go/proto/v1/cdk_grpc.pb.go

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

5 changes: 3 additions & 2 deletions cli/cmd/generate_gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ func initGenerateGcpTfCommandFlags() {
&GenerateGcpCommandState.GcpOrganizationId,
"organization_id",
"",
"specify the organization id (only set if organization_integration is set)")
"specify the organization id (only set if agentless integration or organization_integration is set)")
generateGcpTfCommand.PersistentFlags().StringVar(
&GenerateGcpCommandState.GcpProjectId,
"project_id",
Expand Down Expand Up @@ -716,6 +716,7 @@ func promptGcpGenerate(
}

configOrAuditLogEnabled := config.Configuration || config.AuditLog
organizationIdRequired := config.OrganizationIntegration || config.Agentless
regionsInput := ""

if err := SurveyMultipleQuestionWithValidation(
Expand All @@ -738,7 +739,7 @@ func promptGcpGenerate(
},
{
Prompt: &survey.Input{Message: QuestionGcpOrganizationID, Default: config.GcpOrganizationId},
Checks: []*bool{&config.OrganizationIntegration},
Checks: []*bool{&organizationIdRequired},
Required: true,
Response: &config.GcpOrganizationId,
},
Expand Down
2 changes: 1 addition & 1 deletion cli/docs/lacework_generate_cloud-account_gcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ lacework generate cloud-account gcp [flags]
-h, --help help for gcp
--include_root_projects Disables logic that includes root-level projects if excluding folders (default true)
--k8s_filter filter out GKE logs from GCP Audit Log sinks (default true)
--organization_id string specify the organization id (only set if organization_integration is set)
--organization_id string specify the organization id (only set if agentless integration or organization_integration is set)
--organization_integration enable organization integration
--output string location to write generated content (default is ~/lacework/gcp)
--prefix string prefix that will be used at the beginning of every generated resource
Expand Down
2 changes: 1 addition & 1 deletion integration/test_resources/help/generate_cloud-account_gcp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Flags:
-h, --help help for gcp
--include_root_projects Disables logic that includes root-level projects if excluding folders (default true)
--k8s_filter filter out GKE logs from GCP Audit Log sinks (default true)
--organization_id string specify the organization id (only set if organization_integration is set)
--organization_id string specify the organization id (only set if agentless integration or organization_integration is set)
--organization_integration enable organization integration
--output string location to write generated content (default is ~/lacework/gcp)
--prefix string prefix that will be used at the beginning of every generated resource
Expand Down

0 comments on commit 4925411

Please sign in to comment.