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

chore: automated PR to main 2024-06-30 #179

Open
wants to merge 324 commits into
base: main
Choose a base branch
from
Open

chore: automated PR to main 2024-06-30 #179

wants to merge 324 commits into from

Conversation

github-actions[bot]
Copy link

Automated Pull Request to main branch

@github-actions github-actions bot requested a review from akashsinghal as a code owner June 30, 2024 08:35
@@ -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

InsecureSkipVerify should not be used in production code.

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.

Suggested changeset 1
pkg/referrerstore/oras/oras.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/pkg/referrerstore/oras/oras.go b/pkg/referrerstore/oras/oras.go
--- a/pkg/referrerstore/oras/oras.go
+++ b/pkg/referrerstore/oras/oras.go
@@ -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
EOF
@@ -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
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
dependabot bot and others added 2 commits December 5, 2024 14:55
…t#1963)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
@akashsinghal akashsinghal deployed to azure-publish December 8, 2024 08:39 — with GitHub Actions Active
…-project#1973)

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
akashsinghal and others added 12 commits December 10, 2024 12:58
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>
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.