From e19029bd2970f7447aff79365d56fd14db23eba2 Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Wed, 11 Jan 2023 15:54:43 +0100 Subject: [PATCH 01/28] Create the compute ssl certificate asset --- enumeration/remote/google/repository/asset.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/enumeration/remote/google/repository/asset.go b/enumeration/remote/google/repository/asset.go index 953e4f117..22e74c411 100644 --- a/enumeration/remote/google/repository/asset.go +++ b/enumeration/remote/google/repository/asset.go @@ -37,6 +37,7 @@ const ( computeForwardingRuleAssetType = "compute.googleapis.com/ForwardingRule" instanceGroupManagerAssetType = "compute.googleapis.com/InstanceGroupManager" computeGlobalForwardingRuleAssetType = "compute.googleapis.com/GlobalForwardingRule" + computeSslCertificateRuleAssetType = "compute.googleapis.com/SslCertificate" ) type AssetRepository interface { @@ -64,6 +65,7 @@ type AssetRepository interface { SearchAllForwardingRules() ([]*assetpb.Asset, error) SearchAllInstanceGroupManagers() ([]*assetpb.Asset, error) SearchAllGlobalForwardingRules() ([]*assetpb.Asset, error) + SearchAllSslCertificates() ([]*assetpb.Asset, error) } type assetRepository struct { @@ -94,6 +96,7 @@ func (s assetRepository) listAllResources(ty string) ([]*assetpb.Asset, error) { computeForwardingRuleAssetType, instanceGroupManagerAssetType, computeGlobalForwardingRuleAssetType, + computeSslCertificateRuleAssetType, }, } var results []*assetpb.Asset @@ -280,3 +283,7 @@ func (s assetRepository) SearchAllInstanceGroupManagers() ([]*assetpb.Asset, err func (s assetRepository) SearchAllGlobalForwardingRules() ([]*assetpb.Asset, error) { return s.listAllResources(computeGlobalForwardingRuleAssetType) } + +func (s assetRepository) SearchAllSslCertificateRules() ([]*assetpb.Asset, error) { + return s.listAllResources(computeSslCertificateRuleAssetType) +} From 72edb235bfa04d511b30355ecaaf7797f9699eca Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Wed, 11 Jan 2023 15:54:48 +0100 Subject: [PATCH 02/28] Create google_compute_ssl_certificate_enumerator.go --- ...ogle_compute_ssl_certificate_enumerator.go | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 enumeration/remote/google/google_compute_ssl_certificate_enumerator.go diff --git a/enumeration/remote/google/google_compute_ssl_certificate_enumerator.go b/enumeration/remote/google/google_compute_ssl_certificate_enumerator.go new file mode 100644 index 000000000..9b2f31d9f --- /dev/null +++ b/enumeration/remote/google/google_compute_ssl_certificate_enumerator.go @@ -0,0 +1,45 @@ +package google + +import ( + remoteerror "github.com/snyk/driftctl/enumeration/remote/error" + "github.com/snyk/driftctl/enumeration/remote/google/repository" + "github.com/snyk/driftctl/enumeration/resource" + "github.com/snyk/driftctl/enumeration/resource/google" +) + +type GoogleComputeSslCertificateRuleEnumerator struct { + repository repository.AssetRepository + factory resource.ResourceFactory +} + +func NewGoogleComputeSslCertificateRuleEnumerator(repo repository.AssetRepository, factory resource.ResourceFactory) *GoogleComputeSslCertificateRuleEnumerator { + return &GoogleComputeSslCertificateRuleEnumerator{ + repository: repo, + factory: factory, + } +} + +func (e *GoogleComputeSslCertificateRuleEnumerator) SupportedType() resource.ResourceType { + return google.GoogleComputeSslCertificateRuleResourceType +} + +func (e *GoogleComputeSslCertificateRuleEnumerator) Enumerate() ([]*resource.Resource, error) { + forwardingRules, err := e.repository.SearchAllForwardingRules() + if err != nil { + return nil, remoteerror.NewResourceListingError(err, string(e.SupportedType())) + } + + results := make([]*resource.Resource, 0, len(forwardingRules)) + for _, res := range forwardingRules { + results = append( + results, + e.factory.CreateAbstractResource( + string(e.SupportedType()), + trimResourceName(res.GetName()), + map[string]interface{}{}, + ), + ) + } + + return results, err +} From 390efcf8040f32af5e7837aa78358ffc675143a9 Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Wed, 11 Jan 2023 15:54:58 +0100 Subject: [PATCH 03/28] Add the compute ssl certificate enumerator --- enumeration/remote/google/init.go | 1 + 1 file changed, 1 insertion(+) diff --git a/enumeration/remote/google/init.go b/enumeration/remote/google/init.go index 85c7d9a16..c54afe659 100644 --- a/enumeration/remote/google/init.go +++ b/enumeration/remote/google/init.go @@ -104,6 +104,7 @@ func Init(version string, alerter alerter.AlerterInterface, providerLibrary *ter remoteLibrary.AddEnumerator(NewGoogleComputeForwardingRuleEnumerator(assetRepository, factory)) remoteLibrary.AddEnumerator(NewGoogleComputeInstanceGroupManagerEnumerator(assetRepository, factory)) remoteLibrary.AddEnumerator(NewGoogleComputeGlobalForwardingRuleEnumerator(assetRepository, factory)) + remoteLibrary.AddEnumerator(NewGoogleComputeSslCertificateRuleEnumerator(assetRepository, factory)) return nil } From 9cdcedb1d1369ac650b9318248eb161f1130e3b7 Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Wed, 11 Jan 2023 15:55:11 +0100 Subject: [PATCH 04/28] declare the `google_compute_ssl_certificate` resource type --- enumeration/resource/google/google_compute_ssl_certificate.go | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 enumeration/resource/google/google_compute_ssl_certificate.go diff --git a/enumeration/resource/google/google_compute_ssl_certificate.go b/enumeration/resource/google/google_compute_ssl_certificate.go new file mode 100644 index 000000000..02f5b714b --- /dev/null +++ b/enumeration/resource/google/google_compute_ssl_certificate.go @@ -0,0 +1,3 @@ +package google + +const GoogleComputeSslCertificateResourceType = "google_compute_ssl_certificate" From 7b197bd9d47ae34640cb2ede18c17346ccb5d9ec Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Wed, 11 Jan 2023 15:55:19 +0100 Subject: [PATCH 05/28] add `google_compute_ssl_certificate` to resource types --- enumeration/resource/resource_types.go | 1 + 1 file changed, 1 insertion(+) diff --git a/enumeration/resource/resource_types.go b/enumeration/resource/resource_types.go index 1c53a600c..4ecab2c2b 100644 --- a/enumeration/resource/resource_types.go +++ b/enumeration/resource/resource_types.go @@ -221,6 +221,7 @@ var supportedTypes = map[string]ResourceTypeMeta{ "google_compute_forwarding_rule": {}, "google_compute_instance_group_manager": {}, "google_compute_global_forwarding_rule": {}, + "google_compute_ssl_certificate": {}, "azurerm_storage_account": {}, "azurerm_storage_container": {}, From 11c6a6730232e8e9696faacd2eea02aa7c7c43c1 Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Wed, 11 Jan 2023 15:55:32 +0100 Subject: [PATCH 06/28] add `google_compute_ssl_certificate` to the state reader test --- pkg/iac/terraform/state/terraform_state_reader_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/iac/terraform/state/terraform_state_reader_test.go b/pkg/iac/terraform/state/terraform_state_reader_test.go index 922913632..54f8ba0f8 100644 --- a/pkg/iac/terraform/state/terraform_state_reader_test.go +++ b/pkg/iac/terraform/state/terraform_state_reader_test.go @@ -405,6 +405,7 @@ func TestTerraformStateReader_Google_Resources(t *testing.T) { {name: "compute forwarding rule", dirName: "google_compute_forwarding_rule", wantErr: false}, {name: "compute instance group manager", dirName: "google_compute_instance_group_manager", wantErr: false}, {name: "compute global forwarding rule", dirName: "google_compute_global_forwarding_rule", wantErr: false}, + {name: "compute ssl certificate", dirName: "google_compute_ssl_certificate", wantErr: false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { From 85faa50d20ab6c15516ad6a5d5ff012c1b39b44d Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Wed, 11 Jan 2023 15:55:39 +0100 Subject: [PATCH 07/28] add `google_compute_ssl_certificate` to the metadata test --- pkg/resource/google/metadata_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/resource/google/metadata_test.go b/pkg/resource/google/metadata_test.go index 602c247ce..297a6c9b8 100644 --- a/pkg/resource/google/metadata_test.go +++ b/pkg/resource/google/metadata_test.go @@ -34,6 +34,7 @@ func TestGoogle_Metadata_Flags(t *testing.T) { google.GoogleComputeForwardingRuleResourceType: {}, google.GoogleComputeInstanceGroupManagerResourceType: {}, google.GoogleComputeGlobalForwardingRuleResourceType: {}, + google.GoogleComputeSslCertificateRuleResourceType: {}, } schemaRepository := testresource.InitFakeSchemaRepository("google", "3.78.0") From 4aba5b9c17c9d5c15b03b51f48d5795e3373d13c Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Wed, 11 Jan 2023 16:25:00 +0100 Subject: [PATCH 08/28] Update mock_AssetRepository.go --- .../google/repository/mock_AssetRepository.go | 40 ++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/enumeration/remote/google/repository/mock_AssetRepository.go b/enumeration/remote/google/repository/mock_AssetRepository.go index 44c460084..0afc92935 100644 --- a/enumeration/remote/google/repository/mock_AssetRepository.go +++ b/enumeration/remote/google/repository/mock_AssetRepository.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.10.0. DO NOT EDIT. +// Code generated by mockery v2.16.0. DO NOT EDIT. package repository @@ -518,6 +518,29 @@ func (_m *MockAssetRepository) SearchAllSQLDatabaseInstances() ([]*asset.Asset, return r0, r1 } +// SearchAllSslCertificates provides a mock function with given fields: +func (_m *MockAssetRepository) SearchAllSslCertificates() ([]*asset.Asset, error) { + ret := _m.Called() + + var r0 []*asset.Asset + if rf, ok := ret.Get(0).(func() []*asset.Asset); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]*asset.Asset) + } + } + + var r1 error + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + // SearchAllSubnetworks provides a mock function with given fields: func (_m *MockAssetRepository) SearchAllSubnetworks() ([]*asset.ResourceSearchResult, error) { ret := _m.Called() @@ -563,3 +586,18 @@ func (_m *MockAssetRepository) SearchAllTables() ([]*asset.ResourceSearchResult, return r0, r1 } + +type mockConstructorTestingTNewMockAssetRepository interface { + mock.TestingT + Cleanup(func()) +} + +// NewMockAssetRepository creates a new instance of MockAssetRepository. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +func NewMockAssetRepository(t mockConstructorTestingTNewMockAssetRepository) *MockAssetRepository { + mock := &MockAssetRepository{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} From a28ddb717e664e4de05adb0f533b61a4e919938e Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Wed, 11 Jan 2023 16:27:55 +0100 Subject: [PATCH 09/28] rm rule --- .../google_compute_ssl_certificate_enumerator.go | 16 ++++++++-------- enumeration/remote/google/init.go | 2 +- enumeration/remote/google/repository/asset.go | 6 +++--- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/enumeration/remote/google/google_compute_ssl_certificate_enumerator.go b/enumeration/remote/google/google_compute_ssl_certificate_enumerator.go index 9b2f31d9f..9724ab374 100644 --- a/enumeration/remote/google/google_compute_ssl_certificate_enumerator.go +++ b/enumeration/remote/google/google_compute_ssl_certificate_enumerator.go @@ -7,30 +7,30 @@ import ( "github.com/snyk/driftctl/enumeration/resource/google" ) -type GoogleComputeSslCertificateRuleEnumerator struct { +type GoogleComputeSslCertificateEnumerator struct { repository repository.AssetRepository factory resource.ResourceFactory } -func NewGoogleComputeSslCertificateRuleEnumerator(repo repository.AssetRepository, factory resource.ResourceFactory) *GoogleComputeSslCertificateRuleEnumerator { - return &GoogleComputeSslCertificateRuleEnumerator{ +func NewGoogleComputeSslCertificateEnumerator(repo repository.AssetRepository, factory resource.ResourceFactory) *GoogleComputeSslCertificateEnumerator { + return &GoogleComputeSslCertificateEnumerator{ repository: repo, factory: factory, } } -func (e *GoogleComputeSslCertificateRuleEnumerator) SupportedType() resource.ResourceType { +func (e *GoogleComputeSslCertificateEnumerator) SupportedType() resource.ResourceType { return google.GoogleComputeSslCertificateRuleResourceType } -func (e *GoogleComputeSslCertificateRuleEnumerator) Enumerate() ([]*resource.Resource, error) { - forwardingRules, err := e.repository.SearchAllForwardingRules() +func (e *GoogleComputeSslCertificateEnumerator) Enumerate() ([]*resource.Resource, error) { + sslCertificates, err := e.repository.SearchAllSslCertificates() if err != nil { return nil, remoteerror.NewResourceListingError(err, string(e.SupportedType())) } - results := make([]*resource.Resource, 0, len(forwardingRules)) - for _, res := range forwardingRules { + results := make([]*resource.Resource, 0, len(sslCertificates)) + for _, res := range sslCertificates { results = append( results, e.factory.CreateAbstractResource( diff --git a/enumeration/remote/google/init.go b/enumeration/remote/google/init.go index c54afe659..3c81fa4fd 100644 --- a/enumeration/remote/google/init.go +++ b/enumeration/remote/google/init.go @@ -104,7 +104,7 @@ func Init(version string, alerter alerter.AlerterInterface, providerLibrary *ter remoteLibrary.AddEnumerator(NewGoogleComputeForwardingRuleEnumerator(assetRepository, factory)) remoteLibrary.AddEnumerator(NewGoogleComputeInstanceGroupManagerEnumerator(assetRepository, factory)) remoteLibrary.AddEnumerator(NewGoogleComputeGlobalForwardingRuleEnumerator(assetRepository, factory)) - remoteLibrary.AddEnumerator(NewGoogleComputeSslCertificateRuleEnumerator(assetRepository, factory)) + remoteLibrary.AddEnumerator(NewGoogleComputeSslCertificateEnumerator(assetRepository, factory)) return nil } diff --git a/enumeration/remote/google/repository/asset.go b/enumeration/remote/google/repository/asset.go index 22e74c411..14ff0b79f 100644 --- a/enumeration/remote/google/repository/asset.go +++ b/enumeration/remote/google/repository/asset.go @@ -37,7 +37,7 @@ const ( computeForwardingRuleAssetType = "compute.googleapis.com/ForwardingRule" instanceGroupManagerAssetType = "compute.googleapis.com/InstanceGroupManager" computeGlobalForwardingRuleAssetType = "compute.googleapis.com/GlobalForwardingRule" - computeSslCertificateRuleAssetType = "compute.googleapis.com/SslCertificate" + computeSslCertificateAssetType = "compute.googleapis.com/SslCertificate" ) type AssetRepository interface { @@ -96,7 +96,7 @@ func (s assetRepository) listAllResources(ty string) ([]*assetpb.Asset, error) { computeForwardingRuleAssetType, instanceGroupManagerAssetType, computeGlobalForwardingRuleAssetType, - computeSslCertificateRuleAssetType, + computeSslCertificateAssetType, }, } var results []*assetpb.Asset @@ -285,5 +285,5 @@ func (s assetRepository) SearchAllGlobalForwardingRules() ([]*assetpb.Asset, err } func (s assetRepository) SearchAllSslCertificateRules() ([]*assetpb.Asset, error) { - return s.listAllResources(computeSslCertificateRuleAssetType) + return s.listAllResources(computeSslCertificateAssetType) } From c43ae37bf14e57bc8b5f65fd0c99046397295de0 Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Wed, 11 Jan 2023 16:29:08 +0100 Subject: [PATCH 10/28] rm rule --- .../remote/google/google_compute_ssl_certificate_enumerator.go | 2 +- enumeration/remote/google/repository/asset.go | 2 +- pkg/resource/google/metadata_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/enumeration/remote/google/google_compute_ssl_certificate_enumerator.go b/enumeration/remote/google/google_compute_ssl_certificate_enumerator.go index 9724ab374..65dc50704 100644 --- a/enumeration/remote/google/google_compute_ssl_certificate_enumerator.go +++ b/enumeration/remote/google/google_compute_ssl_certificate_enumerator.go @@ -20,7 +20,7 @@ func NewGoogleComputeSslCertificateEnumerator(repo repository.AssetRepository, f } func (e *GoogleComputeSslCertificateEnumerator) SupportedType() resource.ResourceType { - return google.GoogleComputeSslCertificateRuleResourceType + return google.GoogleComputeSslCertificateResourceType } func (e *GoogleComputeSslCertificateEnumerator) Enumerate() ([]*resource.Resource, error) { diff --git a/enumeration/remote/google/repository/asset.go b/enumeration/remote/google/repository/asset.go index 14ff0b79f..545b75c24 100644 --- a/enumeration/remote/google/repository/asset.go +++ b/enumeration/remote/google/repository/asset.go @@ -284,6 +284,6 @@ func (s assetRepository) SearchAllGlobalForwardingRules() ([]*assetpb.Asset, err return s.listAllResources(computeGlobalForwardingRuleAssetType) } -func (s assetRepository) SearchAllSslCertificateRules() ([]*assetpb.Asset, error) { +func (s assetRepository) SearchAllSslCertificates() ([]*assetpb.Asset, error) { return s.listAllResources(computeSslCertificateAssetType) } diff --git a/pkg/resource/google/metadata_test.go b/pkg/resource/google/metadata_test.go index 297a6c9b8..57755a18f 100644 --- a/pkg/resource/google/metadata_test.go +++ b/pkg/resource/google/metadata_test.go @@ -34,7 +34,7 @@ func TestGoogle_Metadata_Flags(t *testing.T) { google.GoogleComputeForwardingRuleResourceType: {}, google.GoogleComputeInstanceGroupManagerResourceType: {}, google.GoogleComputeGlobalForwardingRuleResourceType: {}, - google.GoogleComputeSslCertificateRuleResourceType: {}, + google.GoogleComputeSslCertificateResourceType: {}, } schemaRepository := testresource.InitFakeSchemaRepository("google", "3.78.0") From 02b984fa89b444ef9daccd1132779697de3e2333 Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Wed, 11 Jan 2023 16:37:03 +0100 Subject: [PATCH 11/28] Create `TestGoogleComputeSslCertificate` --- .../remote/google_compute_scanner_test.go | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) diff --git a/enumeration/remote/google_compute_scanner_test.go b/enumeration/remote/google_compute_scanner_test.go index 449b9e60b..b1d61fa02 100644 --- a/enumeration/remote/google_compute_scanner_test.go +++ b/enumeration/remote/google_compute_scanner_test.go @@ -1507,6 +1507,112 @@ func TestGoogleComputeForwardingRule(t *testing.T) { } } +func TestGoogleComputeSslCertificate(t *testing.T) { + cases := []struct { + test string + assertExpected func(t *testing.T, got []*resource.Resource) + response []*assetpb.Asset + responseErr error + setupAlerterMock func(alerter *mocks.AlerterInterface) + wantErr error + }{ + { + test: "no compute ssl certificates", + response: []*assetpb.Asset{}, + assertExpected: func(t *testing.T, got []*resource.Resource) { + assert.Len(t, got, 0) + }, + }, + { + test: "multiple compute ssl certificates", + assertExpected: func(t *testing.T, got []*resource.Resource) { + assert.Len(t, got, 2) + assert.Equal(t, "projects/playground-bruno/regions/us-east1/sslCertificates/foo", got[0].ResourceId()) + assert.Equal(t, "google_compute_ssl_certificate", got[0].ResourceType()) + + assert.Equal(t, "projects/driftctl/regions/us-east1/sslCertificates/bar", got[1].ResourceId()) + assert.Equal(t, "google_compute_ssl_certificate", got[1].ResourceType()) + }, + response: []*assetpb.Asset{ + { + AssetType: "compute.googleapis.com/ForwardingRule", + Name: "//compute.googleapis.com/projects/playground-bruno/regions/us-east1/sslCertificates/foo", + }, + { + AssetType: "compute.googleapis.com/ForwardingRule", + Name: "//compute.googleapis.com/projects/playground-bruno/regions/us-east1/sslCertificates/bar", + }, + }, + }, + { + test: "cannot list compute ssl certificates", + assertExpected: func(t *testing.T, got []*resource.Resource) { + assert.Len(t, got, 0) + }, + responseErr: status.Error(codes.PermissionDenied, "The caller does not have permission"), + setupAlerterMock: func(alerter *mocks.AlerterInterface) { + alerter.On( + "SendAlert", + "google_compute_ssl_certificate", + alerts.NewRemoteAccessDeniedAlert( + common.RemoteGoogleTerraform, + remoteerr.NewResourceListingError( + status.Error(codes.PermissionDenied, "The caller does not have permission"), + "google_compute_ssl_certificate", + ), + alerts.EnumerationPhase, + ), + ).Once() + }, + }, + } + + factory := terraform.NewTerraformResourceFactory() + + for _, c := range cases { + t.Run(c.test, func(tt *testing.T) { + scanOptions := ScannerOptions{} + providerLibrary := terraform.NewProviderLibrary() + remoteLibrary := common.NewRemoteLibrary() + + // Initialize mocks + alerter := &mocks.AlerterInterface{} + if c.setupAlerterMock != nil { + c.setupAlerterMock(alerter) + } + + assetClient, err := testgoogle.NewFakeAssertServerWithList(c.response, c.responseErr) + if err != nil { + tt.Fatal(err) + } + + realProvider, err := terraform2.InitTestGoogleProvider(providerLibrary, "3.78.0") + if err != nil { + tt.Fatal(err) + } + + repo := repository.NewAssetRepository(assetClient, realProvider.GetConfig(), cache.New(0)) + + remoteLibrary.AddEnumerator(google.NewGoogleComputeForwardingRuleEnumerator(repo, factory)) + + testFilter := &enumeration.MockFilter{} + testFilter.On("IsTypeIgnored", mock.Anything).Return(false) + + s := NewScanner(remoteLibrary, alerter, scanOptions, testFilter) + got, err := s.Resources() + assert.Equal(tt, err, c.wantErr) + if err != nil { + return + } + alerter.AssertExpectations(tt) + testFilter.AssertExpectations(tt) + if c.assertExpected != nil { + c.assertExpected(t, got) + } + }) + } +} + func TestGoogleComputeInstanceGroupManager(t *testing.T) { cases := []struct { From c13321dfcf21fc6452dfb6b49107ce13946ba62c Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Wed, 11 Jan 2023 22:39:19 +0100 Subject: [PATCH 12/28] add golden file and tfstate --- .../results.golden.json | 19 ++++++++++ .../terraform.tfstate | 37 +++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100755 pkg/iac/terraform/state/test/google_compute_ssl_certificate/results.golden.json create mode 100644 pkg/iac/terraform/state/test/google_compute_ssl_certificate/terraform.tfstate diff --git a/pkg/iac/terraform/state/test/google_compute_ssl_certificate/results.golden.json b/pkg/iac/terraform/state/test/google_compute_ssl_certificate/results.golden.json new file mode 100755 index 000000000..e1d865681 --- /dev/null +++ b/pkg/iac/terraform/state/test/google_compute_ssl_certificate/results.golden.json @@ -0,0 +1,19 @@ +[ + { + "Id": "projects/playground-bruno/regions/global/sslCertificates/my-certificate-6cb457f7", + "Type": "google_compute_ssl_certificate", + "Attrs": { + "certificate": "-----BEGIN CERTIFICATE-----\nMIIDjjCCAnYCCQCtS+GNvuG/2zANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMC\nTkwxFjAUBgNVBAgMDU5vcnRoLUhvbGxhbmQxEjAQBgNVBAcMCUFtc3RlcmRhbTER\nMA8GA1UECgwIRHJpZnRDVEwxFDASBgNVBAMMC2V4YW1wbGUuY29tMSQwIgYJKoZI\nhvcNAQkBFhVkcmlmdGN0bEBkcmlmdGN0bC5jb20wHhcNMjMwMTExMTU1MDAyWhcN\nMjQwMTExMTU1MDAyWjCBiDELMAkGA1UEBhMCTkwxFjAUBgNVBAgMDU5vcnRoLUhv\nbGxhbmQxEjAQBgNVBAcMCUFtc3RlcmRhbTERMA8GA1UECgwIRHJpZnRDVEwxFDAS\nBgNVBAMMC2V4YW1wbGUuY29tMSQwIgYJKoZIhvcNAQkBFhVkcmlmdGN0bEBkcmlm\ndGN0bC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGJiRMDAzL\nbsUnOKc8+spzWSfm2N1Lox/uTL8NkqzNNKCr5FVlJVKZcOLusmAzPs0UWJqG5Dmb\nsddOofKyfanZ12v/ADnwUH++uJ5e/0cgmK30jnvINqMrLzs2awt5XwD2PW2ZbAih\n292slOuXJt/KV+VZtP3UoUfp2Gl9qJbFpI/p2qem8udNyp6Q6XSKL4yWO4jPubN/\noJLGRqtaXwPW2wgAWtWfGbTA5o4xbMKu86r1DPB9e2QgduBPLnYJTjZtEC6HkEOk\n/c1Ht9IE40xCu+TAC5FNyOQv6hrSDyJUfUUnPix5Sgyet0Me+u1kMQ3F1qbw/bWA\n4mHgIk/waZdbAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAENAaZXP5ECfGEw/rnRM\n5zfEudp+Y6H/ldGiaOr2E3t8qKOvDCbvV20dz1qvAbns3ol/dVByYRgQwc6GxWdz\nwhCDNUAj/22erTriAQbHfgPAa7Oi9LwBCmUmXqqA/KYOeWNXz9VrsUzCKlSIL7kX\noGuS1CmwNOSvE6AWpixS4epGUy4D721tIV90URhQGKvJmM3/KJe6ktiYxJ08mPLJ\n+8MkXUtZBAUhJUFYL+ZXBbh7lhg6yMDqkkDmraYumotMYwseuUz25PX9oglPyGB7\nmDwRDxz1VYpQ+TUtEwibv0FR6NXLOwZLorZVuZAxlzPJQNCHLAPQALd18CEVX6lq\nrmo=\n-----END CERTIFICATE-----\n", + "certificate_id": 8486823339612136543, + "creation_timestamp": "2023-01-11T07:50:08.574-08:00", + "description": "", + "id": "projects/playground-bruno/global/sslCertificates/my-certificate-6cb457f7", + "name": "my-certificate-6cb457f7", + "name_prefix": null, + "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAxiYkTAwMy27FJzinPPrKc1kn5tjdS6Mf7ky/DZKszTSgq+RV\nZSVSmXDi7rJgMz7NFFiahuQ5m7HXTqHysn2p2ddr/wA58FB/vrieXv9HIJit9I57\nyDajKy87NmsLeV8A9j1tmWwIodvdrJTrlybfylflWbT91KFH6dhpfaiWxaSP6dqn\npvLnTcqekOl0ii+MljuIz7mzf6CSxkarWl8D1tsIAFrVnxm0wOaOMWzCrvOq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gMUfbNIra7drXPdKprI4/hcdrKba1gYftPuYikX4k\nBDUW7Pwb3V2+fZPeSfcA7JlSoiLffv8PA9sBoyYuDEwgFmvKWgUGHLian4geA0wx\nfudBAoGBAKQZb9n3PvJfwSUhXqw+zv9PF+Av9GpPq7iGtg1JV3B2u++I/E8+Orrg\nT2K9DJL+VocN7WPcxxNLlB1CsD7/Kqwbc7P7q9NBpCrZ8SurhOv3YcFSfG+qTDAn\n+b83SrGV7SObUg8NS/vAu9LfYAyz3PllfteXaIvV/e9DMumXFKD1\n-----END RSA PRIVATE KEY-----\n", + "project": "playground-bruno", + "self_link": "https://www.googleapis.com/compute/v1/projects/playground-bruno/global/sslCertificates/my-certificate-6cb457f7", + "timeouts": null + } + } +] \ No newline at end of file diff --git a/pkg/iac/terraform/state/test/google_compute_ssl_certificate/terraform.tfstate b/pkg/iac/terraform/state/test/google_compute_ssl_certificate/terraform.tfstate new file mode 100644 index 000000000..4c34c0d48 --- /dev/null +++ b/pkg/iac/terraform/state/test/google_compute_ssl_certificate/terraform.tfstate @@ -0,0 +1,37 @@ +{ + "version": 4, + "terraform_version": "1.3.7", + "serial": 5, + "lineage": "4c753da3-3a2d-b3e1-7dda-9434691ff386", + "outputs": {}, + "resources": [ + { + "mode": "managed", + "type": "google_compute_ssl_certificate", + "name": "default", + "provider": "provider[\"registry.terraform.io/hashicorp/google\"]", + "instances": [ + { + "schema_version": 0, + "attributes": { + "certificate": "-----BEGIN CERTIFICATE-----\nMIIDjjCCAnYCCQCtS+GNvuG/2zANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMC\nTkwxFjAUBgNVBAgMDU5vcnRoLUhvbGxhbmQxEjAQBgNVBAcMCUFtc3RlcmRhbTER\nMA8GA1UECgwIRHJpZnRDVEwxFDASBgNVBAMMC2V4YW1wbGUuY29tMSQwIgYJKoZI\nhvcNAQkBFhVkcmlmdGN0bEBkcmlmdGN0bC5jb20wHhcNMjMwMTExMTU1MDAyWhcN\nMjQwMTExMTU1MDAyWjCBiDELMAkGA1UEBhMCTkwxFjAUBgNVBAgMDU5vcnRoLUhv\nbGxhbmQxEjAQBgNVBAcMCUFtc3RlcmRhbTERMA8GA1UECgwIRHJpZnRDVEwxFDAS\nBgNVBAMMC2V4YW1wbGUuY29tMSQwIgYJKoZIhvcNAQkBFhVkcmlmdGN0bEBkcmlm\ndGN0bC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGJiRMDAzL\nbsUnOKc8+spzWSfm2N1Lox/uTL8NkqzNNKCr5FVlJVKZcOLusmAzPs0UWJqG5Dmb\nsddOofKyfanZ12v/ADnwUH++uJ5e/0cgmK30jnvINqMrLzs2awt5XwD2PW2ZbAih\n292slOuXJt/KV+VZtP3UoUfp2Gl9qJbFpI/p2qem8udNyp6Q6XSKL4yWO4jPubN/\noJLGRqtaXwPW2wgAWtWfGbTA5o4xbMKu86r1DPB9e2QgduBPLnYJTjZtEC6HkEOk\n/c1Ht9IE40xCu+TAC5FNyOQv6hrSDyJUfUUnPix5Sgyet0Me+u1kMQ3F1qbw/bWA\n4mHgIk/waZdbAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAENAaZXP5ECfGEw/rnRM\n5zfEudp+Y6H/ldGiaOr2E3t8qKOvDCbvV20dz1qvAbns3ol/dVByYRgQwc6GxWdz\nwhCDNUAj/22erTriAQbHfgPAa7Oi9LwBCmUmXqqA/KYOeWNXz9VrsUzCKlSIL7kX\noGuS1CmwNOSvE6AWpixS4epGUy4D721tIV90URhQGKvJmM3/KJe6ktiYxJ08mPLJ\n+8MkXUtZBAUhJUFYL+ZXBbh7lhg6yMDqkkDmraYumotMYwseuUz25PX9oglPyGB7\nmDwRDxz1VYpQ+TUtEwibv0FR6NXLOwZLorZVuZAxlzPJQNCHLAPQALd18CEVX6lq\nrmo=\n-----END CERTIFICATE-----\n", + "certificate_id": 8486823339612136543, + "creation_timestamp": "2023-01-11T07:50:08.574-08:00", + "description": "", + "id": "projects/playground-bruno/global/sslCertificates/my-certificate-6cb457f7", + "name": "my-certificate-6cb457f7", + "name_prefix": null, + "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAxiYkTAwMy27FJzinPPrKc1kn5tjdS6Mf7ky/DZKszTSgq+RV\nZSVSmXDi7rJgMz7NFFiahuQ5m7HXTqHysn2p2ddr/wA58FB/vrieXv9HIJit9I57\nyDajKy87NmsLeV8A9j1tmWwIodvdrJTrlybfylflWbT91KFH6dhpfaiWxaSP6dqn\npvLnTcqekOl0ii+MljuIz7mzf6CSxkarWl8D1tsIAFrVnxm0wOaOMWzCrvOq9Qzw\nfXtkIHbgTy52CU42bRAuh5BDpP3NR7fSBONMQrvkwAuRTcjkL+oa0g8iVH1FJz4s\neUoMnrdDHvrtZDENxdam8P21gOJh4CJP8GmXWwIDAQABAoIBAGvNPnwdJizbY+mV\nue7EJragr8O5ApRu+CVGnb69qMOvuSYrgIYZyxltwBjK9OmMZjiGh/ORYQIivBes\npgSTt3+r4raGIf9rXESf3pGiYskKJ8HgbtmbWCRbeuR9Um3C0RwmiWUp0Hx2yOBm\n2NGQNbq5HS8z99DhueUwdxwFR5nYmvxwwZLvtNXNa6cS2DHRcKql8T6eEmTApi9n\nnx5MQZaeSZNoU4l8Cx0SW0DyHqNuWmmPHL8ICpYxlrrUB3+c4cdj6KKcjBniLZ7l\njP/FBzNbGUZa5JGAC52BcLbTLEIkxidIw4g2CwM1Ihdt+kSuimaV7w5bIpLdvp3G\nfRFacRECgYEA9SVAi9d6fcR279t7LgTs+s+QkcyR7dHyKdBMTjP5F13r3fGpLUMo\n0oMk58ZqTfvWCR/bkQcj1KilauNjagUvy93Un530stWRWZp7DdSX0YhI7LlTfZwR\nIh3V/Zzkd7dqkdEI7pTqD3BT8T7l/mG6fJC7ETCAwAglIWjZpdbtcfMCgYEAzuwt\n9u/DfLQCeWxJDYddys41pVKG70tlI65yIrERgp6ojjoEr8cA9I5vDqALg0Gv/R5w\nSdBUWLgvVi94HdUAX2Zjae6ljD2gTw0o6/wRYwvS+zt/V33JyTmcXacZMnZosTm2\nIxFul2HspAuieTm6db5MmtcjryxMsFNKR/OBtvkCgYA12G/cB4FtPIkPWDsvOX+/\n+3V6wN9QyGuTiaApETtmSYf0YQ9S1MyTqKCjlC5nYKh7qpa0vUe+fyiOWNHOSMNd\n2STJxo0n9scNUmQy/n42VOQHsxFGptAQmVMWeK6qKQxsaOi4VtcuevLFK5ajEF5A\n3B1qwieVhnR5aSldRt8yxwKBgCBoLOq3sk4dgyWxJ9/Oi4nvsccqnadsj3J/J7D3\nOl7SqmNcAs/kwumKRSptNmBgMUfbNIra7drXPdKprI4/hcdrKba1gYftPuYikX4k\nBDUW7Pwb3V2+fZPeSfcA7JlSoiLffv8PA9sBoyYuDEwgFmvKWgUGHLian4geA0wx\nfudBAoGBAKQZb9n3PvJfwSUhXqw+zv9PF+Av9GpPq7iGtg1JV3B2u++I/E8+Orrg\nT2K9DJL+VocN7WPcxxNLlB1CsD7/Kqwbc7P7q9NBpCrZ8SurhOv3YcFSfG+qTDAn\n+b83SrGV7SObUg8NS/vAu9LfYAyz3PllfteXaIvV/e9DMumXFKD1\n-----END RSA PRIVATE KEY-----\n", + "project": "playground-bruno", + "self_link": "https://www.googleapis.com/compute/v1/projects/playground-bruno/global/sslCertificates/my-certificate-6cb457f7", + "timeouts": null + }, + "sensitive_attributes": [], + "private": "eyJlMmJmYjczMC1lY2FhLTExZTYtOGY4OC0zNDM2M2JjN2M0YzAiOnsiY3JlYXRlIjoxMjAwMDAwMDAwMDAwLCJkZWxldGUiOjEyMDAwMDAwMDAwMDB9fQ==", + "create_before_destroy": true + } + ] + } + ], + "check_results": null +} From 6fb907ef58f45775e2eb8568a0a9b127feab3e5c Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Wed, 11 Jan 2023 22:42:55 +0100 Subject: [PATCH 13/28] add testdata for `google_compute_ssl_certificate` resource --- .../.driftignore | 2 + .../.terraform.lock.hcl | 21 ++++++++++ .../google_compute_ssl_certificate/host.cert | 22 +++++++++++ .../google_compute_ssl_certificate/host.key | 27 +++++++++++++ .../terraform.tf | 39 +++++++++++++++++++ 5 files changed, 111 insertions(+) create mode 100644 pkg/resource/google/testdata/acc/google_compute_ssl_certificate/.driftignore create mode 100644 pkg/resource/google/testdata/acc/google_compute_ssl_certificate/.terraform.lock.hcl create mode 100644 pkg/resource/google/testdata/acc/google_compute_ssl_certificate/host.cert create mode 100644 pkg/resource/google/testdata/acc/google_compute_ssl_certificate/host.key create mode 100644 pkg/resource/google/testdata/acc/google_compute_ssl_certificate/terraform.tf diff --git a/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/.driftignore b/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/.driftignore new file mode 100644 index 000000000..ec827a45a --- /dev/null +++ b/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/.driftignore @@ -0,0 +1,2 @@ +* +!google_compute_ssl_certificate diff --git a/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/.terraform.lock.hcl b/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/.terraform.lock.hcl new file mode 100644 index 000000000..bf1dfa8cb --- /dev/null +++ b/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/.terraform.lock.hcl @@ -0,0 +1,21 @@ +# This file is maintained automatically by "terraform init". +# Manual edits may be lost in future updates. + +provider "registry.terraform.io/hashicorp/google" { + version = "4.48.0" + hashes = [ + "h1:L2cITB+wV+2LoLluG3YUzC2vajygDrKuS4f3wW8YcQ0=", + "zh:19c2910e8c555482c28665ad8bed3b6b790ef9b66c565cbb6a5957f8be83048a", + "zh:25fcb8e54aacdadca12fc9966745f34ae3918fa2a85ee1c1f084ec73c00eb01c", + "zh:2e54b7902311b1ad69b0eeb2980a83df3df380042be50bf0785ddfc995de0ad8", + "zh:607ac01d98beaafc06e967294b47d779c23f370240d81c09e434b2b13f56e63f", + "zh:639fbefa214bbd83a318f38fa7412cebf1e4f90b53f39bf427b865de54ce8013", + "zh:75b192f9267c71cad573afd2cd0d080c589660766058a9dd8d244bfcb17e96bc", + "zh:7f355151dd8641bf605f7c287faf56089a9acc9316f91892bc9de8e56d458569", + "zh:9bfdb7d504c0369352dd019889a7ad35f24751c756eaa13e4ab165d2b5c6a6ea", + "zh:b37e6b5e1863a30ccd39a7c0f583e21823d373383e474a8845d46693fc3404f8", + "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", + "zh:f6640c0d8780d2eb465f3fc4a4bcb11a4a0fc7d6db23feb79ca088fc8d081813", + "zh:f6c0aed1c955399239010704894a8c583c61a53ef8ac732f9307d04c366f5e7d", + ] +} diff --git a/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/host.cert b/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/host.cert new file mode 100644 index 000000000..2d979552b --- /dev/null +++ b/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/host.cert @@ -0,0 +1,22 @@ +-----BEGIN CERTIFICATE----- +MIIDjjCCAnYCCQCtS+GNvuG/2zANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMC +TkwxFjAUBgNVBAgMDU5vcnRoLUhvbGxhbmQxEjAQBgNVBAcMCUFtc3RlcmRhbTER +MA8GA1UECgwIRHJpZnRDVEwxFDASBgNVBAMMC2V4YW1wbGUuY29tMSQwIgYJKoZI +hvcNAQkBFhVkcmlmdGN0bEBkcmlmdGN0bC5jb20wHhcNMjMwMTExMTU1MDAyWhcN +MjQwMTExMTU1MDAyWjCBiDELMAkGA1UEBhMCTkwxFjAUBgNVBAgMDU5vcnRoLUhv +bGxhbmQxEjAQBgNVBAcMCUFtc3RlcmRhbTERMA8GA1UECgwIRHJpZnRDVEwxFDAS +BgNVBAMMC2V4YW1wbGUuY29tMSQwIgYJKoZIhvcNAQkBFhVkcmlmdGN0bEBkcmlm +dGN0bC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGJiRMDAzL +bsUnOKc8+spzWSfm2N1Lox/uTL8NkqzNNKCr5FVlJVKZcOLusmAzPs0UWJqG5Dmb +sddOofKyfanZ12v/ADnwUH++uJ5e/0cgmK30jnvINqMrLzs2awt5XwD2PW2ZbAih +292slOuXJt/KV+VZtP3UoUfp2Gl9qJbFpI/p2qem8udNyp6Q6XSKL4yWO4jPubN/ +oJLGRqtaXwPW2wgAWtWfGbTA5o4xbMKu86r1DPB9e2QgduBPLnYJTjZtEC6HkEOk +/c1Ht9IE40xCu+TAC5FNyOQv6hrSDyJUfUUnPix5Sgyet0Me+u1kMQ3F1qbw/bWA +4mHgIk/waZdbAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAENAaZXP5ECfGEw/rnRM +5zfEudp+Y6H/ldGiaOr2E3t8qKOvDCbvV20dz1qvAbns3ol/dVByYRgQwc6GxWdz +whCDNUAj/22erTriAQbHfgPAa7Oi9LwBCmUmXqqA/KYOeWNXz9VrsUzCKlSIL7kX +oGuS1CmwNOSvE6AWpixS4epGUy4D721tIV90URhQGKvJmM3/KJe6ktiYxJ08mPLJ ++8MkXUtZBAUhJUFYL+ZXBbh7lhg6yMDqkkDmraYumotMYwseuUz25PX9oglPyGB7 +mDwRDxz1VYpQ+TUtEwibv0FR6NXLOwZLorZVuZAxlzPJQNCHLAPQALd18CEVX6lq +rmo= +-----END CERTIFICATE----- diff --git a/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/host.key b/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/host.key new file mode 100644 index 000000000..852054fd7 --- /dev/null +++ b/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/host.key @@ -0,0 +1,27 @@ +-----BEGIN RSA PRIVATE KEY----- +MIIEowIBAAKCAQEAxiYkTAwMy27FJzinPPrKc1kn5tjdS6Mf7ky/DZKszTSgq+RV +ZSVSmXDi7rJgMz7NFFiahuQ5m7HXTqHysn2p2ddr/wA58FB/vrieXv9HIJit9I57 +yDajKy87NmsLeV8A9j1tmWwIodvdrJTrlybfylflWbT91KF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wKBgCBoLOq3sk4dgyWxJ9/Oi4nvsccqnadsj3J/J7D3 +Ol7SqmNcAs/kwumKRSptNmBgMUfbNIra7drXPdKprI4/hcdrKba1gYftPuYikX4k +BDUW7Pwb3V2+fZPeSfcA7JlSoiLffv8PA9sBoyYuDEwgFmvKWgUGHLian4geA0wx +fudBAoGBAKQZb9n3PvJfwSUhXqw+zv9PF+Av9GpPq7iGtg1JV3B2u++I/E8+Orrg +T2K9DJL+VocN7WPcxxNLlB1CsD7/Kqwbc7P7q9NBpCrZ8SurhOv3YcFSfG+qTDAn ++b83SrGV7SObUg8NS/vAu9LfYAyz3PllfteXaIvV/e9DMumXFKD1 +-----END RSA PRIVATE KEY----- diff --git a/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/terraform.tf b/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/terraform.tf new file mode 100644 index 000000000..e8640953b --- /dev/null +++ b/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/terraform.tf @@ -0,0 +1,39 @@ +provider "google" {} + +terraform { + required_version = "~> 0.15.0" + required_providers { + google = { + version = "4.48.0" + } + } +} + +resource "random_string" "postfix" { + length = 6 + upper = false + special = false +} +resource "google_compute_ssl_certificate" "default" { + name = random_id.certificate.hex + private_key = file("host.key") + certificate = file("host.cert") + + lifecycle { + create_before_destroy = true + } +} + +provider "google" { + project = "playground-bruno" +} + +resource "random_id" "certificate" { + byte_length = 4 + prefix = "my-certificate-" + + keepers = { + private_key = filebase64sha256("host.key") + certificate = filebase64sha256("host.cert") + } +} From 8e8cee42e10c91a9bfa812d80fc16c5af2226f33 Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Wed, 11 Jan 2023 23:44:50 +0100 Subject: [PATCH 14/28] rm rule --- .../google/google_compute_forwarding_rule_enumerator.go | 2 +- enumeration/remote/google/init.go | 2 +- enumeration/remote/google_compute_scanner_test.go | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/enumeration/remote/google/google_compute_forwarding_rule_enumerator.go b/enumeration/remote/google/google_compute_forwarding_rule_enumerator.go index 1da141618..33ed7b407 100644 --- a/enumeration/remote/google/google_compute_forwarding_rule_enumerator.go +++ b/enumeration/remote/google/google_compute_forwarding_rule_enumerator.go @@ -12,7 +12,7 @@ type GoogleComputeForwardingRuleEnumerator struct { factory resource.ResourceFactory } -func NewGoogleComputeForwardingRuleEnumerator(repo repository.AssetRepository, factory resource.ResourceFactory) *GoogleComputeForwardingRuleEnumerator { +func NewGoogleComputeForwardingEnumerator(repo repository.AssetRepository, factory resource.ResourceFactory) *GoogleComputeForwardingRuleEnumerator { return &GoogleComputeForwardingRuleEnumerator{ repository: repo, factory: factory, diff --git a/enumeration/remote/google/init.go b/enumeration/remote/google/init.go index 3c81fa4fd..396dd815c 100644 --- a/enumeration/remote/google/init.go +++ b/enumeration/remote/google/init.go @@ -101,7 +101,7 @@ func Init(version string, alerter alerter.AlerterInterface, providerLibrary *ter remoteLibrary.AddEnumerator(NewGoogleComputeHealthCheckEnumerator(assetRepository, factory)) remoteLibrary.AddEnumerator(NewGoogleCloudRunServiceEnumerator(assetRepository, factory)) remoteLibrary.AddEnumerator(NewGoogleComputeNodeGroupEnumerator(assetRepository, factory)) - remoteLibrary.AddEnumerator(NewGoogleComputeForwardingRuleEnumerator(assetRepository, factory)) + remoteLibrary.AddEnumerator(NewGoogleComputeForwardingEnumerator(assetRepository, factory)) remoteLibrary.AddEnumerator(NewGoogleComputeInstanceGroupManagerEnumerator(assetRepository, factory)) remoteLibrary.AddEnumerator(NewGoogleComputeGlobalForwardingRuleEnumerator(assetRepository, factory)) remoteLibrary.AddEnumerator(NewGoogleComputeSslCertificateEnumerator(assetRepository, factory)) diff --git a/enumeration/remote/google_compute_scanner_test.go b/enumeration/remote/google_compute_scanner_test.go index b1d61fa02..d6ad41297 100644 --- a/enumeration/remote/google_compute_scanner_test.go +++ b/enumeration/remote/google_compute_scanner_test.go @@ -1487,7 +1487,7 @@ func TestGoogleComputeForwardingRule(t *testing.T) { repo := repository.NewAssetRepository(assetClient, realProvider.GetConfig(), cache.New(0)) - remoteLibrary.AddEnumerator(google.NewGoogleComputeForwardingRuleEnumerator(repo, factory)) + remoteLibrary.AddEnumerator(google.NewGoogleComputeForwardingEnumerator(repo, factory)) testFilter := &enumeration.MockFilter{} testFilter.On("IsTypeIgnored", mock.Anything).Return(false) @@ -1535,11 +1535,11 @@ func TestGoogleComputeSslCertificate(t *testing.T) { }, response: []*assetpb.Asset{ { - AssetType: "compute.googleapis.com/ForwardingRule", + AssetType: "compute.googleapis.com/SslCertificate", Name: "//compute.googleapis.com/projects/playground-bruno/regions/us-east1/sslCertificates/foo", }, { - AssetType: "compute.googleapis.com/ForwardingRule", + AssetType: "compute.googleapis.com/SslCertificate", Name: "//compute.googleapis.com/projects/playground-bruno/regions/us-east1/sslCertificates/bar", }, }, @@ -1593,7 +1593,7 @@ func TestGoogleComputeSslCertificate(t *testing.T) { repo := repository.NewAssetRepository(assetClient, realProvider.GetConfig(), cache.New(0)) - remoteLibrary.AddEnumerator(google.NewGoogleComputeForwardingRuleEnumerator(repo, factory)) + remoteLibrary.AddEnumerator(google.NewGoogleComputeForwardingEnumerator(repo, factory)) testFilter := &enumeration.MockFilter{} testFilter.On("IsTypeIgnored", mock.Anything).Return(false) From 84aec33a514dcad6ec2825d42a824964bc7f709f Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Wed, 11 Jan 2023 23:50:56 +0100 Subject: [PATCH 15/28] fmt --- enumeration/remote/google/repository/asset.go | 2 +- enumeration/resource/resource_types.go | 2 +- pkg/resource/google/metadata_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/enumeration/remote/google/repository/asset.go b/enumeration/remote/google/repository/asset.go index 545b75c24..0357f9f07 100644 --- a/enumeration/remote/google/repository/asset.go +++ b/enumeration/remote/google/repository/asset.go @@ -37,7 +37,7 @@ const ( computeForwardingRuleAssetType = "compute.googleapis.com/ForwardingRule" instanceGroupManagerAssetType = "compute.googleapis.com/InstanceGroupManager" computeGlobalForwardingRuleAssetType = "compute.googleapis.com/GlobalForwardingRule" - computeSslCertificateAssetType = "compute.googleapis.com/SslCertificate" + computeSslCertificateAssetType = "compute.googleapis.com/SslCertificate" ) type AssetRepository interface { diff --git a/enumeration/resource/resource_types.go b/enumeration/resource/resource_types.go index 4ecab2c2b..618848094 100644 --- a/enumeration/resource/resource_types.go +++ b/enumeration/resource/resource_types.go @@ -221,7 +221,7 @@ var supportedTypes = map[string]ResourceTypeMeta{ "google_compute_forwarding_rule": {}, "google_compute_instance_group_manager": {}, "google_compute_global_forwarding_rule": {}, - "google_compute_ssl_certificate": {}, + "google_compute_ssl_certificate": {}, "azurerm_storage_account": {}, "azurerm_storage_container": {}, diff --git a/pkg/resource/google/metadata_test.go b/pkg/resource/google/metadata_test.go index 57755a18f..53e48aeab 100644 --- a/pkg/resource/google/metadata_test.go +++ b/pkg/resource/google/metadata_test.go @@ -34,7 +34,7 @@ func TestGoogle_Metadata_Flags(t *testing.T) { google.GoogleComputeForwardingRuleResourceType: {}, google.GoogleComputeInstanceGroupManagerResourceType: {}, google.GoogleComputeGlobalForwardingRuleResourceType: {}, - google.GoogleComputeSslCertificateResourceType: {}, + google.GoogleComputeSslCertificateResourceType: {}, } schemaRepository := testresource.InitFakeSchemaRepository("google", "3.78.0") From 0573fea10ae400bf7f5b60915b64697fdb6759d1 Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Thu, 12 Jan 2023 00:03:28 +0100 Subject: [PATCH 16/28] Create google_compute_ssl_certificate.go --- pkg/resource/google/google_compute_ssl_certificate.go | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 pkg/resource/google/google_compute_ssl_certificate.go diff --git a/pkg/resource/google/google_compute_ssl_certificate.go b/pkg/resource/google/google_compute_ssl_certificate.go new file mode 100644 index 000000000..02f5b714b --- /dev/null +++ b/pkg/resource/google/google_compute_ssl_certificate.go @@ -0,0 +1,3 @@ +package google + +const GoogleComputeSslCertificateResourceType = "google_compute_ssl_certificate" From 35660022fb232b2c82a19a69f42ff389c7c502a2 Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Mon, 16 Jan 2023 17:42:31 +0100 Subject: [PATCH 17/28] Create google_compute_ssl_certificate_test.go --- .../google_compute_ssl_certificate_test.go | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 pkg/resource/google/google_compute_ssl_certificate_test.go diff --git a/pkg/resource/google/google_compute_ssl_certificate_test.go b/pkg/resource/google/google_compute_ssl_certificate_test.go new file mode 100644 index 000000000..1596e54d1 --- /dev/null +++ b/pkg/resource/google/google_compute_ssl_certificate_test.go @@ -0,0 +1,33 @@ +package google_test + +import ( + "testing" + "time" + + "github.com/snyk/driftctl/test" + "github.com/snyk/driftctl/test/acceptance" +) + +func TestAcc_Google_ComputeSslCertificate(t *testing.T) { + acceptance.Run(t, acceptance.AccTestCase{ + TerraformVersion: "0.15.5", + Paths: []string{"./testdata/acc/google_compute_ssl_certificate"}, + Args: []string{ + "scan", + "--to", "gcp+tf", + }, + Checks: []acceptance.AccCheck{ + { + // New resources are not visible immediately through GCP API after an apply operation. + ShouldRetry: acceptance.LinearBackoff(10 * time.Minute), + Check: func(result *test.ScanResult, stdout string, err error) { + if err != nil { + t.Fatal(err) + } + result.AssertInfrastructureIsInSync() + result.AssertManagedCount(1) + }, + }, + }, + }) +} From 56c14d315bccc265e3230f4dbe72b0c45ee99c11 Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Mon, 16 Jan 2023 17:43:41 +0100 Subject: [PATCH 18/28] Update resource_types.go --- pkg/resource/resource_types.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/resource/resource_types.go b/pkg/resource/resource_types.go index 96d41f5e2..aabaf0303 100644 --- a/pkg/resource/resource_types.go +++ b/pkg/resource/resource_types.go @@ -223,6 +223,7 @@ var supportedTypes = map[string]ResourceTypeMeta{ "google_compute_forwarding_rule": {}, "google_compute_instance_group_manager": {}, "google_compute_global_forwarding_rule": {}, + "google_compute_ssl_certificate": {}, "azurerm_storage_account": {}, "azurerm_storage_container": {}, From 52853a39d07a208e3405fdafc5fd112f92822694 Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Mon, 16 Jan 2023 17:52:08 +0100 Subject: [PATCH 19/28] add 4.48.0 ssl certificate expected/input json --- .../remote/google_compute_scanner_test.go | 2 +- .../expected.json | 19 +++++++++++++++++++ .../google_compute_ssl_certificate/input.json | 19 +++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100755 pkg/test/google/3.78.0/google_compute_ssl_certificate/expected.json create mode 100755 pkg/test/google/3.78.0/google_compute_ssl_certificate/input.json diff --git a/enumeration/remote/google_compute_scanner_test.go b/enumeration/remote/google_compute_scanner_test.go index d6ad41297..b64e1597b 100644 --- a/enumeration/remote/google_compute_scanner_test.go +++ b/enumeration/remote/google_compute_scanner_test.go @@ -1586,7 +1586,7 @@ func TestGoogleComputeSslCertificate(t *testing.T) { tt.Fatal(err) } - realProvider, err := terraform2.InitTestGoogleProvider(providerLibrary, "3.78.0") + realProvider, err := terraform2.InitTestGoogleProvider(providerLibrary, "4.48.0") if err != nil { tt.Fatal(err) } diff --git a/pkg/test/google/3.78.0/google_compute_ssl_certificate/expected.json b/pkg/test/google/3.78.0/google_compute_ssl_certificate/expected.json new file mode 100755 index 000000000..4e66141e3 --- /dev/null +++ b/pkg/test/google/3.78.0/google_compute_ssl_certificate/expected.json @@ -0,0 +1,19 @@ +[ + { + "Id": "projects/playground-bruno/regions/global/sslCertificates/my-certificate-6cb457f7", + "Type": "google_compute_ssl_certificate", + "Attrs": { + "certificate": "-----BEGIN CERTIFICATE-----\nMIIDjjCCAnYCCQCtS+GNvuG/2zANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMC\nTkwxFjAUBgNVBAgMDU5vcnRoLUhvbGxhbmQxEjAQBgNVBAcMCUFtc3RlcmRhbTER\nMA8GA1UECgwIRHJpZnRDVE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AxlzPJQNCHLAPQALd18CEVX6lq\nrmo=\n-----END CERTIFICATE-----\n", + "certificate_id": 8486823339612136543, + "creation_timestamp": "2023-01-11T07:50:08.574-08:00", + "description": "", + "id": "projects/playground-bruno/global/sslCertificates/my-certificate-6cb457f7", + "name": "my-certificate-6cb457f7", + "name_prefix": null, + "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAxiYkTAwMy27FJzinPPrKc1kn5tjdS6Mf7ky/DZKszTSgq+RV\nZSVSmXDi7rJgMz7NFFiahuQ5m7HXTqHysn2p2ddr/wA58FB/vrieXv9HIJit9I57\nyDajKy87NmsLeV8A9j1tmWwIodvdrJTrlybfylflWbT91KFH6dhpfaiWxaSP6dqn\npvLnTcqekOl0ii+MljuIz7mzf6CSxkarWl8D1tsIAFrVnxm0wOaOMWzCrvOq9Qzw\nfXtkIHbgTy52CU42bRAuh5BDpP3NR7fSBONMQrvkwAuRTcjkL+oa0g8iVH1FJz4s\neUoMnrdDHvrtZDENxdam8P21gOJh4CJP8GmXWwIDAQABAoIBAGvNPnwdJizbY+mV\nue7EJragr8O5ApRu+CVGnb69qMOvuSYrgIYZyxltwBjK9OmMZjiGh/ORYQIivBes\npgSTt3+r4raGIf9rXESf3pGiYskKJ8HgbtmbWCRbeuR9Um3C0RwmiWUp0Hx2yOBm\n2NGQNbq5HS8z99DhueUwdxwFR5nYmvxwwZLvtNXNa6cS2DHRcKql8T6eEmTApi9n\nnx5MQZaeSZNoU4l8Cx0SW0DyHqNuWmmPHL8ICpYxlrrUB3+c4cdj6KKcjBniLZ7l\njP/FBzNbGUZa5JGAC52BcLbTLEIkxidIw4g2CwM1Ihdt+kSuimaV7w5bIpLdvp3G\nfRFacRECgYEA9SVAi9d6fcR279t7LgTs+s+QkcyR7dHyKdBMTjP5F13r3fGpLUMo\n0oMk58ZqTfvWCR/bkQcj1KilauNjagUvy93Un530stWRWZp7DdSX0YhI7LlTfZwR\nIh3V/Zzkd7dqkdEI7pTqD3BT8T7l/mG6fJC7ETCAwAglIWjZpdbtcfMCgYEAzuwt\n9u/DfLQCeWxJDYddys41pVKG70tlI65yIrERgp6ojjoEr8cA9I5vDqALg0Gv/R5w\nSdBUWLgvVi94HdUAX2Zjae6ljD2gTw0o6/wRYwvS+zt/V33JyTmcXacZMnZosTm2\nIxFul2HspAuieTm6db5MmtcjryxMsFNKR/OBtvkCgYA12G/cB4FtPIkPWDsvOX+/\n+3V6wN9QyGuTiaApETtmSYf0YQ9S1MyTqKCjlC5nYKh7qpa0vUe+fyiOWNHOSMNd\n2STJxo0n9scNUmQy/n42VOQHsxFGptAQmVMWeK6qKQxsaOi4VtcuevLFK5ajEF5A\n3B1qwieVhnR5aSldRt8yxwKBgCBoLOq3sk4dgyWxJ9/Oi4nvsccqnadsj3J/J7D3\nOl7SqmNcAs/kwumKRSptNmBgMUfbNIra7drXPdKprI4/hcdrKba1gYftPuYikX4k\nBDUW7Pwb3V2+fZPeSfcA7JlSoiLffv8PA9sBoyYuDEwgFmvKWgUGHLian4geA0wx\nfudBAoGBAKQZb9n3PvJfwSUhXqw+zv9PF+Av9GpPq7iGtg1JV3B2u++I/E8+Orrg\nT2K9DJL+VocN7WPcxxNLlB1CsD7/Kqwbc7P7q9NBpCrZ8SurhOv3YcFSfG+qTDAn\n+b83SrGV7SObUg8NS/vAu9LfYAyz3PllfteXaIvV/e9DMumXFKD1\n-----END RSA PRIVATE KEY-----\n", + "project": "playground-bruno", + "self_link": "https://www.googleapis.com/compute/v1/projects/playground-bruno/global/sslCertificates/my-certificate-6cb457f7", + "timeouts": null + } + } +] diff --git a/pkg/test/google/3.78.0/google_compute_ssl_certificate/input.json b/pkg/test/google/3.78.0/google_compute_ssl_certificate/input.json new file mode 100755 index 000000000..4e66141e3 --- /dev/null +++ b/pkg/test/google/3.78.0/google_compute_ssl_certificate/input.json @@ -0,0 +1,19 @@ +[ + { + "Id": "projects/playground-bruno/regions/global/sslCertificates/my-certificate-6cb457f7", + "Type": "google_compute_ssl_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qqA/KYOeWNXz9VrsUzCKlSIL7kX\noGuS1CmwNOSvE6AWpixS4epGUy4D721tIV90URhQGKvJmM3/KJe6ktiYxJ08mPLJ\n+8MkXUtZBAUhJUFYL+ZXBbh7lhg6yMDqkkDmraYumotMYwseuUz25PX9oglPyGB7\nmDwRDxz1VYpQ+TUtEwibv0FR6NXLOwZLorZVuZAxlzPJQNCHLAPQALd18CEVX6lq\nrmo=\n-----END CERTIFICATE-----\n", + "certificate_id": 8486823339612136543, + "creation_timestamp": "2023-01-11T07:50:08.574-08:00", + "description": "", + "id": "projects/playground-bruno/global/sslCertificates/my-certificate-6cb457f7", + "name": "my-certificate-6cb457f7", + "name_prefix": null, + "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAxiYkTAwMy27FJzinPPrKc1kn5tjdS6Mf7ky/DZKszTSgq+RV\nZSVSmXDi7rJgMz7NFFiahuQ5m7HXTqHysn2p2ddr/wA58FB/vrieXv9HIJit9I57\nyDajKy87NmsLeV8A9j1tmWwIodvdrJTrlybfylflWbT91KFH6dhpfaiWxaSP6dqn\npvLnTcqekOl0ii+MljuIz7mzf6CSxkarWl8D1tsIAFrVnxm0wOaOMWzCrvOq9Qzw\nfXtkIHbgTy52CU42bRAuh5BDpP3NR7fSBONMQrvkwAuRTcjkL+oa0g8iVH1FJz4s\neUoMnrdDHvrtZDENxdam8P21gOJh4CJP8GmXWwIDAQABAoIBAGvNPnwdJizbY+mV\nue7EJragr8O5ApRu+CVGnb69qMOvuSYrgIYZyxltwBjK9OmMZjiGh/ORYQIivBes\npgSTt3+r4raGIf9rXESf3pGiYskKJ8HgbtmbWCRbeuR9Um3C0RwmiWUp0Hx2yOBm\n2NGQNbq5HS8z99DhueUwdxwFR5nYmvxwwZLvtNXNa6cS2DHRcKql8T6eEmTApi9n\nnx5MQZaeSZNoU4l8Cx0SW0DyHqNuWmmPHL8ICpYxlrrUB3+c4cdj6KKcjBniLZ7l\njP/FBzNbGUZa5JGAC52BcLbTLEIkxidIw4g2CwM1Ihdt+kSuimaV7w5bIpLdvp3G\nfRFacRECgYEA9SVAi9d6fcR279t7LgTs+s+QkcyR7dHyKdBMTjP5F13r3fGpLUMo\n0oMk58ZqTfvWCR/bkQcj1KilauNjagUvy93Un530stWRWZp7DdSX0YhI7LlTfZwR\nIh3V/Zzkd7dqkdEI7pTqD3BT8T7l/mG6fJC7ETCAwAglIWjZpdbtcfMCgYEAzuwt\n9u/DfLQCeWxJDYddys41pVKG70tlI65yIrERgp6ojjoEr8cA9I5vDqALg0Gv/R5w\nSdBUWLgvVi94HdUAX2Zjae6ljD2gTw0o6/wRYwvS+zt/V33JyTmcXacZMnZosTm2\nIxFul2HspAuieTm6db5MmtcjryxMsFNKR/OBtvkCgYA12G/cB4FtPIkPWDsvOX+/\n+3V6wN9QyGuTiaApETtmSYf0YQ9S1MyTqKCjlC5nYKh7qpa0vUe+fyiOWNHOSMNd\n2STJxo0n9scNUmQy/n42VOQHsxFGptAQmVMWeK6qKQxsaOi4VtcuevLFK5ajEF5A\n3B1qwieVhnR5aSldRt8yxwKBgCBoLOq3sk4dgyWxJ9/Oi4nvsccqnadsj3J/J7D3\nOl7SqmNcAs/kwumKRSptNmBgMUfbNIra7drXPdKprI4/hcdrKba1gYftPuYikX4k\nBDUW7Pwb3V2+fZPeSfcA7JlSoiLffv8PA9sBoyYuDEwgFmvKWgUGHLian4geA0wx\nfudBAoGBAKQZb9n3PvJfwSUhXqw+zv9PF+Av9GpPq7iGtg1JV3B2u++I/E8+Orrg\nT2K9DJL+VocN7WPcxxNLlB1CsD7/Kqwbc7P7q9NBpCrZ8SurhOv3YcFSfG+qTDAn\n+b83SrGV7SObUg8NS/vAu9LfYAyz3PllfteXaIvV/e9DMumXFKD1\n-----END RSA PRIVATE KEY-----\n", + "project": "playground-bruno", + "self_link": "https://www.googleapis.com/compute/v1/projects/playground-bruno/global/sslCertificates/my-certificate-6cb457f7", + "timeouts": null + } + } +] From 245cc16670df8c615143ae04abbb42830f171365 Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Mon, 16 Jan 2023 17:57:40 +0100 Subject: [PATCH 20/28] bump back to 3.78.0 --- enumeration/remote/google_compute_scanner_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enumeration/remote/google_compute_scanner_test.go b/enumeration/remote/google_compute_scanner_test.go index b64e1597b..d6ad41297 100644 --- a/enumeration/remote/google_compute_scanner_test.go +++ b/enumeration/remote/google_compute_scanner_test.go @@ -1586,7 +1586,7 @@ func TestGoogleComputeSslCertificate(t *testing.T) { tt.Fatal(err) } - realProvider, err := terraform2.InitTestGoogleProvider(providerLibrary, "4.48.0") + realProvider, err := terraform2.InitTestGoogleProvider(providerLibrary, "3.78.0") if err != nil { tt.Fatal(err) } From b6fc0f12e1a66c84d4ce37ca007c28a2d12e38ba Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Mon, 16 Jan 2023 17:58:31 +0100 Subject: [PATCH 21/28] bump back to 3.78.0 --- .../.terraform.lock.hcl | 29 ++++++++++--------- .../terraform.tf | 2 +- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/.terraform.lock.hcl b/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/.terraform.lock.hcl index bf1dfa8cb..805a45514 100644 --- a/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/.terraform.lock.hcl +++ b/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/.terraform.lock.hcl @@ -2,20 +2,21 @@ # Manual edits may be lost in future updates. provider "registry.terraform.io/hashicorp/google" { - version = "4.48.0" + version = "3.78.0" + constraints = "3.78.0" hashes = [ - "h1:L2cITB+wV+2LoLluG3YUzC2vajygDrKuS4f3wW8YcQ0=", - "zh:19c2910e8c555482c28665ad8bed3b6b790ef9b66c565cbb6a5957f8be83048a", - "zh:25fcb8e54aacdadca12fc9966745f34ae3918fa2a85ee1c1f084ec73c00eb01c", - "zh:2e54b7902311b1ad69b0eeb2980a83df3df380042be50bf0785ddfc995de0ad8", - "zh:607ac01d98beaafc06e967294b47d779c23f370240d81c09e434b2b13f56e63f", - "zh:639fbefa214bbd83a318f38fa7412cebf1e4f90b53f39bf427b865de54ce8013", - "zh:75b192f9267c71cad573afd2cd0d080c589660766058a9dd8d244bfcb17e96bc", - "zh:7f355151dd8641bf605f7c287faf56089a9acc9316f91892bc9de8e56d458569", - "zh:9bfdb7d504c0369352dd019889a7ad35f24751c756eaa13e4ab165d2b5c6a6ea", - "zh:b37e6b5e1863a30ccd39a7c0f583e21823d373383e474a8845d46693fc3404f8", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - "zh:f6640c0d8780d2eb465f3fc4a4bcb11a4a0fc7d6db23feb79ca088fc8d081813", - "zh:f6c0aed1c955399239010704894a8c583c61a53ef8ac732f9307d04c366f5e7d", + "h1:Seut9gKb/KzzUMxa9Qo59LRWcgURfBWMarqNTRjxnXE=", + "h1:iCyTW8BWdr6Bvd5B89wkxlrB8xLxqHvT1CPmGuKembU=", + "zh:027971c4689b6130619827fe57ce260aaca060db3446817d3a92869dba7cc07f", + "zh:0876dbecc0d441bf2479edd17fe9141d77274b5071ea5f68ac26a2994bff66f3", + "zh:2a5363ed6b1b880f5284e604567cfdabecca809584c30bbe7f19ff568d1ea4cd", + "zh:2f5af69b70654bda91199f6393253e3e479107deebfeddc3fe5850b3a1e83dfb", + "zh:52e6816ef11f5f799a6626dfff384e2153b37450d8320f1ef1eee8f71a2a87b2", + "zh:59ae534607db13db35c0015c06d1ae6d4886f01f7e8fd4e07bc120236a01c494", + "zh:65ab2ed1746ea02d0b1bbd8a22ff3a95d09dc8bdb3841fbc17e45e9feccfb327", + "zh:877a71d24ff65ede3f0c5973168acfeaea0f2fea3757cab5600efcddfd3171d5", + "zh:8b10c9643a4a53148f6758bfd60804b33c2b838482f2c39ed210b729e6b1e2e8", + "zh:ba682648d9f6c11a6d04a250ac79eec39271f615f3ff60c5ae73ebfcc2cdb450", + "zh:e946561921e0279450e9b9f705de9354ce35562ed4cc0d4cd3512aa9eb1f6486", ] } diff --git a/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/terraform.tf b/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/terraform.tf index e8640953b..0783d9e74 100644 --- a/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/terraform.tf +++ b/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/terraform.tf @@ -4,7 +4,7 @@ terraform { required_version = "~> 0.15.0" required_providers { google = { - version = "4.48.0" + version = "3.78.0" } } } From 71f8ea036a9fdda4ebf8581d92eee7014b13405f Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Mon, 16 Jan 2023 19:09:20 +0100 Subject: [PATCH 22/28] fix wrong enumerator --- enumeration/remote/google_compute_scanner_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/enumeration/remote/google_compute_scanner_test.go b/enumeration/remote/google_compute_scanner_test.go index d6ad41297..231bd3854 100644 --- a/enumeration/remote/google_compute_scanner_test.go +++ b/enumeration/remote/google_compute_scanner_test.go @@ -1593,7 +1593,7 @@ func TestGoogleComputeSslCertificate(t *testing.T) { repo := repository.NewAssetRepository(assetClient, realProvider.GetConfig(), cache.New(0)) - remoteLibrary.AddEnumerator(google.NewGoogleComputeForwardingEnumerator(repo, factory)) + remoteLibrary.AddEnumerator(google.NewGoogleComputeSslCertificateEnumerator(repo, factory)) testFilter := &enumeration.MockFilter{} testFilter.On("IsTypeIgnored", mock.Anything).Return(false) From ddc9a5ada88924d669cad6be1086868eb2d5fa1f Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Mon, 16 Jan 2023 19:10:50 +0100 Subject: [PATCH 23/28] fix project id --- enumeration/remote/google_compute_scanner_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/enumeration/remote/google_compute_scanner_test.go b/enumeration/remote/google_compute_scanner_test.go index 231bd3854..7ecb5f708 100644 --- a/enumeration/remote/google_compute_scanner_test.go +++ b/enumeration/remote/google_compute_scanner_test.go @@ -1527,7 +1527,7 @@ func TestGoogleComputeSslCertificate(t *testing.T) { test: "multiple compute ssl certificates", assertExpected: func(t *testing.T, got []*resource.Resource) { assert.Len(t, got, 2) - assert.Equal(t, "projects/playground-bruno/regions/us-east1/sslCertificates/foo", got[0].ResourceId()) + assert.Equal(t, "projects/driftctl/regions/us-east1/sslCertificates/foo", got[0].ResourceId()) assert.Equal(t, "google_compute_ssl_certificate", got[0].ResourceType()) assert.Equal(t, "projects/driftctl/regions/us-east1/sslCertificates/bar", got[1].ResourceId()) @@ -1536,11 +1536,11 @@ func TestGoogleComputeSslCertificate(t *testing.T) { response: []*assetpb.Asset{ { AssetType: "compute.googleapis.com/SslCertificate", - Name: "//compute.googleapis.com/projects/playground-bruno/regions/us-east1/sslCertificates/foo", + Name: "//compute.googleapis.com/projects/driftctl/regions/us-east1/sslCertificates/foo", }, { AssetType: "compute.googleapis.com/SslCertificate", - Name: "//compute.googleapis.com/projects/playground-bruno/regions/us-east1/sslCertificates/bar", + Name: "//compute.googleapis.com/projects/driftctl/regions/us-east1/sslCertificates/bar", }, }, }, From 26ab7c6b0987fb26b6b4b6e4c39d059656def0e3 Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Mon, 16 Jan 2023 19:11:12 +0100 Subject: [PATCH 24/28] change project id --- .../google_compute_ssl_certificate/results.golden.json | 8 ++++---- .../test/google_compute_ssl_certificate/terraform.tfstate | 6 +++--- .../acc/google_compute_ssl_certificate/terraform.tf | 2 +- .../3.78.0/google_compute_ssl_certificate/expected.json | 8 ++++---- .../3.78.0/google_compute_ssl_certificate/input.json | 8 ++++---- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/pkg/iac/terraform/state/test/google_compute_ssl_certificate/results.golden.json b/pkg/iac/terraform/state/test/google_compute_ssl_certificate/results.golden.json index e1d865681..6ce1f42ed 100755 --- a/pkg/iac/terraform/state/test/google_compute_ssl_certificate/results.golden.json +++ b/pkg/iac/terraform/state/test/google_compute_ssl_certificate/results.golden.json @@ -1,18 +1,18 @@ [ { - "Id": "projects/playground-bruno/regions/global/sslCertificates/my-certificate-6cb457f7", + "Id": "projects/driftctl/regions/global/sslCertificates/my-certificate-6cb457f7", "Type": "google_compute_ssl_certificate", "Attrs": { "certificate": "-----BEGIN CERTIFICATE-----\nMIIDjjCCAnYCCQCtS+GNvuG/2zANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMC\nTkwxFjAUBgNVBAgMDU5vcnRoLUhvbGxhbmQxEjAQBgNVBAcMCUFtc3RlcmRhbTER\nMA8GA1UECgwIRHJpZnRDVEwxFDASBgNVBAMMC2V4YW1wbGUuY29tMSQwIgYJKoZI\nhvcNAQkBFhVkcmlmdGN0bEBkcmlmdGN0bC5jb20wHhcNMjMwMTExMTU1MDAyWhcN\nMjQwMTExMTU1MDAyWjCBiDELMAkGA1UEBhMCTkwxFjAUBgNVBAgMDU5vcnRoLUhv\nbGxhbmQxEjAQBgNVBAcMCUFtc3RlcmRhbTERMA8GA1UECgwIRHJpZnRDVEwxFDAS\nBgNVBAMMC2V4YW1wbGUuY29tMSQwIgYJKoZIhvcNAQkBFhVkcmlmdGN0bEBkcmlm\ndGN0bC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGJiRMDAzL\nbsUnOKc8+spzWSfm2N1Lox/uTL8NkqzNNKCr5FVlJVKZcOLusmAzPs0UWJqG5Dmb\nsddOofKyfanZ12v/ADnwUH++uJ5e/0cgmK30jnvINqMrLzs2awt5XwD2PW2ZbAih\n292slOuXJt/KV+VZtP3UoUfp2Gl9qJbFpI/p2qem8udNyp6Q6XSKL4yWO4jPubN/\noJLGRqtaXwPW2wgAWtWfGbTA5o4xbMKu86r1DPB9e2QgduBPLnYJTjZtEC6HkEOk\n/c1Ht9IE40xCu+TAC5FNyOQv6hrSDyJUfUUnPix5Sgyet0Me+u1kMQ3F1qbw/bWA\n4mHgIk/waZdbAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAENAaZXP5ECfGEw/rnRM\n5zfEudp+Y6H/ldGiaOr2E3t8qKOvDCbvV20dz1qvAbns3ol/dVByYRgQwc6GxWdz\nwhCDNUAj/22erTriAQbHfgPAa7Oi9LwBCmUmXqqA/KYOeWNXz9VrsUzCKlSIL7kX\noGuS1CmwNOSvE6AWpixS4epGUy4D721tIV90URhQGKvJmM3/KJe6ktiYxJ08mPLJ\n+8MkXUtZBAUhJUFYL+ZXBbh7lhg6yMDqkkDmraYumotMYwseuUz25PX9oglPyGB7\nmDwRDxz1VYpQ+TUtEwibv0FR6NXLOwZLorZVuZAxlzPJQNCHLAPQALd18CEVX6lq\nrmo=\n-----END CERTIFICATE-----\n", "certificate_id": 8486823339612136543, "creation_timestamp": "2023-01-11T07:50:08.574-08:00", "description": "", - "id": "projects/playground-bruno/global/sslCertificates/my-certificate-6cb457f7", + "id": "projects/driftctl/global/sslCertificates/my-certificate-6cb457f7", "name": "my-certificate-6cb457f7", "name_prefix": null, "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAxiYkTAwMy27FJzinPPrKc1kn5tjdS6Mf7ky/DZKszTSgq+RV\nZSVSmXDi7rJgMz7NFFiahuQ5m7HXTqHysn2p2ddr/wA58FB/vrieXv9HIJit9I57\nyDajKy87NmsLeV8A9j1tmWwIodvdrJTrlybfylflWbT91KFH6dhpfaiWxaSP6dqn\npvLnTcqekOl0ii+MljuIz7mzf6CSxkarWl8D1tsIAFrVnxm0wOaOMWzCrvOq9Qzw\nfXtkIHbgTy52CU42bRAuh5BDpP3NR7fSBONMQrvkwAuRTcjkL+oa0g8iVH1FJz4s\neUoMnrdDHvrtZDENxdam8P21gOJh4CJP8GmXWwIDAQABAoIBAGvNPnwdJizbY+mV\nue7EJragr8O5ApRu+CVGnb69qMOvuSYrgIYZyxltwBjK9OmMZjiGh/ORYQIivBes\npgS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Kqwbc7P7q9NBpCrZ8SurhOv3YcFSfG+qTDAn\n+b83SrGV7SObUg8NS/vAu9LfYAyz3PllfteXaIvV/e9DMumXFKD1\n-----END RSA PRIVATE KEY-----\n", - "project": "playground-bruno", - "self_link": "https://www.googleapis.com/compute/v1/projects/playground-bruno/global/sslCertificates/my-certificate-6cb457f7", + "project": "driftctl", + "self_link": "https://www.googleapis.com/compute/v1/projects/driftctl/global/sslCertificates/my-certificate-6cb457f7", "timeouts": null } } diff --git a/pkg/iac/terraform/state/test/google_compute_ssl_certificate/terraform.tfstate b/pkg/iac/terraform/state/test/google_compute_ssl_certificate/terraform.tfstate index 4c34c0d48..ccf214192 100644 --- a/pkg/iac/terraform/state/test/google_compute_ssl_certificate/terraform.tfstate +++ b/pkg/iac/terraform/state/test/google_compute_ssl_certificate/terraform.tfstate @@ -18,12 +18,12 @@ "certificate_id": 8486823339612136543, "creation_timestamp": "2023-01-11T07:50:08.574-08:00", "description": "", - "id": "projects/playground-bruno/global/sslCertificates/my-certificate-6cb457f7", + "id": "projects/driftctl/global/sslCertificates/my-certificate-6cb457f7", "name": "my-certificate-6cb457f7", "name_prefix": null, "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAxiYkTAwMy27FJzinPPrKc1kn5tjdS6Mf7ky/DZKszTSgq+RV\nZSVSmXDi7rJgMz7NFFiahuQ5m7HXTqHysn2p2ddr/wA58FB/vrieXv9HIJit9I57\nyDajKy87NmsLeV8A9j1tmWwIodvdrJTrlybfylflWbT91KFH6dhpfaiWxaSP6dqn\npvLnTcqekOl0ii+MljuIz7mzf6CSxkarWl8D1tsIAFrVnxm0wOaOMWzCrvOq9Qzw\nfXtkIHbgTy52CU42bRAuh5BDpP3NR7fSBONMQrvkwAuRTcjkL+oa0g8iVH1FJz4s\neUoMnrdDHvrtZDENxdam8P21gOJh4CJP8GmXWwIDAQABAoIBAGvNPnwdJizbY+mV\nue7EJragr8O5ApRu+CVGnb69qMOvuSYrgIYZy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nT2K9DJL+VocN7WPcxxNLlB1CsD7/Kqwbc7P7q9NBpCrZ8SurhOv3YcFSfG+qTDAn\n+b83SrGV7SObUg8NS/vAu9LfYAyz3PllfteXaIvV/e9DMumXFKD1\n-----END RSA PRIVATE KEY-----\n", - "project": "playground-bruno", - "self_link": "https://www.googleapis.com/compute/v1/projects/playground-bruno/global/sslCertificates/my-certificate-6cb457f7", + "project": "driftctl", + "self_link": "https://www.googleapis.com/compute/v1/projects/driftctl/global/sslCertificates/my-certificate-6cb457f7", "timeouts": null }, "sensitive_attributes": [], diff --git a/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/terraform.tf b/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/terraform.tf index 0783d9e74..415ed2dc9 100644 --- a/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/terraform.tf +++ b/pkg/resource/google/testdata/acc/google_compute_ssl_certificate/terraform.tf @@ -25,7 +25,7 @@ resource "google_compute_ssl_certificate" "default" { } provider "google" { - project = "playground-bruno" + project = "driftctl" } resource "random_id" "certificate" { diff --git a/pkg/test/google/3.78.0/google_compute_ssl_certificate/expected.json b/pkg/test/google/3.78.0/google_compute_ssl_certificate/expected.json index 4e66141e3..efee76fad 100755 --- a/pkg/test/google/3.78.0/google_compute_ssl_certificate/expected.json +++ b/pkg/test/google/3.78.0/google_compute_ssl_certificate/expected.json @@ -1,18 +1,18 @@ [ { - "Id": "projects/playground-bruno/regions/global/sslCertificates/my-certificate-6cb457f7", + "Id": "projects/driftctl/regions/global/sslCertificates/my-certificate-6cb457f7", "Type": "google_compute_ssl_certificate", "Attrs": { "certificate": "-----BEGIN CERTIFICATE-----\nMIIDjjCCAnYCCQCtS+GNvuG/2zANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMC\nTkwxFjAUBgNVBAgMDU5vcnRoLUhvbGxhbmQxEjAQBgNVBAcMCUFtc3RlcmRhbTER\nMA8GA1UECgwIRHJpZnRDVEwxFDASBgNVBAMMC2V4YW1wbGU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\nrmo=\n-----END CERTIFICATE-----\n", "certificate_id": 8486823339612136543, "creation_timestamp": "2023-01-11T07:50:08.574-08:00", "description": "", - "id": "projects/playground-bruno/global/sslCertificates/my-certificate-6cb457f7", + "id": "projects/driftctl/global/sslCertificates/my-certificate-6cb457f7", "name": "my-certificate-6cb457f7", "name_prefix": null, "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAxiYkTAwMy27FJzinPPrKc1kn5tjdS6Mf7ky/DZKszTSgq+RV\nZSVSmXDi7rJgMz7NFFiahuQ5m7HXTqHysn2p2ddr/wA58FB/vrieXv9HIJit9I57\nyDajKy87NmsLeV8A9j1tmWwIodvdrJTrlybfylflWbT91KFH6dhpfaiWxaSP6dqn\npvLnTcqekOl0ii+MljuIz7mzf6CSxkarWl8D1tsIAFrVnxm0wOaOMWzCrvOq9Qzw\nfXtkIHbgTy52CU42bRAuh5BDpP3NR7fSBONMQrvkwAuRTcjkL+oa0g8iVH1FJz4s\neUoMnrdDHvrtZDENxdam8P21gOJh4CJP8GmXWwIDAQABAoIBAGvNPnwdJizbY+mV\nue7EJragr8O5ApRu+CVGnb69qMOvuSYrgIYZyxltwBjK9OmMZjiGh/ORYQIivBes\npgSTt3+r4raGIf9rXESf3pGiYskKJ8HgbtmbWCRbeuR9Um3C0RwmiWUp0Hx2yOBm\n2NGQNbq5HS8z99DhueUwdxwFR5nYmvxwwZLvtNXNa6cS2DHRcKql8T6eEmTApi9n\nnx5MQZaeSZNoU4l8Cx0SW0DyHqNuWmmPHL8ICpYxlrrUB3+c4cdj6KKcjBniLZ7l\njP/FBzNbGUZa5JGAC52BcLbTLEIkxidIw4g2CwM1Ihdt+kSuimaV7w5bIpLdvp3G\nfRFacRECgYEA9SVAi9d6fcR279t7LgTs+s+QkcyR7dHyKdBMTjP5F13r3fGpLUMo\n0oMk58ZqTfvWCR/bkQcj1KilauNjagUvy93Un530stWRWZp7DdSX0YhI7LlTfZwR\nIh3V/Zzkd7dqkdEI7pTqD3BT8T7l/mG6fJC7ETCAwAglIWjZpdbtcfMCgYEAzuwt\n9u/DfLQCeWxJDYddys41pVKG70tlI65yIrERgp6ojjoEr8cA9I5vDqALg0Gv/R5w\nSdBUWLgvVi94HdUAX2Zjae6ljD2gTw0o6/wRYwvS+zt/V33JyTmcXacZMnZosTm2\nIxFul2HspAuieTm6db5MmtcjryxMsFNKR/OBtvkCgYA12G/cB4FtPIkPWDsvOX+/\n+3V6wN9QyGuTiaApETtmSYf0YQ9S1MyTqKCjlC5nYKh7qpa0vUe+fyiOWNHOSMNd\n2STJxo0n9scNUmQy/n42VOQHsxFGptAQmVMWeK6qKQxsaOi4VtcuevLFK5ajEF5A\n3B1qwieVhnR5aSldRt8yxwKBgCBoLOq3sk4dgyWxJ9/Oi4nvsccqnadsj3J/J7D3\nOl7SqmNcAs/kwumKRSptNmBgMUfbNIra7drXPdKprI4/hcdrKba1gYftPuYikX4k\nBDUW7Pwb3V2+fZPeSfcA7JlSoiLffv8PA9sBoyYuDEwgFmvKWgUGHLian4geA0wx\nfudBAoGBAKQZb9n3PvJfwSUhXqw+zv9PF+Av9GpPq7iGtg1JV3B2u++I/E8+Orrg\nT2K9DJL+VocN7WPcxxNLlB1CsD7/Kqwbc7P7q9NBpCrZ8SurhOv3YcFSfG+qTDAn\n+b83SrGV7SObUg8NS/vAu9LfYAyz3PllfteXaIvV/e9DMumXFKD1\n-----END RSA PRIVATE KEY-----\n", - "project": "playground-bruno", - "self_link": "https://www.googleapis.com/compute/v1/projects/playground-bruno/global/sslCertificates/my-certificate-6cb457f7", + "project": "driftctl", + "self_link": "https://www.googleapis.com/compute/v1/projects/driftctl/global/sslCertificates/my-certificate-6cb457f7", "timeouts": null } } diff --git a/pkg/test/google/3.78.0/google_compute_ssl_certificate/input.json b/pkg/test/google/3.78.0/google_compute_ssl_certificate/input.json index 4e66141e3..efee76fad 100755 --- a/pkg/test/google/3.78.0/google_compute_ssl_certificate/input.json +++ b/pkg/test/google/3.78.0/google_compute_ssl_certificate/input.json @@ -1,18 +1,18 @@ [ { - "Id": "projects/playground-bruno/regions/global/sslCertificates/my-certificate-6cb457f7", + "Id": "projects/driftctl/regions/global/sslCertificates/my-certificate-6cb457f7", "Type": "google_compute_ssl_certificate", "Attrs": { "certificate": "-----BEGIN CERTIFICATE-----\nMIIDjjCCAnYCCQCtS+GNvuG/2zANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMC\nTkwxFjAUBgNVBAgMDU5vcnRoLUhvbGxhbmQxEjAQBgNVBAcMCUFtc3RlcmRhbTER\nMA8GA1UECgwIRHJpZnRDVEwxFDASBgNVBAMMC2V4YW1wbGUuY29tMSQwIgYJKoZI\nhvcNAQkBFhVkcmlmdGN0bEBkcmlmdGN0bC5jb20wHhcNMjMwMTExMTU1MDAyWhcN\nMjQwMTExMTU1MDAyWjCBiDELMAkGA1UEBhMCTkwxFjAUBgNVBAgMDU5vcnRoLUhv\nbGxhbmQxEjAQBgNVBAcMCUFtc3RlcmRhbTERMA8GA1UECgwIRHJpZnRDVEwxFDAS\nBgNVBAMMC2V4YW1wbGUuY29tMSQwIgYJKoZIhvcNAQkBFhVkcmlmdGN0bEBkcmlm\ndGN0bC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGJiRMDAzL\nbsUnOKc8+spzWSfm2N1Lox/uTL8NkqzNNKCr5FVlJVKZcOLusmAzPs0UWJqG5Dmb\nsddOofKyfanZ12v/ADnwUH++uJ5e/0cgmK30jnvINqMrLzs2awt5XwD2PW2ZbAih\n292slOuXJt/KV+VZtP3UoUfp2Gl9qJbFpI/p2qem8udNyp6Q6XSKL4yWO4jPubN/\noJLGRqtaXwPW2wgAWtWfGbTA5o4xbMKu86r1DPB9e2QgduBPLnYJTjZtEC6HkEOk\n/c1Ht9IE40xCu+TAC5FNyOQv6hrSDyJUfUUnPix5Sgyet0Me+u1kMQ3F1qbw/bWA\n4mHgIk/waZdbAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAENAaZXP5ECfGEw/rnRM\n5zfEudp+Y6H/ldGiaOr2E3t8qKOvDCbvV20dz1qvAbns3ol/dVByYRgQwc6GxWdz\nwhCDNUAj/22erTriAQbHfgPAa7Oi9LwBCmUmXqqA/KYOeWNXz9VrsUzCKlSIL7kX\noGuS1CmwNOSvE6AWpixS4epGUy4D721tIV90URhQGKvJmM3/KJe6ktiYxJ08mPLJ\n+8MkXUtZBAUhJUFYL+ZXBbh7lhg6yMDqkkDmraYumotMYwseuUz25PX9oglPyGB7\nmDwRDxz1VYpQ+TUtEwibv0FR6NXLOwZLorZVuZAxlzPJQNCHLAPQALd18CEVX6lq\nrmo=\n-----END CERTIFICATE-----\n", "certificate_id": 8486823339612136543, "creation_timestamp": "2023-01-11T07:50:08.574-08:00", "description": "", - "id": "projects/playground-bruno/global/sslCertificates/my-certificate-6cb457f7", + "id": "projects/driftctl/global/sslCertificates/my-certificate-6cb457f7", "name": "my-certificate-6cb457f7", "name_prefix": null, "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAxiYkTAwMy27FJzinPPrKc1kn5tjdS6Mf7ky/DZKszTSgq+RV\nZSVSmXDi7rJgMz7NFFiahuQ5m7HXTqHysn2p2ddr/wA58FB/vrieXv9HIJit9I57\nyDajKy87NmsLeV8A9j1tmWwIodvdrJTrlybfylflWbT91KFH6dhpfaiWxaSP6dqn\npvLnTcqekOl0ii+MljuIz7mzf6CSxkarWl8D1tsIAFrVnxm0wOaOMWzCrvOq9Qzw\nfXtkIHbgTy52CU42bRAuh5BDpP3NR7fSBONMQrvkwAuRTcjkL+oa0g8iVH1FJz4s\neUoMnrdDHvrtZDENxdam8P21gOJh4CJP8GmXWwIDAQABAoIBAGvNPnwdJizbY+mV\nue7EJragr8O5ApRu+CVGnb69qMOvuSYrgIYZyxltwBjK9OmMZjiGh/ORYQIivBes\npgSTt3+r4raGIf9rXESf3pGiYskKJ8HgbtmbWCRbeuR9Um3C0RwmiWUp0Hx2yOBm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fYAyz3PllfteXaIvV/e9DMumXFKD1\n-----END RSA PRIVATE KEY-----\n", - "project": "playground-bruno", - "self_link": "https://www.googleapis.com/compute/v1/projects/playground-bruno/global/sslCertificates/my-certificate-6cb457f7", + "project": "driftctl", + "self_link": "https://www.googleapis.com/compute/v1/projects/driftctl/global/sslCertificates/my-certificate-6cb457f7", "timeouts": null } } From f8931b9537a025f04777dc8caf659a82805f2746 Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Mon, 16 Jan 2023 19:14:46 +0100 Subject: [PATCH 25/28] revert func rename --- .../remote/google/google_compute_forwarding_rule_enumerator.go | 2 +- enumeration/remote/google/init.go | 2 +- enumeration/remote/google_compute_scanner_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/enumeration/remote/google/google_compute_forwarding_rule_enumerator.go b/enumeration/remote/google/google_compute_forwarding_rule_enumerator.go index 33ed7b407..1da141618 100644 --- a/enumeration/remote/google/google_compute_forwarding_rule_enumerator.go +++ b/enumeration/remote/google/google_compute_forwarding_rule_enumerator.go @@ -12,7 +12,7 @@ type GoogleComputeForwardingRuleEnumerator struct { factory resource.ResourceFactory } -func NewGoogleComputeForwardingEnumerator(repo repository.AssetRepository, factory resource.ResourceFactory) *GoogleComputeForwardingRuleEnumerator { +func NewGoogleComputeForwardingRuleEnumerator(repo repository.AssetRepository, factory resource.ResourceFactory) *GoogleComputeForwardingRuleEnumerator { return &GoogleComputeForwardingRuleEnumerator{ repository: repo, factory: factory, diff --git a/enumeration/remote/google/init.go b/enumeration/remote/google/init.go index 396dd815c..3c81fa4fd 100644 --- a/enumeration/remote/google/init.go +++ b/enumeration/remote/google/init.go @@ -101,7 +101,7 @@ func Init(version string, alerter alerter.AlerterInterface, providerLibrary *ter remoteLibrary.AddEnumerator(NewGoogleComputeHealthCheckEnumerator(assetRepository, factory)) remoteLibrary.AddEnumerator(NewGoogleCloudRunServiceEnumerator(assetRepository, factory)) remoteLibrary.AddEnumerator(NewGoogleComputeNodeGroupEnumerator(assetRepository, factory)) - remoteLibrary.AddEnumerator(NewGoogleComputeForwardingEnumerator(assetRepository, factory)) + remoteLibrary.AddEnumerator(NewGoogleComputeForwardingRuleEnumerator(assetRepository, factory)) remoteLibrary.AddEnumerator(NewGoogleComputeInstanceGroupManagerEnumerator(assetRepository, factory)) remoteLibrary.AddEnumerator(NewGoogleComputeGlobalForwardingRuleEnumerator(assetRepository, factory)) remoteLibrary.AddEnumerator(NewGoogleComputeSslCertificateEnumerator(assetRepository, factory)) diff --git a/enumeration/remote/google_compute_scanner_test.go b/enumeration/remote/google_compute_scanner_test.go index 7ecb5f708..58bfe1d74 100644 --- a/enumeration/remote/google_compute_scanner_test.go +++ b/enumeration/remote/google_compute_scanner_test.go @@ -1487,7 +1487,7 @@ func TestGoogleComputeForwardingRule(t *testing.T) { repo := repository.NewAssetRepository(assetClient, realProvider.GetConfig(), cache.New(0)) - remoteLibrary.AddEnumerator(google.NewGoogleComputeForwardingEnumerator(repo, factory)) + remoteLibrary.AddEnumerator(google.NewGoogleComputeForwardingRuleEnumerator(repo, factory)) testFilter := &enumeration.MockFilter{} testFilter.On("IsTypeIgnored", mock.Anything).Return(false) From 21ec7c57205fc2ba67d2b0be224d0e38a7f55ed6 Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Tue, 17 Jan 2023 00:27:25 +0100 Subject: [PATCH 26/28] rm 'regions' --- .../test/google_compute_ssl_certificate/results.golden.json | 2 +- .../google/3.78.0/google_compute_ssl_certificate/expected.json | 2 +- .../google/3.78.0/google_compute_ssl_certificate/input.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/iac/terraform/state/test/google_compute_ssl_certificate/results.golden.json b/pkg/iac/terraform/state/test/google_compute_ssl_certificate/results.golden.json index 6ce1f42ed..d97f0b1ac 100755 --- a/pkg/iac/terraform/state/test/google_compute_ssl_certificate/results.golden.json +++ b/pkg/iac/terraform/state/test/google_compute_ssl_certificate/results.golden.json @@ -1,6 +1,6 @@ [ { - "Id": "projects/driftctl/regions/global/sslCertificates/my-certificate-6cb457f7", + "Id": "projects/driftctl/global/sslCertificates/my-certificate-6cb457f7", "Type": "google_compute_ssl_certificate", "Attrs": { "certificate": "-----BEGIN CERTIFICATE-----\nMIIDjjCCAnYCCQCtS+GNvuG/2zANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMC\nTkwxFjAUBgNVBAgMDU5vcnRoLUhvbGxhbmQxEjAQBgNVBAcMCUFtc3RlcmRhbTER\nMA8GA1UECgwIRHJpZnRDVEwxFDASBgNVBAMMC2V4YW1wbGUuY29tMSQwIgYJKoZI\nhvcNAQkBFhVkcmlmdGN0bEBkcmlmdGN0bC5jb20wHhcNMjMwMTExMTU1MDAyWhcN\nMjQwMTExMTU1MDAyWjCBiDELMAkGA1UEBhMCTkwxFjAUBgNVBAgMDU5vcnRoLUhv\nbGxhbmQxEjAQBgNVBAcMCUFtc3RlcmRhbTERMA8GA1UECgwIRHJpZnRDVEwxFDAS\nBgNVBAMMC2V4YW1wbGUuY29tMSQwIgYJKoZIhvcNAQkBFhVkcmlmdGN0bEBkcmlm\ndGN0bC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGJiRMDAzL\nbsUnOKc8+spzWSfm2N1Lox/uTL8NkqzNNKCr5FVlJVKZcOLusmAzPs0UWJqG5Dmb\nsddOofKyfanZ12v/ADnwUH++uJ5e/0cgmK30jnvINqMrLzs2awt5XwD2PW2ZbAih\n292slOuXJt/KV+VZtP3UoUfp2Gl9qJbFpI/p2qem8udNyp6Q6XSKL4yWO4jPubN/\noJLGRqtaXwPW2wgAWtWfGbTA5o4xbMKu86r1DPB9e2QgduBPLnYJTjZtEC6HkEOk\n/c1Ht9IE40xCu+TAC5FNyOQv6hrSDyJUfUUnPix5Sgyet0Me+u1kMQ3F1qbw/bWA\n4mHgIk/waZdbAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAENAaZXP5ECfGEw/rnRM\n5zfEudp+Y6H/ldGiaOr2E3t8qKOvDCbvV20dz1qvAbns3ol/dVByYRgQwc6GxWdz\nwhCDNUAj/22erTriAQbHfgPAa7Oi9LwBCmUmXqqA/KYOeWNXz9VrsUzCKlSIL7kX\noGuS1CmwNOSvE6AWpixS4epGUy4D721tIV90URhQGKvJmM3/KJe6ktiYxJ08mPLJ\n+8MkXUtZBAUhJUFYL+ZXBbh7lhg6yMDqkkDmraYumotMYwseuUz25PX9oglPyGB7\nmDwRDxz1VYpQ+TUtEwibv0FR6NXLOwZLorZVuZAxlzPJQNCHLAPQALd18CEVX6lq\nrmo=\n-----END CERTIFICATE-----\n", diff --git a/pkg/test/google/3.78.0/google_compute_ssl_certificate/expected.json b/pkg/test/google/3.78.0/google_compute_ssl_certificate/expected.json index efee76fad..2f1095d2c 100755 --- a/pkg/test/google/3.78.0/google_compute_ssl_certificate/expected.json +++ b/pkg/test/google/3.78.0/google_compute_ssl_certificate/expected.json @@ -1,6 +1,6 @@ [ { - "Id": "projects/driftctl/regions/global/sslCertificates/my-certificate-6cb457f7", + "Id": "projects/driftctl/global/sslCertificates/my-certificate-6cb457f7", "Type": "google_compute_ssl_certificate", "Attrs": { "certificate": "-----BEGIN CERTIFICATE-----\nMIIDjjCCAnYCCQCtS+GNvuG/2zANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMC\nTkwxFjAUBgNVBAgMDU5vcnRoLUhvbGxhbmQxEjAQBgNVBAcMCUFtc3RlcmRhbTER\nMA8GA1UECgwIRHJpZnRDVEwxFDASBgNVBAMMC2V4YW1wbGUuY29tMSQwIgYJKoZI\nhvcNAQkBFhVkcmlmdGN0bEBkcmlmdGN0bC5jb20wHhcNMjMwMTExMTU1MDAyWhcN\nMjQwMTExMTU1MDAyWjCBiDELMAkGA1UEBhMCTkwxFjAUBgNVBAgMDU5vcnRoLUhv\nbGxhbmQxEjAQBgNVBAcMCUFtc3RlcmRhbTERMA8GA1UECgwIRHJpZnRDVEwxFDAS\nBgNVBAMMC2V4YW1wbGUuY29tMSQwIgYJKoZIhvcNAQkBFhVkcmlmdGN0bEBkcmlm\ndGN0bC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGJiRMDAzL\nbsUnOKc8+spzWSfm2N1Lox/uTL8NkqzNNKCr5FVlJVKZcOLusmAzPs0UWJqG5Dmb\nsddOofKyfanZ12v/ADnwUH++uJ5e/0cgmK30jnvINqMrLzs2awt5XwD2PW2ZbAih\n292slOuXJt/KV+VZtP3UoUfp2Gl9qJbFpI/p2qem8udNyp6Q6XSKL4yWO4jPubN/\noJLGRqtaXwPW2wgAWtWfGbTA5o4xbMKu86r1DPB9e2QgduBPLnYJTjZtEC6HkEOk\n/c1Ht9IE40xCu+TAC5FNyOQv6hrSDyJUfUUnPix5Sgyet0Me+u1kMQ3F1qbw/bWA\n4mHgIk/waZdbAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAENAaZXP5ECfGEw/rnRM\n5zfEudp+Y6H/ldGiaOr2E3t8qKOvDCbvV20dz1qvAbns3ol/dVByYRgQwc6GxWdz\nwhCDNUAj/22erTriAQbHfgPAa7Oi9LwBCmUmXqqA/KYOeWNXz9VrsUzCKlSIL7kX\noGuS1CmwNOSvE6AWpixS4epGUy4D721tIV90URhQGKvJmM3/KJe6ktiYxJ08mPLJ\n+8MkXUtZBAUhJUFYL+ZXBbh7lhg6yMDqkkDmraYumotMYwseuUz25PX9oglPyGB7\nmDwRDxz1VYpQ+TUtEwibv0FR6NXLOwZLorZVuZAxlzPJQNCHLAPQALd18CEVX6lq\nrmo=\n-----END CERTIFICATE-----\n", diff --git a/pkg/test/google/3.78.0/google_compute_ssl_certificate/input.json b/pkg/test/google/3.78.0/google_compute_ssl_certificate/input.json index efee76fad..2f1095d2c 100755 --- a/pkg/test/google/3.78.0/google_compute_ssl_certificate/input.json +++ b/pkg/test/google/3.78.0/google_compute_ssl_certificate/input.json @@ -1,6 +1,6 @@ [ { - "Id": "projects/driftctl/regions/global/sslCertificates/my-certificate-6cb457f7", + "Id": "projects/driftctl/global/sslCertificates/my-certificate-6cb457f7", "Type": "google_compute_ssl_certificate", "Attrs": { "certificate": "-----BEGIN CERTIFICATE-----\nMIIDjjCCAnYCCQCtS+GNvuG/2zANBgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMC\nTkwxFjAUBgNVBAgMDU5vcnRoLUhvbGxhbmQxEjAQBgNVBAcMCUFtc3RlcmRhbTER\nMA8GA1UECgwIRHJpZnRDVEwxFDASBgNVBAMMC2V4YW1wbGUuY29tMSQwIgYJKoZI\nhvcNAQkBFhVkcmlmdGN0bEBkcmlmdGN0bC5jb20wHhcNMjMwMTExMTU1MDAyWhcN\nMjQwMTExMTU1MDAyWjCBiDELMAkGA1UEBhMCTkwxFjAUBgNVBAgMDU5vcnRoLUhv\nbGxhbmQxEjAQBgNVBAcMCUFtc3RlcmRhbTERMA8GA1UECgwIRHJpZnRDVEwxFDAS\nBgNVBAMMC2V4YW1wbGUuY29tMSQwIgYJKoZIhvcNAQkBFhVkcmlmdGN0bEBkcmlm\ndGN0bC5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGJiRMDAzL\nbsUnOKc8+spzWSfm2N1Lox/uTL8NkqzNNKCr5FVlJVKZcOLusmAzPs0UWJqG5Dmb\nsddOofKyfanZ12v/ADnwUH++uJ5e/0cgmK30jnvINqMrLzs2awt5XwD2PW2ZbAih\n292slOuXJt/KV+VZtP3UoUfp2Gl9qJbFpI/p2qem8udNyp6Q6XSKL4yWO4jPubN/\noJLGRqtaXwPW2wgAWtWfGbTA5o4xbMKu86r1DPB9e2QgduBPLnYJTjZtEC6HkEOk\n/c1Ht9IE40xCu+TAC5FNyOQv6hrSDyJUfUUnPix5Sgyet0Me+u1kMQ3F1qbw/bWA\n4mHgIk/waZdbAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAENAaZXP5ECfGEw/rnRM\n5zfEudp+Y6H/ldGiaOr2E3t8qKOvDCbvV20dz1qvAbns3ol/dVByYRgQwc6GxWdz\nwhCDNUAj/22erTriAQbHfgPAa7Oi9LwBCmUmXqqA/KYOeWNXz9VrsUzCKlSIL7kX\noGuS1CmwNOSvE6AWpixS4epGUy4D721tIV90URhQGKvJmM3/KJe6ktiYxJ08mPLJ\n+8MkXUtZBAUhJUFYL+ZXBbh7lhg6yMDqkkDmraYumotMYwseuUz25PX9oglPyGB7\nmDwRDxz1VYpQ+TUtEwibv0FR6NXLOwZLorZVuZAxlzPJQNCHLAPQALd18CEVX6lq\nrmo=\n-----END CERTIFICATE-----\n", From f0e5d9c319db4dfef6ef8d44e045e1fb6e31b8cc Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Tue, 31 Jan 2023 16:35:19 +0100 Subject: [PATCH 27/28] remove timeouts and name prefix --- .../test/google_compute_ssl_certificate/results.golden.json | 4 +--- .../3.78.0/google_compute_ssl_certificate/expected.json | 2 -- .../google/3.78.0/google_compute_ssl_certificate/input.json | 2 -- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/pkg/iac/terraform/state/test/google_compute_ssl_certificate/results.golden.json b/pkg/iac/terraform/state/test/google_compute_ssl_certificate/results.golden.json index d97f0b1ac..b53ffab0d 100755 --- a/pkg/iac/terraform/state/test/google_compute_ssl_certificate/results.golden.json +++ b/pkg/iac/terraform/state/test/google_compute_ssl_certificate/results.golden.json @@ -9,11 +9,9 @@ "description": "", "id": "projects/driftctl/global/sslCertificates/my-certificate-6cb457f7", "name": "my-certificate-6cb457f7", - "name_prefix": null, "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAxiYkTAwMy27FJzinPPrKc1kn5tjdS6Mf7ky/DZKszTSgq+RV\nZSVSmXDi7rJgMz7NFFiahuQ5m7HXTqHysn2p2ddr/wA58FB/vrieXv9HIJit9I57\nyDajKy87NmsLeV8A9j1tmWwIodvdrJTrlybfylflWbT91KFH6dhpfaiWxaSP6dqn\npvLnTcqekOl0ii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/Oi4nvsccqnadsj3J/J7D3\nOl7SqmNcAs/kwumKRSptNmBgMUfbNIra7drXPdKprI4/hcdrKba1gYftPuYikX4k\nBDUW7Pwb3V2+fZPeSfcA7JlSoiLffv8PA9sBoyYuDEwgFmvKWgUGHLian4geA0wx\nfudBAoGBAKQZb9n3PvJfwSUhXqw+zv9PF+Av9GpPq7iGtg1JV3B2u++I/E8+Orrg\nT2K9DJL+VocN7WPcxxNLlB1CsD7/Kqwbc7P7q9NBpCrZ8SurhOv3YcFSfG+qTDAn\n+b83SrGV7SObUg8NS/vAu9LfYAyz3PllfteXaIvV/e9DMumXFKD1\n-----END RSA PRIVATE KEY-----\n", "project": "driftctl", "self_link": "https://www.googleapis.com/compute/v1/projects/driftctl/global/sslCertificates/my-certificate-6cb457f7", - "timeouts": null } } -] \ No newline at end of file +] diff --git a/pkg/test/google/3.78.0/google_compute_ssl_certificate/expected.json b/pkg/test/google/3.78.0/google_compute_ssl_certificate/expected.json index 2f1095d2c..d358d2f31 100755 --- a/pkg/test/google/3.78.0/google_compute_ssl_certificate/expected.json +++ b/pkg/test/google/3.78.0/google_compute_ssl_certificate/expected.json @@ -9,11 +9,9 @@ "description": "", "id": "projects/driftctl/global/sslCertificates/my-certificate-6cb457f7", "name": "my-certificate-6cb457f7", - "name_prefix": null, "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAxiYkTAwMy27FJzinPPrKc1kn5tjdS6Mf7ky/DZKszTSgq+RV\nZSVSmXDi7rJgMz7NFFiahuQ5m7HXTqHysn2p2ddr/wA58FB/vrieXv9HIJit9I57\nyDajKy87NmsLeV8A9j1tmWwIodvdrJTrlybfylflWbT91KFH6dhpfaiWxaSP6dqn\npvLnTcqekOl0ii+MljuIz7mzf6CSxkarWl8D1tsIAFrVnxm0wOaOMWzCrvOq9Qzw\nfXtkIHbgTy52CU42bRAuh5BDpP3NR7fSBONMQrvkwAuRTcjkL+oa0g8iVH1FJz4s\neUoMnrdDHvrtZDENx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WgUGHLian4geA0wx\nfudBAoGBAKQZb9n3PvJfwSUhXqw+zv9PF+Av9GpPq7iGtg1JV3B2u++I/E8+Orrg\nT2K9DJL+VocN7WPcxxNLlB1CsD7/Kqwbc7P7q9NBpCrZ8SurhOv3YcFSfG+qTDAn\n+b83SrGV7SObUg8NS/vAu9LfYAyz3PllfteXaIvV/e9DMumXFKD1\n-----END RSA PRIVATE KEY-----\n", "project": "driftctl", "self_link": "https://www.googleapis.com/compute/v1/projects/driftctl/global/sslCertificates/my-certificate-6cb457f7", - "timeouts": null } } ] diff --git a/pkg/test/google/3.78.0/google_compute_ssl_certificate/input.json b/pkg/test/google/3.78.0/google_compute_ssl_certificate/input.json index 2f1095d2c..d358d2f31 100755 --- a/pkg/test/google/3.78.0/google_compute_ssl_certificate/input.json +++ b/pkg/test/google/3.78.0/google_compute_ssl_certificate/input.json @@ -9,11 +9,9 @@ "description": "", "id": "projects/driftctl/global/sslCertificates/my-certificate-6cb457f7", "name": "my-certificate-6cb457f7", - "name_prefix": null, "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAxiYkTAwMy27FJzinPPrKc1kn5tjdS6Mf7ky/DZKszTSgq+RV\nZSVSmXDi7rJgMz7NFFiahuQ5m7HXTqHysn2p2ddr/wA58FB/vrieXv9HIJit9I57\nyDajKy87NmsLeV8A9j1tmWwIodvdrJTrlybfylflWbT91KFH6dhpfaiWxaSP6dqn\npvLnTcqekOl0ii+MljuIz7mzf6CSxkarWl8D1tsIAFrVnxm0wOaOMWzCrvOq9Qzw\nfXtkIHbgTy52CU42bRAuh5BDpP3NR7fSBONMQrvkwAuRTcjkL+oa0g8iVH1FJz4s\neUoMnrdDHvrtZDENxdam8P21gOJh4CJP8GmXWwIDAQABAoIBAGvNPnwdJizbY+mV\nue7EJragr8O5ApRu+CVGnb69qMOvuSYrgIYZyxltwBjK9OmMZjiGh/ORYQIivBes\npgSTt3+r4raGIf9rXESf3pGiYskKJ8HgbtmbWCRbeuR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n+b83SrGV7SObUg8NS/vAu9LfYAyz3PllfteXaIvV/e9DMumXFKD1\n-----END RSA PRIVATE KEY-----\n", "project": "driftctl", "self_link": "https://www.googleapis.com/compute/v1/projects/driftctl/global/sslCertificates/my-certificate-6cb457f7", - "timeouts": null } } ] From 1e44cef401e06ba93d6951cb781f1b89f8a12288 Mon Sep 17 00:00:00 2001 From: Bruno Schaatsbergen Date: Tue, 31 Jan 2023 16:38:49 +0100 Subject: [PATCH 28/28] fix trailing comma --- .../test/google_compute_ssl_certificate/results.golden.json | 2 +- .../google/3.78.0/google_compute_ssl_certificate/expected.json | 2 +- .../google/3.78.0/google_compute_ssl_certificate/input.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/iac/terraform/state/test/google_compute_ssl_certificate/results.golden.json b/pkg/iac/terraform/state/test/google_compute_ssl_certificate/results.golden.json index b53ffab0d..5d9b26854 100755 --- a/pkg/iac/terraform/state/test/google_compute_ssl_certificate/results.golden.json +++ b/pkg/iac/terraform/state/test/google_compute_ssl_certificate/results.golden.json @@ -11,7 +11,7 @@ "name": "my-certificate-6cb457f7", "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAxiYkTAwMy27FJzinPPrKc1kn5tjdS6Mf7ky/DZKszTSgq+RV\nZSVSmXDi7rJgMz7NFFiahuQ5m7HXTqHysn2p2ddr/wA58FB/vrieXv9HIJit9I57\nyDajKy87NmsLeV8A9j1tmWwIodvdrJTrlybfylflWbT91KFH6dhpfaiWxaSP6dqn\npvLnTcqekOl0ii+MljuIz7mzf6CSxkarWl8D1tsIAFrVnxm0wOaOMWzCrvOq9Qzw\nfXtkIHbgTy52CU42bRAuh5BDpP3NR7fSBONMQrvkwAuRTcjkL+oa0g8iVH1FJz4s\neUoMnrdDHvrtZDENxdam8P21gOJh4CJP8GmXWwIDAQABAoIBAGvNPnwdJizbY+mV\nue7EJragr8O5ApRu+CVGnb69qMOvuSYrgIYZyxltwBjK9OmMZjiG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PcxxNLlB1CsD7/Kqwbc7P7q9NBpCrZ8SurhOv3YcFSfG+qTDAn\n+b83SrGV7SObUg8NS/vAu9LfYAyz3PllfteXaIvV/e9DMumXFKD1\n-----END RSA PRIVATE KEY-----\n", "project": "driftctl", - "self_link": "https://www.googleapis.com/compute/v1/projects/driftctl/global/sslCertificates/my-certificate-6cb457f7", + "self_link": "https://www.googleapis.com/compute/v1/projects/driftctl/global/sslCertificates/my-certificate-6cb457f7" } } ] diff --git a/pkg/test/google/3.78.0/google_compute_ssl_certificate/expected.json b/pkg/test/google/3.78.0/google_compute_ssl_certificate/expected.json index d358d2f31..fc372a26c 100755 --- a/pkg/test/google/3.78.0/google_compute_ssl_certificate/expected.json +++ b/pkg/test/google/3.78.0/google_compute_ssl_certificate/expected.json @@ -11,7 +11,7 @@ "name": "my-certificate-6cb457f7", "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAxiYkTAwMy27FJzinPPrKc1kn5tjdS6Mf7ky/DZKszTSgq+RV\nZSVSmXDi7rJgMz7NFFiahuQ5m7HXTqHysn2p2ddr/wA58FB/vrieXv9HIJit9I57\nyDajKy87NmsLeV8A9j1tmWwIodvdrJTrlybfylflWbT91KFH6dhpfaiWxaSP6dqn\npvLnTcqekOl0ii+MljuIz7mzf6CSxkarWl8D1tsIAFrVnxm0wOaOMWzCrvOq9Qzw\nfXtkIHbgTy52CU42bRAuh5BDpP3NR7fSBONMQrvkwAuRTcjkL+oa0g8iVH1FJz4s\neUoMnrdDHvrtZDENxdam8P21gOJh4CJP8GmXWwIDAQABAoIBAGvNPnwdJizbY+mV\nue7EJragr8O5ApRu+CVGnb69qMOvuSYrgIYZyxltwBjK9OmMZjiGh/ORYQIivBes\npgSTt3+r4raGIf9rXESf3pGiYskKJ8HgbtmbWCRbeuR9Um3C0RwmiWUp0Hx2yOBm\n2NGQNbq5HS8z99DhueUwdxwFR5nYmvxwwZLvtNXNa6cS2DHRcKql8T6eEmTApi9n\nnx5MQZaeSZNoU4l8Cx0SW0DyHqNuWmmPHL8ICpYxlrrUB3+c4cdj6KKcjBniLZ7l\njP/FBzNbGUZa5JGAC52BcLbTLEIkxidIw4g2CwM1Ihdt+kSuimaV7w5bIpLdvp3G\nfRFacRECgYEA9SVAi9d6fcR279t7LgTs+s+QkcyR7dHyKdBMTjP5F13r3fGpLUMo\n0oMk58ZqTfvWCR/bkQcj1KilauNjagUvy93Un530stWRWZp7DdSX0YhI7LlTfZwR\nIh3V/Zzkd7dqkdEI7pTqD3BT8T7l/mG6fJC7ETCAwAglIWjZpdbtcfMCgYEAzuwt\n9u/DfLQCeWxJDYddys41pVKG70tlI65yIrERgp6ojjoEr8cA9I5vDqALg0Gv/R5w\nSdBUWLgvVi94HdUAX2Zjae6ljD2gTw0o6/wRYwvS+zt/V33JyTmcXacZMnZosTm2\nIxFul2HspAuieTm6db5MmtcjryxMsFNKR/OBtvkCgYA12G/cB4FtPIkPWDsvOX+/\n+3V6wN9QyGuTiaApETtmSYf0YQ9S1MyTqKCjlC5nYKh7qpa0vUe+fyiOWNHOSMNd\n2STJxo0n9scNUmQy/n42VOQHsxFGptAQmVMWeK6qKQxsaOi4VtcuevLFK5ajEF5A\n3B1qwieVhnR5aSldRt8yxwKBgCBoLOq3sk4dgyWxJ9/Oi4nvsccqnadsj3J/J7D3\nOl7SqmNcAs/kwumKRSptNmBgMUfbNIra7drXPdKprI4/hcdrKba1gYftPuYikX4k\nBDUW7Pwb3V2+fZPeSfcA7JlSoiLffv8PA9sBoyYuDEwgFmvKWgUGHLian4geA0wx\nfudBAoGBAKQZb9n3PvJfwSUhXqw+zv9PF+Av9GpPq7iGtg1JV3B2u++I/E8+Orrg\nT2K9DJL+VocN7WPcxxNLlB1CsD7/Kqwbc7P7q9NBpCrZ8SurhOv3YcFSfG+qTDAn\n+b83SrGV7SObUg8NS/vAu9LfYAyz3PllfteXaIvV/e9DMumXFKD1\n-----END RSA PRIVATE KEY-----\n", "project": "driftctl", - "self_link": "https://www.googleapis.com/compute/v1/projects/driftctl/global/sslCertificates/my-certificate-6cb457f7", + "self_link": "https://www.googleapis.com/compute/v1/projects/driftctl/global/sslCertificates/my-certificate-6cb457f7" } } ] diff --git a/pkg/test/google/3.78.0/google_compute_ssl_certificate/input.json b/pkg/test/google/3.78.0/google_compute_ssl_certificate/input.json index d358d2f31..fc372a26c 100755 --- a/pkg/test/google/3.78.0/google_compute_ssl_certificate/input.json +++ b/pkg/test/google/3.78.0/google_compute_ssl_certificate/input.json @@ -11,7 +11,7 @@ "name": "my-certificate-6cb457f7", "private_key": "-----BEGIN RSA PRIVATE KEY-----\nMIIEowIBAAKCAQEAxiYkTAwMy27FJzinPPrKc1kn5tjdS6Mf7ky/DZKszTSgq+RV\nZSVSmXDi7rJgMz7NFFiahuQ5m7HXTqHysn2p2ddr/wA58FB/vrieXv9HIJit9I57\nyDajKy87NmsLeV8A9j1tmWwIodvdrJTrlybfylflWbT91KFH6dhpfaiWxaSP6dqn\npvLnTcqekOl0ii+MljuIz7mzf6CSxkarWl8D1tsIAFrVnxm0wOaOMWzCrvOq9Qzw\nfXtkIHbgTy52CU42bRAuh5BDpP3NR7fSBONMQrvkwAuRTcjkL+oa0g8iVH1FJz4s\neUoMnrdDHvrtZDENxdam8P21gOJh4CJP8GmXWwIDAQABAoIBAGvNPnwdJizbY+mV\nue7EJragr8O5ApRu+CVGnb69qMOvuSYrgIYZyxltwBjK9OmMZjiGh/ORYQIivBes\npgSTt3+r4raGIf9rXESf3pGiYskKJ8HgbtmbWCRbeuR9Um3C0RwmiWUp0Hx2yOBm\n2NGQNbq5HS8z99DhueUwdxwFR5nYmvxwwZLvtNXNa6cS2DHRcKql8T6eEmTApi9n\nnx5MQZaeSZNoU4l8Cx0SW0DyHqNuWmmPHL8ICpYxlrrUB3+c4cdj6KKcjBniLZ7l\njP/FBzNbGUZa5JGAC52BcLbTLEIkxidIw4g2CwM1Ihdt+kSuimaV7w5bIpLdvp3G\nfRFacRECgYEA9SVAi9d6fcR279t7LgTs+s+QkcyR7dHyKdBMTjP5F13r3fGpLUMo\n0oMk58ZqTfvWCR/bkQcj1KilauNjagUvy93Un530stWRWZp7DdSX0YhI7LlTfZwR\nIh3V/Zzkd7dqkdEI7pTqD3BT8T7l/mG6fJC7ETCAwAglIWjZpdbtcfMCgYEAzuwt\n9u/DfLQCeWxJDYddys41pVKG70tlI65yIrERgp6ojjoEr8cA9I5vDqALg0Gv/R5w\nSdBUWLgvVi94HdUAX2Zjae6ljD2gTw0o6/wRYwvS+zt/V33JyTmcXacZMnZosTm2\nIxFul2HspAuieTm6db5MmtcjryxMsFNKR/OBtvkCgYA12G/cB4FtPIkPWDsvOX+/\n+3V6wN9QyGuTiaApETtmSYf0YQ9S1MyTqKCjlC5nYKh7qpa0vUe+fyiOWNHOSMNd\n2STJxo0n9scNUmQy/n42VOQHsxFGptAQmVMWeK6qKQxsaOi4VtcuevLFK5ajEF5A\n3B1qwieVhnR5aSldRt8yxwKBgCBoLOq3sk4dgyWxJ9/Oi4nvsccqnadsj3J/J7D3\nOl7SqmNcAs/kwumKRSptNmBgMUfbNIra7drXPdKprI4/hcdrKba1gYftPuYikX4k\nBDUW7Pwb3V2+fZPeSfcA7JlSoiLffv8PA9sBoyYuDEwgFmvKWgUGHLian4geA0wx\nfudBAoGBAKQZb9n3PvJfwSUhXqw+zv9PF+Av9GpPq7iGtg1JV3B2u++I/E8+Orrg\nT2K9DJL+VocN7WPcxxNLlB1CsD7/Kqwbc7P7q9NBpCrZ8SurhOv3YcFSfG+qTDAn\n+b83SrGV7SObUg8NS/vAu9LfYAyz3PllfteXaIvV/e9DMumXFKD1\n-----END RSA PRIVATE KEY-----\n", "project": "driftctl", - "self_link": "https://www.googleapis.com/compute/v1/projects/driftctl/global/sslCertificates/my-certificate-6cb457f7", + "self_link": "https://www.googleapis.com/compute/v1/projects/driftctl/global/sslCertificates/my-certificate-6cb457f7" } } ]