From 718da8a087425ef461251f12b629737b8ab3cfa9 Mon Sep 17 00:00:00 2001 From: yossi gilad Date: Wed, 18 Jan 2023 15:00:48 +0200 Subject: [PATCH 1/2] bug: fixing gorequest crashing --- aquasec/resource_permission_set_test.go | 2 ++ client/acknowledge.go | 10 ++++------ client/application_scope.go | 9 +++------ client/assurance_policy.go | 12 ++++-------- client/enforcers.go | 15 +++++---------- client/firewall_policy.go | 14 +++++--------- client/gateway.go | 8 +++----- client/image.go | 19 +++++++------------ client/labels.go | 15 +++++---------- client/notifications.go | 18 +++++++----------- client/permission_sets.go | 17 ++++++----------- client/registries.go | 15 +++++---------- client/runtime_policy.go | 12 ++++-------- client/service.go | 15 +++++---------- client/sso.go | 19 ++++++++----------- client/vulnerabilities.go | 3 +-- 16 files changed, 74 insertions(+), 129 deletions(-) diff --git a/aquasec/resource_permission_set_test.go b/aquasec/resource_permission_set_test.go index 17f42a8..ac9bab3 100644 --- a/aquasec/resource_permission_set_test.go +++ b/aquasec/resource_permission_set_test.go @@ -20,6 +20,8 @@ func TestAquasecPermissionSetManagement(t *testing.T) { actions := "risks.vulnerabilities.read,images.read" if isSaasEnv() { + // todo: remove this after solving the following issue: https://scalock.atlassian.net/browse/SLK-62403 + t.Skip("Skipping user test because its saas env") author = os.Getenv("AQUA_USER") } diff --git a/client/acknowledge.go b/client/acknowledge.go index 1c01a58..0b27760 100644 --- a/client/acknowledge.go +++ b/client/acknowledge.go @@ -54,13 +54,12 @@ func (cli *Client) AcknowledgeCreate(acknowledgePost AcknowledgePost) error { } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v2/risks/acknowledge") err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, data, errs := request.Clone().Post(cli.url + apiPath).Send(string(payload)).End() + resp, data, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Post(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(err, "failed creating security acknowledges") } @@ -77,13 +76,13 @@ func (cli *Client) AcknowledgeRead() (*AcknowledgeList, error) { var response AcknowledgeList request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) + apiPath := fmt.Sprintf("/api/v2/risks/acknowledge?order_by=date") err = cli.limiter.Wait(context.Background()) if err != nil { return nil, err } - events, body, errs := request.Clone().Get(cli.url + apiPath).End() + events, body, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Get(cli.url + apiPath).End() if errs != nil { err = fmt.Errorf("error calling %s", apiPath) return nil, err @@ -105,13 +104,12 @@ func (cli *Client) AcknowledgeDelete(acknowledgePost AcknowledgePost) error { return err } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v2/risks/acknowledge/multiple") err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, data, errs := request.Clone().Delete(cli.url + apiPath).Send(string(payload)).End() + resp, data, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Delete(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(err, "failed deleting security acknowledges") } diff --git a/client/application_scope.go b/client/application_scope.go index 4f10722..9588945 100644 --- a/client/application_scope.go +++ b/client/application_scope.go @@ -100,13 +100,12 @@ func (cli *Client) CreateApplicationScope(applicationscope *ApplicationScope) er return err } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v2/access_management/scopes") err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, _, errs := request.Clone().Post(cli.url + apiPath).Send(string(payload)).End() + resp, _, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Post(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed creating Application Scope.") } @@ -134,13 +133,12 @@ func (cli *Client) UpdateApplicationScope(applicationscope *ApplicationScope, na return err } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v2/access_management/scopes/%s", name) err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, _, errs := request.Clone().Put(cli.url + apiPath).Send(string(payload)).End() + resp, _, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Put(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed modifying Application Scope") } @@ -164,13 +162,12 @@ func (cli *Client) UpdateApplicationScope(applicationscope *ApplicationScope, na // DeleteApplicationScope removes a Application Scope func (cli *Client) DeleteApplicationScope(name string) error { request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v2/access_management/scopes/%s", name) err := cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, _, errs := request.Clone().Delete(cli.url + apiPath).End() + resp, _, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Delete(cli.url + apiPath).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed deleting Application Scope") } diff --git a/client/assurance_policy.go b/client/assurance_policy.go index d0f7e65..47605cf 100644 --- a/client/assurance_policy.go +++ b/client/assurance_policy.go @@ -149,7 +149,6 @@ type ScanTimeAuto struct { func (cli *Client) GetAssurancePolicy(name string, at string) (*AssurancePolicy, error) { var err error var response AssurancePolicy - cli.gorequest.Set("Authorization", "Bearer "+cli.token) var atype string if strings.EqualFold(at, "host") { atype = "host" @@ -165,7 +164,7 @@ func (cli *Client) GetAssurancePolicy(name string, at string) (*AssurancePolicy, if err != nil { return nil, err } - resp, body, errs := cli.gorequest.Clone().Get(cli.url + apiPath).End() + resp, body, errs := cli.gorequest.Clone().Set("Authorization", "Bearer "+cli.token).Get(cli.url + apiPath).End() if errs != nil { return nil, errors.Wrap(getMergedError(errs), "failed getting Assurance Policy") } @@ -214,12 +213,11 @@ func (cli *Client) CreateAssurancePolicy(assurancepolicy *AssurancePolicy, at st return err } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, _, errs := request.Clone().Post(cli.url + apiPath).Send(string(payload)).End() + resp, _, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Post(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed creating Assurance Policy.") } @@ -258,12 +256,11 @@ func (cli *Client) UpdateAssurancePolicy(assurancepolicy *AssurancePolicy, at st } apiPath := "/api/v2/assurance_policy/" + atype + "/" + assurancepolicy.Name request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, _, errs := request.Clone().Put(cli.url + apiPath).Send(string(payload)).End() + resp, _, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Put(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed modifying Assurance Policy") } @@ -287,7 +284,6 @@ func (cli *Client) UpdateAssurancePolicy(assurancepolicy *AssurancePolicy, at st // DeleteAssurancePolicy removes a Assurance Policy func (cli *Client) DeleteAssurancePolicy(name string, at string) error { request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) var atype string if strings.EqualFold(at, "host") { atype = "host" @@ -303,7 +299,7 @@ func (cli *Client) DeleteAssurancePolicy(name string, at string) error { if err != nil { return err } - resp, _, errs := request.Clone().Delete(cli.url + apiPath).End() + resp, _, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Delete(cli.url + apiPath).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed deleting Assurance Policy") } diff --git a/client/enforcers.go b/client/enforcers.go index 8bcd9ec..1895264 100644 --- a/client/enforcers.go +++ b/client/enforcers.go @@ -97,13 +97,12 @@ func (cli *Client) GetEnforcerGroup(name string) (*EnforcerGroup, error) { var err error var response EnforcerGroup request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v1/hostsbatch/%s", name) err = cli.limiter.Wait(context.Background()) if err != nil { return nil, err } - events, body, errs := request.Clone().Get(cli.url + apiPath).End() + events, body, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Get(cli.url + apiPath).End() if errs != nil { err = fmt.Errorf("error calling %s", apiPath) @@ -128,13 +127,12 @@ func (cli *Client) GetEnforcerGroups() ([]EnforcerGroup, error) { var err error var response []EnforcerGroup request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v1/hostsbatch") err = cli.limiter.Wait(context.Background()) if err != nil { return nil, err } - events, body, errs := request.Clone().Get(cli.url + apiPath).End() + events, body, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Get(cli.url + apiPath).End() if errs != nil { err = fmt.Errorf("error calling %s", apiPath) return nil, err @@ -156,13 +154,12 @@ func (cli *Client) CreateEnforcerGroup(group EnforcerGroup) error { return err } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v1/hostsbatch") err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, data, errs := request.Clone().Post(cli.url + apiPath).Send(string(payload)).End() + resp, data, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Post(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(err, "failed creating enforcer group") } @@ -183,13 +180,12 @@ func (cli *Client) UpdateEnforcerGroup(group EnforcerGroup) error { return err } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := "/api/v1/hostsbatch" err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, _, errs := request.Clone().Put(cli.url+apiPath).Send(string(payload)).Param("update_enforcers", "true").End() + resp, _, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Put(cli.url+apiPath).Send(string(payload)).Param("update_enforcers", "true").End() //resp, _, errs := request.Clone().Put(cli.url + apiPath).Send(string(payload)).End() if errs != nil { @@ -204,13 +200,12 @@ func (cli *Client) UpdateEnforcerGroup(group EnforcerGroup) error { // DeleteEnforcerGroup removes an enforcer group func (cli *Client) DeleteEnforcerGroup(name string) error { request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v1/hostsbatch/%s?delete_related=true", name) err := cli.limiter.Wait(context.Background()) if err != nil { return err } - events, _, errs := request.Clone().Delete(cli.url + apiPath).End() + events, _, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Delete(cli.url + apiPath).End() if errs != nil { return fmt.Errorf("error while calling DELETE on /api/v1/hostsbatch/%s: %v", name, events.StatusCode) } diff --git a/client/firewall_policy.go b/client/firewall_policy.go index a4abc4a..8f48fd3 100644 --- a/client/firewall_policy.go +++ b/client/firewall_policy.go @@ -68,13 +68,12 @@ func (cli *Client) GetFirewallPolicies() (*FirewallPolicyList, error) { func (cli *Client) GetFirewallPolicy(name string) (*FirewallPolicy, error) { var err error var response FirewallPolicy - cli.gorequest.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v2/firewall_policies/%s", name) err = cli.limiter.Wait(context.Background()) if err != nil { return nil, err } - resp, body, errs := cli.gorequest.Clone().Get(cli.url + apiPath).End() + resp, body, errs := cli.gorequest.Clone().Set("Authorization", "Bearer "+cli.token).Get(cli.url + apiPath).End() if errs != nil { return nil, errors.Wrap(getMergedError(errs), "failed getting firewall policy") } @@ -112,13 +111,12 @@ func (cli *Client) CreateFirewallPolicy(firewallPolicy FirewallPolicy) error { return err } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) - apiPath := fmt.Sprintf("/api/v2/firewall_policies") + apiPath := "/api/v2/firewall_policies" err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, _, errs := request.Clone().Post(cli.url + apiPath).Send(string(payload)).End() + resp, _, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Post(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed creating firewall policy.") } @@ -146,13 +144,12 @@ func (cli *Client) UpdateFirewallPolicy(firewallPolicy FirewallPolicy) error { return err } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v2/firewall_policies/%s", firewallPolicy.Name) err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, _, errs := request.Clone().Put(cli.url + apiPath).Send(string(payload)).End() + resp, _, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Put(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed modifying firewall policy") } @@ -176,13 +173,12 @@ func (cli *Client) UpdateFirewallPolicy(firewallPolicy FirewallPolicy) error { // DeleteFirewallPolicy removes a Firewall Policy func (cli *Client) DeleteFirewallPolicy(name string) error { request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v2/firewall_policies/%s", name) err := cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, _, errs := request.Clone().Delete(cli.url + apiPath).End() + resp, _, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Delete(cli.url + apiPath).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed deleting firewall policy") } diff --git a/client/gateway.go b/client/gateway.go index f7eb5fe..8bfcb55 100644 --- a/client/gateway.go +++ b/client/gateway.go @@ -25,13 +25,12 @@ type Gateway struct { func (cli *Client) GetGateway(name string) (*Gateway, error) { var err error var response Gateway - cli.gorequest.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v1/servers/%s", name) err = cli.limiter.Wait(context.Background()) if err != nil { return nil, err } - events, body, errs := cli.gorequest.Clone().Get(cli.url + apiPath).End() + events, body, errs := cli.gorequest.Clone().Set("Authorization", "Bearer "+cli.token).Get(cli.url + apiPath).End() if errs != nil { log.Println(events.StatusCode) err = fmt.Errorf("error calling %s", apiPath) @@ -56,13 +55,12 @@ func (cli *Client) GetGateways() ([]Gateway, error) { var err error var response []Gateway request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) - apiPath := fmt.Sprintf("/api/v1/servers") + apiPath := "/api/v1/servers" err = cli.limiter.Wait(context.Background()) if err != nil { return nil, err } - events, body, errs := request.Clone().Get(cli.url + apiPath).End() + events, body, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Get(cli.url + apiPath).End() if errs != nil { err = fmt.Errorf("error calling %s", apiPath) return nil, err diff --git a/client/image.go b/client/image.go index 16d53e8..0d0fe53 100644 --- a/client/image.go +++ b/client/image.go @@ -111,13 +111,12 @@ func (cli *Client) CreateImage(image *Image) error { } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) - apiPath := fmt.Sprintf("/api/v1/images") + apiPath := "/api/v1/images" err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, body, errs := request.Clone().Post(cli.url + apiPath).Send(string(payload)).End() + resp, body, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Post(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed creating image.") } @@ -141,12 +140,11 @@ func (cli *Client) GetImage(imageUrl string) (*Image, error) { var response Image request := cli.gorequest apiPath := fmt.Sprintf("/api/v2/images/%v", imageUrl) - request.Set("Authorization", "Bearer "+cli.token) err = cli.limiter.Wait(context.Background()) if err != nil { return nil, err } - events, body, errs := request.Clone().Get(cli.url + apiPath).End() + events, body, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Get(cli.url + apiPath).End() if errs != nil { return nil, errors.Wrap(getMergedError(errs), fmt.Sprintf("failed getting image with name %v", imageUrl)) } @@ -191,13 +189,12 @@ func (cli *Client) RescanImage(image *Image, fullRescan bool) error { } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) - apiPath := fmt.Sprintf("/api/v1/images/rescan") + apiPath := "/api/v1/images/rescan" err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, _, errs := request.Clone().Post(cli.url + apiPath).Send(string(payload)).End() + resp, _, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Post(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed rescaning image") } @@ -243,13 +240,12 @@ func (cli *Client) DeleteImage(image *Image) error { tag := image.Tag request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v2/images/%v/%v/%v", registry, repo, tag) err := cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, body, errs := request.Clone().Delete(cli.url + apiPath).End() + resp, body, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Delete(cli.url + apiPath).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed deleting image") } @@ -290,12 +286,11 @@ func (cli *Client) ChangeImagePermission(image *Image, allow bool, permissionMod } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, body, errs := request.Clone().Post(cli.url + apiPath).Send(string(payload)).End() + resp, body, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Post(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed blocking image") } diff --git a/client/labels.go b/client/labels.go index 3e01898..03af088 100644 --- a/client/labels.go +++ b/client/labels.go @@ -25,13 +25,12 @@ type AquaLabels struct { func (cli *Client) GetAquaLabel(name string) (*AquaLabel, error) { var err error var response AquaLabel - cli.gorequest.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v1/settings/labels/%s", name) err = cli.limiter.Wait(context.Background()) if err != nil { return nil, err } - resp, body, errs := cli.gorequest.Clone().Get(cli.url + apiPath).End() + resp, body, errs := cli.gorequest.Clone().Set("Authorization", "Bearer "+cli.token).Get(cli.url + apiPath).End() if errs != nil { return nil, errors.Wrap(getMergedError(errs), "failed getting Aqua label") } @@ -65,13 +64,12 @@ func (cli *Client) GetAquaLabel(name string) (*AquaLabel, error) { func (cli *Client) GetAquaLabels() (*AquaLabels, error) { var err error var response AquaLabels - cli.gorequest.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v2/settings/labels") err = cli.limiter.Wait(context.Background()) if err != nil { return nil, err } - resp, body, errs := cli.gorequest.Clone().Get(cli.url + apiPath).End() + resp, body, errs := cli.gorequest.Clone().Set("Authorization", "Bearer "+cli.token).Get(cli.url + apiPath).End() if errs != nil { return nil, errors.Wrap(getMergedError(errs), "failed getting Aqua labels") } @@ -107,13 +105,12 @@ func (cli *Client) CreateAquaLabel(aquaLabel *AquaLabel) error { return err } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v1/settings/labels") err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, _, errs := request.Clone().Post(cli.url + apiPath).Send(string(payload)).End() + resp, _, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Post(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed creating Aqua label.") } @@ -141,13 +138,12 @@ func (cli *Client) UpdateAquaLabel(aquaLabel *AquaLabel) error { return err } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v1/settings/labels/%s", aquaLabel.Name) err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, _, errs := request.Clone().Put(cli.url + apiPath).Send(string(payload)).End() + resp, _, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Put(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed modifying Aqua label") } @@ -171,13 +167,12 @@ func (cli *Client) UpdateAquaLabel(aquaLabel *AquaLabel) error { // DeleteAquaLabel removes a Aqua label func (cli *Client) DeleteAquaLabel(name string) error { request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v1/settings/labels/%s", name) err := cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, _, errs := request.Clone().Delete(cli.url + apiPath).End() + resp, _, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Delete(cli.url + apiPath).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed deleting Aqua label") } diff --git a/client/notifications.go b/client/notifications.go index 0a07d91..ddb9f36 100644 --- a/client/notifications.go +++ b/client/notifications.go @@ -29,13 +29,12 @@ func (cli *Client) SlackNotificationCreate(notf Notification) error { return err } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v1/settings/notifiers/Slack") err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, data, errs := request.Clone().Put(cli.url + apiPath).Send(string(payload)).End() + resp, data, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Put(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(err, "failed creating Slack notification") } @@ -53,13 +52,12 @@ func (cli *Client) SlackNotificationUpdate(notf Notification) error { return err } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) - apiPath := fmt.Sprintf("/api/v1/settings/notifiers/Slack") + apiPath := "/api/v1/settings/notifiers/Slack" err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, data, errs := request.Clone().Put(cli.url + apiPath).Send(string(payload)).End() + resp, data, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Put(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(err, "failed creating Slack notification") } @@ -75,13 +73,12 @@ func (cli *Client) SlackNotificationRead() (*Notification, error) { var response Notification request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) - apiPath := fmt.Sprintf("/api/v1/settings/notifiers/Slack") + apiPath := "/api/v1/settings/notifiers/Slack" err = cli.limiter.Wait(context.Background()) if err != nil { return nil, err } - events, body, errs := request.Clone().Get(cli.url + apiPath).End() + events, body, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Get(cli.url + apiPath).End() if errs != nil { err = fmt.Errorf("error calling %s", apiPath) return nil, err @@ -105,13 +102,12 @@ func (cli *Client) SlackNotificationDelete(notf Notification) error { return err } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) - apiPath := fmt.Sprintf("/api/v1/settings/notifiers/Slack") + apiPath := "/api/v1/settings/notifiers/Slack" err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, data, errs := request.Clone().Put(cli.url + apiPath).Send(string(payload)).End() + resp, data, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Put(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(err, "failed deleting Slack notification") } diff --git a/client/permission_sets.go b/client/permission_sets.go index e96e259..9be5082 100644 --- a/client/permission_sets.go +++ b/client/permission_sets.go @@ -29,13 +29,12 @@ type PermissionsSetList struct { func (cli *Client) GetPermissionsSet(name string) (*PermissionsSet, error) { var err error var response PermissionsSet - cli.gorequest.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v2/access_management/permissions/%s", name) err = cli.limiter.Wait(context.Background()) if err != nil { return nil, err } - resp, body, errs := cli.gorequest.Clone().Get(cli.url + apiPath).End() + resp, body, errs := cli.gorequest.Clone().Set("Authorization", "Bearer "+cli.token).Get(cli.url + apiPath).End() if errs != nil { return nil, errors.Wrap(getMergedError(errs), "failed getting PermissionSet") } @@ -71,13 +70,12 @@ func (cli *Client) GetPermissionsSets() ([]PermissionsSet, error) { var err error var response PermissionsSetList request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v2/access_management/permissions") err = cli.limiter.Wait(context.Background()) if err != nil { return nil, err } - events, body, errs := request.Clone().Get(cli.url + apiPath).End() + events, body, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Get(cli.url + apiPath).End() if errs != nil { err = fmt.Errorf("error calling %s", apiPath) return nil, err @@ -108,13 +106,12 @@ func (cli *Client) CreatePermissionsSet(permissionset *PermissionsSet) error { return err } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) - apiPath := fmt.Sprintf("/api/v2/access_management/permissions") + apiPath := "/api/v2/access_management/permissions" err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, _, errs := request.Clone().Post(cli.url + apiPath).Send(string(payload)).End() + resp, _, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Post(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed creating PermissionSet.") } @@ -142,13 +139,12 @@ func (cli *Client) UpdatePermissionsSet(permissionset *PermissionsSet) error { return err } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v2/access_management/permissions/%s", permissionset.Name) err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, _, errs := request.Clone().Put(cli.url + apiPath).Send(string(payload)).End() + resp, _, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Put(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed modifying PermissionSet") } @@ -172,13 +168,12 @@ func (cli *Client) UpdatePermissionsSet(permissionset *PermissionsSet) error { // DeletePermissionSet removes a PermissionSet Assurance Policy func (cli *Client) DeletePermissionsSet(name string) error { request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v2/access_management/permissions/%s", name) err := cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, _, errs := request.Clone().Delete(cli.url + apiPath).End() + resp, _, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Delete(cli.url + apiPath).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed deleting PermissionSet") } diff --git a/client/registries.go b/client/registries.go index a440a7d..d9a86e5 100644 --- a/client/registries.go +++ b/client/registries.go @@ -60,13 +60,12 @@ func (cli *Client) GetRegistry(name string) (*Registry, error) { var err error var response Registry request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v1/registries/%s", name) err = cli.limiter.Wait(context.Background()) if err != nil { return nil, err } - events, body, errs := request.Clone().Get(cli.url + apiPath).End() + events, body, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Get(cli.url + apiPath).End() if errs != nil { log.Println(events.StatusCode) err = fmt.Errorf("error calling %s", apiPath) @@ -91,13 +90,12 @@ func (cli *Client) GetRegistries() (*[]Registry, error) { var err error var response []Registry request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := "/api/v1/registries" err = cli.limiter.Wait(context.Background()) if err != nil { return nil, err } - events, body, errs := request.Clone().Get(cli.url + apiPath).End() + events, body, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Get(cli.url + apiPath).End() if errs != nil { log.Println(events.StatusCode) err = fmt.Errorf("error calling %s", apiPath) @@ -121,13 +119,12 @@ func (cli *Client) CreateRegistry(reg Registry) error { return err } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v1/registries") err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, data, errs := request.Clone().Post(cli.url + apiPath).Send(string(payload)).End() + resp, data, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Post(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(err, "failed creating registry") } @@ -144,13 +141,12 @@ func (cli *Client) UpdateRegistry(reg Registry) error { return err } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v1/registries/%s", reg.Name) err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, data, errs := request.Clone().Put(cli.url + apiPath).Send(string(payload)).End() + resp, data, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Put(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(err, "failed modifying registry") } @@ -163,13 +159,12 @@ func (cli *Client) UpdateRegistry(reg Registry) error { // DeleteRegistry removes a registry func (cli *Client) DeleteRegistry(name string) error { request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v1/registries/%s", name) err := cli.limiter.Wait(context.Background()) if err != nil { return err } - events, _, errs := request.Clone().Delete(cli.url + apiPath).End() + events, _, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Delete(cli.url + apiPath).End() if errs != nil { return fmt.Errorf("error while calling DELETE on /api/v1/users/%s: %v", name, events.StatusCode) } diff --git a/client/runtime_policy.go b/client/runtime_policy.go index d1c8c69..ae9f24e 100644 --- a/client/runtime_policy.go +++ b/client/runtime_policy.go @@ -281,13 +281,12 @@ func (cli *Client) CreateRuntimePolicy(runtimePolicy *RuntimePolicy) error { } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v2/runtime_policies") err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, body, errs := request.Clone().Post(cli.url + apiPath).Send(string(payload)).End() + resp, body, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Post(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed creating runtime policy.") } @@ -310,12 +309,11 @@ func (cli *Client) GetRuntimePolicy(name string) (*RuntimePolicy, error) { var response RuntimePolicy request := cli.gorequest apiPath := fmt.Sprintf("/api/v2/runtime_policies/%v", name) - request.Set("Authorization", "Bearer "+cli.token) err = cli.limiter.Wait(context.Background()) if err != nil { return nil, err } - events, body, errs := request.Clone().Get(cli.url + apiPath).End() + events, body, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Get(cli.url + apiPath).End() if errs != nil { return nil, errors.Wrap(getMergedError(errs), "failed getting runtime policy with name "+name) } @@ -346,13 +344,12 @@ func (cli *Client) UpdateRuntimePolicy(runtimePolicy *RuntimePolicy) error { return err } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v2/runtime_policies/%s", runtimePolicy.Name) err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, _, errs := request.Clone().Put(cli.url + apiPath).Send(string(payload)).End() + resp, _, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Put(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed modifying runtime policy") } @@ -376,13 +373,12 @@ func (cli *Client) UpdateRuntimePolicy(runtimePolicy *RuntimePolicy) error { // DeleteRuntimePolicy removes a Aqua runtime policy func (cli *Client) DeleteRuntimePolicy(name string) error { request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v2/runtime_policies/%s", name) err := cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, body, errs := request.Clone().Delete(cli.url + apiPath).End() + resp, body, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Delete(cli.url + apiPath).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed deleting runtime policy") } diff --git a/client/service.go b/client/service.go index 62fb5d4..b7ab80c 100644 --- a/client/service.go +++ b/client/service.go @@ -71,12 +71,11 @@ func (cli *Client) GetServices() (*ServiceList, error) { var response ServiceList request := cli.gorequest apiPath := "/api/v1/applications" - request.Set("Authorization", "Bearer "+cli.token) err = cli.limiter.Wait(context.Background()) if err != nil { return nil, err } - events, body, errs := request.Clone().Get(cli.url + apiPath).End() + events, body, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Get(cli.url + apiPath).End() if errs != nil { return nil, errors.Wrap(getMergedError(errs), "failed getting list of Service") } @@ -104,12 +103,11 @@ func (cli *Client) GetService(name string) (*Service, error) { var response Service request := cli.gorequest apiPath := fmt.Sprintf("/api/v1/applications/%v", name) - request.Set("Authorization", "Bearer "+cli.token) err = cli.limiter.Wait(context.Background()) if err != nil { return nil, err } - events, body, errs := request.Clone().Get(cli.url + apiPath).End() + events, body, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Get(cli.url + apiPath).End() if errs != nil { return nil, errors.Wrap(getMergedError(errs), "failed getting service with name "+name) } @@ -141,13 +139,12 @@ func (cli *Client) CreateService(service *Service) error { } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v1/applications") err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, body, errs := request.Clone().Post(cli.url + apiPath).Send(string(payload)).End() + resp, body, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Post(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed creating service.") } @@ -170,13 +167,12 @@ func (cli *Client) UpdateService(service *Service) error { return err } request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v1/applications/%s", service.Name) err = cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, _, errs := request.Clone().Put(cli.url + apiPath).Send(string(payload)).End() + resp, _, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Put(cli.url + apiPath).Send(string(payload)).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed modifying service") } @@ -200,13 +196,12 @@ func (cli *Client) UpdateService(service *Service) error { // DeleteService removes a Aqua Service func (cli *Client) DeleteService(name string) error { request := cli.gorequest - request.Set("Authorization", "Bearer "+cli.token) apiPath := fmt.Sprintf("/api/v1/applications/%s", name) err := cli.limiter.Wait(context.Background()) if err != nil { return err } - resp, body, errs := request.Clone().Delete(cli.url + apiPath).End() + resp, body, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Delete(cli.url + apiPath).End() if errs != nil { return errors.Wrap(getMergedError(errs), "failed deleting service") } diff --git a/client/sso.go b/client/sso.go index 017a278..fb9b67d 100644 --- a/client/sso.go +++ b/client/sso.go @@ -134,7 +134,6 @@ func (cli *Client) GetIntegrationState() (*IntegrationState, error) { case Csp: apiPath = "/api/v2/integrationsEnabledState" baseUrl = cli.url - request.Set("Authorization", "Bearer "+cli.token) case SaasDev: err = fmt.Errorf("GetSSO is Supported only in Aqua on prem env") return nil, err @@ -149,7 +148,7 @@ func (cli *Client) GetIntegrationState() (*IntegrationState, error) { if err != nil { return nil, err } - events, body, errs := request.Get(baseUrl+apiPath).Set("Authorization", fmt.Sprintf("Bearer %s", cli.token)).End() + events, body, errs := request.Clone().Set("Authorization", fmt.Sprintf("Bearer %s", cli.token)).Get(baseUrl + apiPath).End() if errs != nil { err = fmt.Errorf("error calling %s", apiPath) @@ -214,7 +213,6 @@ func (cli *Client) getSsoBasic(apiPath string) (string, error) { switch cli.clientType { case Csp: baseUrl = cli.url - request.Set("Authorization", "Bearer "+cli.token) case SaasDev: err = fmt.Errorf("GetSSO is Supported only in Aqua on prem env") return "", err @@ -230,7 +228,7 @@ func (cli *Client) getSsoBasic(apiPath string) (string, error) { if err != nil { return "", err } - events, body, errs := request.Get(baseUrl+apiPath).Set("Authorization", fmt.Sprintf("Bearer %s", cli.token)).End() + events, body, errs := request.Clone().Set("Authorization", fmt.Sprintf("Bearer %s", cli.token)).Get(baseUrl + apiPath).End() if errs != nil { err = fmt.Errorf("error calling %s", apiPath) @@ -257,7 +255,6 @@ func (cli *Client) createSsoBasic(apiPath string, sso interface{}) error { switch cli.clientType { case Csp: baseUrl = cli.url - request.Set("Authorization", "Bearer "+cli.token) case SaasDev: err = fmt.Errorf("GetSSO is Supported only in Aqua on prem env") return err @@ -273,7 +270,7 @@ func (cli *Client) createSsoBasic(apiPath string, sso interface{}) error { if err != nil { return err } - events, _, errs := request.Put(baseUrl+apiPath).Set("Authorization", fmt.Sprintf("Bearer %s", cli.token)).Send(string(payload)).End() + events, _, errs := request.Clone().Set("Authorization", fmt.Sprintf("Bearer %s", cli.token)).Put(baseUrl + apiPath).Send(string(payload)).End() if errs != nil { err = fmt.Errorf("error calling %s, error: %v", apiPath, err) @@ -312,7 +309,7 @@ func (cli *Client) GetRoleMappingSass(id string) (*RoleMappingSaas, error) { return nil, err } - events, body, errs := request.Get(baseUrl+apiPath).Set("Authorization", fmt.Sprintf("Bearer %s", cli.token)).End() + events, body, errs := request.Clone().Set("Authorization", fmt.Sprintf("Bearer %s", cli.token)).Get(baseUrl + apiPath).End() if errs != nil { err = fmt.Errorf("error calling %s", apiPath) @@ -359,7 +356,7 @@ func (cli *Client) GetRolesMappingSass() (*RoleMappingSaasList, error) { return nil, err } - events, body, errs := request.Get(baseUrl+apiPath).Set("Authorization", fmt.Sprintf("Bearer %s", cli.token)).End() + events, body, errs := request.Clone().Set("Authorization", fmt.Sprintf("Bearer %s", cli.token)).Get(baseUrl + apiPath).End() if errs != nil { err = fmt.Errorf("error calling %s", apiPath) @@ -411,7 +408,7 @@ func (cli *Client) CreateRoleMappingSaas(saas *RoleMappingSaas) error { return err } - events, body, errs := request.Post(baseUrl+apiPath).Set("Authorization", fmt.Sprintf("Bearer %s", cli.token)).Send(string(payload)).End() + events, body, errs := request.Clone().Set("Authorization", fmt.Sprintf("Bearer %s", cli.token)).Post(baseUrl + apiPath).Send(string(payload)).End() if errs != nil { err = fmt.Errorf("error calling %s", apiPath) @@ -461,7 +458,7 @@ func (cli *Client) UpdateRoleMappingSaas(saas *RoleMappingSaas, id string) error return err } - events, body, errs := request.Put(baseUrl+apiPath).Set("Authorization", fmt.Sprintf("Bearer %s", cli.token)).Send(string(payload)).End() + events, body, errs := request.Clone().Set("Authorization", fmt.Sprintf("Bearer %s", cli.token)).Put(baseUrl + apiPath).Send(string(payload)).End() if errs != nil { err = fmt.Errorf("error calling %s", apiPath) @@ -505,7 +502,7 @@ func (cli *Client) DeleteRoleMappingSass(id string) error { return err } - events, body, errs := request.Delete(baseUrl+apiPath).Set("Authorization", fmt.Sprintf("Bearer %s", cli.token)).End() + events, body, errs := request.Clone().Set("Authorization", fmt.Sprintf("Bearer %s", cli.token)).Delete(baseUrl + apiPath).End() if errs != nil { err = fmt.Errorf("error calling %s", apiPath) diff --git a/client/vulnerabilities.go b/client/vulnerabilities.go index 015bbd1..b36b0fe 100644 --- a/client/vulnerabilities.go +++ b/client/vulnerabilities.go @@ -119,12 +119,11 @@ func (cli *Client) getVulnerabilities(image *Image, page, pagesize int) (*Vulner var response VulnerabilitiesList request := cli.gorequest apiPath := fmt.Sprintf("/api/v2/risks/vulnerabilities?page=%v&pagesize=%v&include_vpatch_info=true&show_negligible=true&hide_base_image=false&image_name=%v:%v®istry_name=%v", page, pagesize, image.Repository, image.Tag, image.Registry) - request.Set("Authorization", "Bearer "+cli.token) err = cli.limiter.Wait(context.Background()) if err != nil { return nil, err } - events, body, errs := request.Clone().Get(cli.url + apiPath).End() + events, body, errs := request.Clone().Set("Authorization", "Bearer "+cli.token).Get(cli.url + apiPath).End() if errs != nil { return nil, errors.Wrap(getMergedError(errs), fmt.Sprintf("failed getting vulnerabilities with name %v/%v:%v", image.Registry, image.Repository, image.Tag)) } From 328d8096a48ec948195fd07325880f4a0130c8c1 Mon Sep 17 00:00:00 2001 From: yossi gilad Date: Sun, 22 Jan 2023 09:00:16 +0200 Subject: [PATCH 2/2] inc version --- DEVELOPMENT.md | 4 ++-- GNUmakefile | 2 +- README.md | 2 +- docs/index.md | 2 +- examples/data-sources/main.tf | 2 +- examples/provider/provider.tf | 2 +- examples/resources/main.tf | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 106554a..2ad56ac 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -32,7 +32,7 @@ git clone https://github.com/aquasecurity/terraform-provider-aquasec.git cd terraform-provider-aquasec -git checkout v0.8.17 +git checkout v0.8.20 ``` **Build and install the provider** @@ -55,7 +55,7 @@ In order to test the provider installed locally, the provider block will have to terraform { required_providers { aquasec = { - version = "0.8.17" + version = "0.8.20" source = "terraform-provider-aquasec/aquasec/aquasec" } } diff --git a/GNUmakefile b/GNUmakefile index a3f1565..f052ac2 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -6,7 +6,7 @@ HOSTNAME := github.com NAMESPACE := aquasec NAME := aquasec BINARY := terraform-provider-${NAME} -VERSION := 0.8.19 +VERSION := 0.8.20 OS_ARCH := $(shell go env GOOS)_$(shell go env GOARCH) default: build diff --git a/README.md b/README.md index 64514d6..d0ba83f 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ To quickly get started using the Aquasec provider for Terraform, configure the p terraform { required_providers { aquasec = { - version = "0.8.17" + version = "0.8.20" source = "aquasecurity/aquasec" } } diff --git a/docs/index.md b/docs/index.md index fbaa68b..44ad408 100644 --- a/docs/index.md +++ b/docs/index.md @@ -21,7 +21,7 @@ Use the navigation to the left to read about the available resources and data so terraform { required_providers { aquasec = { - version = "0.8.17" + version = "0.8.20" source = "aquasecurity/aquasec" } } diff --git a/examples/data-sources/main.tf b/examples/data-sources/main.tf index 9ad5753..3384642 100644 --- a/examples/data-sources/main.tf +++ b/examples/data-sources/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { aquasec = { - // version = "0.8.17" + // version = "0.8.20" source = "aquasecurity/aquasec" } } diff --git a/examples/provider/provider.tf b/examples/provider/provider.tf index 6d33a1b..4cdec91 100644 --- a/examples/provider/provider.tf +++ b/examples/provider/provider.tf @@ -1,7 +1,7 @@ terraform { required_providers { aquasec = { - version = "0.8.17" + version = "0.8.20" source = "aquasecurity/aquasec" } } diff --git a/examples/resources/main.tf b/examples/resources/main.tf index dca774d..a8e1e00 100644 --- a/examples/resources/main.tf +++ b/examples/resources/main.tf @@ -1,7 +1,7 @@ terraform { required_providers { aquasec = { - // version = "0.8.17" + // version = "0.8.20" source = "aquasecurity/aquasec" } }