Skip to content

git/github: default GitHub webhooks to TLS verification - #3714

Merged
knative-prow[bot] merged 1 commit into
knative:mainfrom
Vi-shub:fix/github-webhook-tls-verify-default
Jun 11, 2026
Merged

knative-prow[bot] merged 1 commit into
knative:mainfrom
Vi-shub:fix/github-webhook-tls-verify-default

Conversation

@Vi-shub

@Vi-shub Vi-shub commented May 12, 2026

Copy link
Copy Markdown
Contributor
  • Default GitHub repository webhooks created by pkg/git/github to insecure_ssl: "0" so GitHub verifies TLS when delivering to HTTPS payload URLs.
  • Remove the prior insecure default ("1") and the associated TODO in CreateWebHook.

/kind bug

Fixes #3713

GitHub’s webhook insecure_ssl setting was hard-coded to "1", which disables TLS certificate verification for HTTPS webhook targets. The secure default is "0" for normal HTTPS endpoints. Users whose controller URL uses a certificate that GitHub does not trust (for example self-signed TLS in lab environments) may need a follow-up opt-in if hook creation or deliveries fail.

@davidhadas @lkingland can you please review this. Thanks for your time.

@knative-prow knative-prow Bot added the kind/bug Bugs label May 12, 2026
@linux-foundation-easycla

linux-foundation-easycla Bot commented May 12, 2026 •

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • βœ… login: Vi-shub / name: Vi-shub (1e5ad39)

@knative-prow
knative-prow Bot requested review from dsimansk and jrangelramos May 12, 2026 20:39
@knative-prow

knative-prow Bot commented May 12, 2026

Copy link
Copy Markdown

Welcome @Vi-shub! It looks like this is your first PR to knative/func πŸŽ‰

@knative-prow knative-prow Bot added size/L πŸ€– PR changes 100-499 lines, ignoring generated files. needs-ok-to-test πŸ€– Needs an org member to approve testing labels May 12, 2026
@knative-prow

knative-prow Bot commented May 12, 2026

Copy link
Copy Markdown

Hi @Vi-shub. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@matejvasek
matejvasek requested review from gauron99 and lkingland May 12, 2026 21:25
@codecov

codecov Bot commented May 12, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
βœ… Project coverage is 56.98%. Comparing base (c28a5dc) to head (d032347).
⚠️ Report is 67 commits behind head on main.

Files with missing lines Patch % Lines
pkg/git/github/github.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3714      +/-   ##
==========================================
+ Coverage   56.18%   56.98%   +0.79%     
==========================================
  Files         181      181              
  Lines       20928    21116     +188     
==========================================
+ Hits        11758    12032     +274     
+ Misses       8007     7861     -146     
- Partials     1163     1223      +60     
Flag Coverage Ξ”
e2e 35.80% <0.00%> (-0.34%) ⬇️
e2e go 32.42% <0.00%> (?)
e2e node 28.20% <0.00%> (?)
e2e python 32.80% <0.00%> (?)
e2e quarkus 28.34% <0.00%> (?)
e2e rust 27.75% <0.00%> (-0.27%) ⬇️
e2e springboot 26.24% <0.00%> (-0.27%) ⬇️
e2e typescript 28.32% <0.00%> (-0.27%) ⬇️
e2e-config-ci 17.70% <0.00%> (?)
integration 17.28% <0.00%> (-0.19%) ⬇️
unit macos-14 45.05% <0.00%> (+0.06%) ⬆️
unit macos-latest 45.05% <0.00%> (+0.06%) ⬆️
unit ubuntu-24.04-arm 45.31% <0.00%> (+0.15%) ⬆️
unit ubuntu-latest 46.00% <0.00%> (+0.16%) ⬆️
unit windows-latest 45.09% <0.00%> (+0.12%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

β˜” View full report in Codecov by Harness.
πŸ“’ Have feedback on the report? Share it here.

πŸš€ New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • πŸ“¦ JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@matejvasek

Copy link
Copy Markdown
Contributor

@lkingland @gauron99 do you recall why we would disable tls here? Tests maybe?

@davidhadas

davidhadas commented May 14, 2026 •

Copy link
Copy Markdown
Contributor

@Vi-shub welcome,
Why is the entire file show as different?
Are you replacing \n with \r\n or similar?
(If \r\n is the cause, I am surprised that we do not have a test for it)

Please recommit with one line changed.

As for the actual change - I see it was written like this 3 years ago (#1594) when first added and there is no comments about it in the PR besides the code comment. I suggest the func team review this and take a decision.

@gauron99

Copy link
Copy Markdown
Contributor

do you recall why we would disable tls here? Tests maybe?

I dont remember this ever changing, might be older than my work here πŸ˜„

Set repository webhook HookConfig insecure_ssl to 0 so GitHub verifies
TLS when delivering to HTTPS payload URLs

Signed-off-by: Vi-shub <smsharma3121@gmail.com>
@Vi-shub
Vi-shub force-pushed the fix/github-webhook-tls-verify-default branch from 1e5ad39 to d032347 Compare May 14, 2026 19:22
@knative-prow knative-prow Bot added size/XS πŸ€– PR changes 0-9 lines, ignoring generated files. and removed size/L πŸ€– PR changes 100-499 lines, ignoring generated files. labels May 14, 2026
@Vi-shub

Vi-shub commented May 14, 2026

Copy link
Copy Markdown
Contributor Author

@Vi-shub welcome, Why is the entire file show as different? Are you replacing \n with \r\n or similar? (If \r\n is the cause, I am surprised that we do not have a test for it)

Please recommit with one line changed.

As for the actual change - I see it was written like this 3 years ago (#1594) when first added and there is no comments about it in the PR besides the code comment. I suggest the func team review this and take a decision.

Thanks for catching that you’re right. The large diff was almost certainly from CRLF vs LF on my side (whole file re-normalized), not an intentional reformat. I have reset pkg/git/github/github.go from main and recommitted so the change is only the InsecureSSL value (and I’ll double-check git diff before pushing).

Codecov should look sane once the diff is actually one line (or a single small hunk) instead of line-ending churn.

@Vi-shub

Vi-shub commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

@matejvasek @gauron99 can you review this please. Thankyou for your time :)

@lkingland

Copy link
Copy Markdown
Member

/ok-to-test

@knative-prow knative-prow Bot added ok-to-test πŸ€– Non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test πŸ€– Needs an org member to approve testing labels May 18, 2026
@matejvasek
matejvasek requested a review from Copilot June 11, 2026 16:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the GitHub webhook creation logic in pkg/git/github to default to secure TLS certificate verification when delivering webhooks to HTTPS payload URLs, aligning behavior with GitHub’s recommended insecure_ssl setting and addressing #3713.

Changes:

  • Change repository webhook insecure_ssl default from "1" (skip TLS verification) to "0" (verify TLS) in Client.CreateWebHook.
  • Remove the prior insecure default and associated inline TODO by making the secure behavior explicit.

πŸ’‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@matejvasek

Copy link
Copy Markdown
Contributor

/approve
/lgtm

@knative-prow knative-prow Bot added the lgtm πŸ€– PR is ready to be merged. label Jun 11, 2026
@knative-prow

knative-prow Bot commented Jun 11, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: matejvasek, Vi-shub

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow Bot added the approved πŸ€– PR has been approved by an approver from all required OWNERS files. label Jun 11, 2026
@knative-prow
knative-prow Bot merged commit 6cdafd1 into knative:main Jun 11, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved πŸ€– PR has been approved by an approver from all required OWNERS files. kind/bug Bugs lgtm πŸ€– PR is ready to be merged. ok-to-test πŸ€– Non-member PR verified by an org member that is safe to test. size/XS πŸ€– PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

git/github: default repository webhook insecure_ssl to TLS verification ("0")

6 participants