Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Silence logs #18

Merged
merged 2 commits into from
Sep 19, 2024
Merged

Silence logs #18

merged 2 commits into from
Sep 19, 2024

Conversation

cavalle
Copy link
Contributor

@cavalle cavalle commented Sep 19, 2024

  • Part of APP-83

}

tlsConfig.InsecureSkipVerify = true

Check failure

Code scanning / CodeQL

Disabled TLS certificate check High

InsecureSkipVerify should not be used in production code.

Copilot Autofix AI 17 days ago

To fix the problem, we need to ensure that InsecureSkipVerify is not set to true in production environments. Instead, we should configure the TLS settings properly to trust the necessary certificates. This can be achieved by conditionally setting InsecureSkipVerify based on the environment.

  1. Modify the newEbizkaia function to only set InsecureSkipVerify to true in non-production environments.
  2. Ensure that the TLS configuration is properly set up to trust the required certificates in production.
Suggested changeset 1
internal/gateways/ebizkaia.go

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/internal/gateways/ebizkaia.go b/internal/gateways/ebizkaia.go
--- a/internal/gateways/ebizkaia.go
+++ b/internal/gateways/ebizkaia.go
@@ -63,3 +63,5 @@
 
-	tlsConfig.InsecureSkipVerify = true
+	if env != EnvironmentProduction {
+		tlsConfig.InsecureSkipVerify = true
+	}
 	c.client.SetTLSClientConfig(tlsConfig)
EOF
@@ -63,3 +63,5 @@

tlsConfig.InsecureSkipVerify = true
if env != EnvironmentProduction {
tlsConfig.InsecureSkipVerify = true
}
c.client.SetTLSClientConfig(tlsConfig)
Copilot is powered by AI and may make mistakes. Always verify output.
Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@cavalle cavalle merged commit 6c395a0 into main Sep 19, 2024
3 of 4 checks passed
@cavalle cavalle deleted the silent-logs branch September 19, 2024 08:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant