diff --git a/cli/cmd/policy_create_internal_test.go b/cli/cmd/policy_create_internal_test.go index 9164ef28f..c2f4893eb 100644 --- a/cli/cmd/policy_create_internal_test.go +++ b/cli/cmd/policy_create_internal_test.go @@ -32,7 +32,7 @@ var ( newPolicy = api.NewPolicy{ PolicyID: "lacework-clitest-1", PolicyType: "Violation", - QueryID: "LW_CLI_AWS_CTA_IntegrationTest", + QueryID: "CLI_AWS_CTA_IntegrationTest", Title: "My Policy Title", Enabled: false, Description: "My Policy Description", diff --git a/cli/cmd/policy_update_internal_test.go b/cli/cmd/policy_update_internal_test.go index 5838b11ea..d42f7fbb5 100644 --- a/cli/cmd/policy_update_internal_test.go +++ b/cli/cmd/policy_update_internal_test.go @@ -32,7 +32,7 @@ var ( falsePtr = false updateTestPolicy = api.UpdatePolicy{ PolicyType: "Violation", - QueryID: "LW_CLI_AWS_CTA_IntegrationTest", + QueryID: "CLI_AWS_CTA_IntegrationTest", Title: "My Policy Title", Enabled: &falsePtr, Description: "My Policy Description", diff --git a/integration/lql_constants.go b/integration/lql_constants.go index cf6192dba..99dc667e9 100644 --- a/integration/lql_constants.go +++ b/integration/lql_constants.go @@ -21,14 +21,14 @@ package integration const ( evaluatorID string = "Cloudtrail" - queryID string = "LW_CLI_AWS_CTA_IntegrationTest" - queryHostID string = "LW_CLI_Host_Files_IntegrationTest" + queryID string = "CLI_AWS_CTA_IntegrationTest" + queryHostID string = "CLI_HOST_Files_IntegrationTest" queryText string = "{ source { CloudTrailRawEvents } return { INSERT_ID } }" queryUpdateText string = "{ source { CloudTrailRawEvents } return { INSERT_ID, INSERT_TIME } }" queryJSONTemplate string = `{ "queryID": "%s", "queryText": "%s" }` - queryURL string = "https://raw.githubusercontent.com/lacework/go-sdk/main/integration/test_resources/lql/LW_CLI_AWS_CTA_IntegrationTest.yaml" - queryHostURL string = "https://raw.githubusercontent.com/lacework/go-sdk/main/integration/test_resources/lql/LW_CLI_Host_Files_IntegrationTest.yaml" + queryURL string = "https://raw.githubusercontent.com/lacework/go-sdk/main/integration/test_resources/lql/CLI_AWS_CTA_IntegrationTest.yaml" + queryHostURL string = "https://raw.githubusercontent.com/lacework/go-sdk/main/integration/test_resources/lql/CLI_HOST_Files_IntegrationTest.yaml" ) diff --git a/integration/lql_list_test.go b/integration/lql_list_test.go index 63a6b8f22..37a3f5f6b 100644 --- a/integration/lql_list_test.go +++ b/integration/lql_list_test.go @@ -34,13 +34,13 @@ func TestQueryList(t *testing.T) { // list human out, err, exitcode := LaceworkCLIWithTOMLConfig("query", "list") assert.Contains(t, out.String(), "QUERY ID") - assert.Contains(t, out.String(), "LW_CLI_AWS_CTA_IntegrationTest") + assert.Contains(t, out.String(), "CLI_AWS_CTA_IntegrationTest") assert.Empty(t, err.String(), "STDERR should be empty") assert.Equal(t, 0, exitcode, "EXITCODE is not the expected one") // list json out, err, exitcode = LaceworkCLIWithTOMLConfig("query", "list", "--json") - assert.Contains(t, out.String(), `"LW_CLI_AWS_CTA_IntegrationTest"`) + assert.Contains(t, out.String(), `"CLI_AWS_CTA_IntegrationTest"`) assert.Empty(t, err.String(), "STDERR should be empty") assert.Equal(t, 0, exitcode, "EXITCODE is not the expected one") } diff --git a/integration/policy_test.go b/integration/policy_test.go index db03fc8d4..ca9482a01 100644 --- a/integration/policy_test.go +++ b/integration/policy_test.go @@ -34,7 +34,7 @@ const ( newPolicyYAML string = `--- policyId: clitest-1 policyType: Violation -queryId: LW_CLI_AWS_CTA_IntegrationTest +queryId: CLI_AWS_CTA_IntegrationTest title: My Policy Title enabled: false description: My Policy Description @@ -48,7 +48,7 @@ tags: newHostPolicyYAML string = `--- evaluatorId: policyType: Violation -queryId: LW_CLI_Host_Files_IntegrationTest +queryId: CLI_HOST_Files_IntegrationTest title: My Policy Title enabled: false description: My Policy Description diff --git a/integration/test_resources/lql/LW_CLI_AWS_CTA_IntegrationTest.yaml b/integration/test_resources/lql/CLI_AWS_CTA_IntegrationTest.yaml similarity index 78% rename from integration/test_resources/lql/LW_CLI_AWS_CTA_IntegrationTest.yaml rename to integration/test_resources/lql/CLI_AWS_CTA_IntegrationTest.yaml index ed2dd8073..26a6b07dd 100644 --- a/integration/test_resources/lql/LW_CLI_AWS_CTA_IntegrationTest.yaml +++ b/integration/test_resources/lql/CLI_AWS_CTA_IntegrationTest.yaml @@ -1,10 +1,10 @@ --- evaluatorId: Cloudtrail -queryId: LW_CLI_AWS_CTA_IntegrationTest +queryId: CLI_AWS_CTA_IntegrationTest queryText: |- --- This query produces a web (github) hosted object for "lacework query" integration testing --- Specifically: TestQueryRunURL - LW_CLI_AWS_CTA_IntegrationTest { + CLI_AWS_CTA_IntegrationTest { source { CloudTrailRawEvents } diff --git a/integration/test_resources/lql/LW_CLI_Host_Files_IntegrationTest.yaml b/integration/test_resources/lql/CLI_Host_Files_IntegrationTest.yaml similarity index 75% rename from integration/test_resources/lql/LW_CLI_Host_Files_IntegrationTest.yaml rename to integration/test_resources/lql/CLI_Host_Files_IntegrationTest.yaml index 158f2cdd7..abbc2bd05 100644 --- a/integration/test_resources/lql/LW_CLI_Host_Files_IntegrationTest.yaml +++ b/integration/test_resources/lql/CLI_Host_Files_IntegrationTest.yaml @@ -1,10 +1,10 @@ --- evaluatorId: -queryId: LW_CLI_Host_Files_IntegrationTest +queryId: CLI_HOST_Files_IntegrationTest queryText: |- --- This query produces a web (github) hosted object for "lacework query" integration testing --- Specifically: TestPolicyCreateHost - LW_CLI_Host_Files_IntegrationTest { + CLI_HOST_Files_IntegrationTest { source { LW_HE_FILES } diff --git a/integration/test_resources/policy/account-clitest-1.json b/integration/test_resources/policy/account-clitest-1.json index ac173a6b8..97ba54b0e 100644 --- a/integration/test_resources/policy/account-clitest-1.json +++ b/integration/test_resources/policy/account-clitest-1.json @@ -2,7 +2,7 @@ "evaluatorId": "Cloudtrail", "policyId": "$account-clitest-1", "policyType": "Violation", - "queryId": "LW_CLI_AWS_CTA_IntegrationTest", + "queryId": "CLI_AWS_CTA_IntegrationTest", "title": "My Policy Title", "enabled": false, "description": "My Policy Description",