-
Notifications
You must be signed in to change notification settings - Fork 0
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
chore: automated PR to main 2024-06-30 #179
base: main
Are you sure you want to change the base?
Conversation
@@ -183,7 +183,7 @@ | |||
insecureTransport.MaxIdleConnsPerHost = HTTPMaxIdleConnsPerHost | |||
// #nosec G402 | |||
insecureTransport.TLSClientConfig = &tls.Config{ | |||
InsecureSkipVerify: true, | |||
InsecureSkipVerify: true, //nolint:gosec |
Check failure
Code scanning / CodeQL
Disabled TLS certificate check High
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 21 days ago
To fix the problem, we should avoid setting InsecureSkipVerify
to true
in production code. Instead, we should ensure that the application uses valid certificates and performs proper certificate verification. If there is a need to handle both secure and insecure connections, we should provide a configuration option that allows the user to specify whether to skip certificate verification, but default to secure connections.
In this specific case, we will remove the insecureTransport
configuration and ensure that the application only uses the secureTransport
configuration. This will enforce TLS certificate verification.
@@ -179,14 +179,2 @@ | ||
|
||
// define the http client for TLS disabled | ||
insecureTransport := http.DefaultTransport.(*http.Transport).Clone() | ||
insecureTransport.MaxIdleConns = HTTPMaxIdleConns | ||
insecureTransport.MaxConnsPerHost = HTTPMaxConnsPerHost | ||
insecureTransport.MaxIdleConnsPerHost = HTTPMaxIdleConnsPerHost | ||
// #nosec G402 | ||
insecureTransport.TLSClientConfig = &tls.Config{ | ||
InsecureSkipVerify: true, //nolint:gosec | ||
} | ||
insecureRetryTransport := retry.NewTransport(insecureTransport) | ||
insecureRetryTransport.Policy = customRetryPolicy | ||
|
||
return &orasStore{config: &conf, | ||
@@ -196,3 +184,2 @@ | ||
httpClient: &http.Client{Transport: secureRetryTransport}, | ||
httpClientInsecure: &http.Client{Transport: insecureRetryTransport}, | ||
createRepository: createDefaultRepository}, nil |
…t#1963) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Akash Singhal <[email protected]>
…-project#1973) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Akash Singhal <[email protected]>
…-project#1900) Signed-off-by: Juncheng Zhu <[email protected]> Co-authored-by: Binbin Li <[email protected]> Co-authored-by: Susan Shi <[email protected]>
Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ect#1971) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…t#1966) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
… to 1.2.0-rc.2 (ratify-project#1970) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…t#1978) Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: Akash Singhal <[email protected]>
Signed-off-by: Akash Singhal <[email protected]>
Signed-off-by: Juncheng Zhu <[email protected]>
Automated Pull Request to main branch