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

libbeat/common/transport: fix log message about TLS #30331

Merged
merged 1 commit into from
Feb 11, 2022

Conversation

belimawr
Copy link
Contributor

What does this PR do?

This commit fixes the log message issued by the test output command.
Our current TLS verification relies on more than the value of
tlsConfig.InsecureSkipVerify, so the previous implementation would
log that TLS was disabled when it was not.

This commit fixes it by checking the value of config.Verification.

Why is it important?

It fixes a logging issue

Checklist

  • [ x ] My code follows the style guidelines of this project
  • [ x ] I have commented my code, particularly in hard-to-understand areas
    - [ ] I have made corresponding changes to the documentation
    - [ ] I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • [ x ] I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

How to test this PR locally

To test using Filebeat, set the ssl.verification_mode on any Beat output to anything other than none, then run filebeat test output. You should see the correct log message based on the verification mode you set.

Related issues

## Use cases
## Screenshots

Logs

elasticsearch: https://somewhere-in-the-cloud:443...
  parse url... OK
  connection...
    parse host... OK
    dns lookup... OK
    addresses: 42.42.42.42 42.42.42.43
    dial up... OK
  TLS...
    security: server's certificate chain verification is enabled
    handshake... OK
    TLS version: TLSv1.2
    dial up... OK
  talk to server... OK
  version: 7.17.0

@belimawr belimawr added the bug label Feb 10, 2022
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Feb 10, 2022
@mergify
Copy link
Contributor

mergify bot commented Feb 10, 2022

This pull request does not have a backport label. Could you fix it @belimawr? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d./d is the label to automatically backport to the 7./d branch. /d is the digit

NOTE: backport-skip has been added to this pull request.

@mergify mergify bot added the backport-skip Skip notification from the automated backport with mergify label Feb 10, 2022
@belimawr belimawr added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Feb 10, 2022
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Feb 10, 2022
@elasticmachine
Copy link
Collaborator

elasticmachine commented Feb 10, 2022

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2022-02-10T17:03:24.278+0000

  • Duration: 112 min 24 sec

Test stats 🧪

Test Results
Failed 0
Passed 48172
Skipped 4379
Total 52551

💚 Flaky test report

Tests succeeded.

🤖 GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • /package : Generate the packages and run the E2E tests.

  • /beats-tester : Run the installation tests with beats-tester.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@belimawr
Copy link
Contributor Author

/test

This commit fixes the log message issued by the `test output` command.
Our current TLS verification relies on more than the value of
`tlsConfig.InsecureSkipVerify`, so the previous implementation would
log that TLS was disabled when it was not.

This commit fixes it by checking the value of `config.Verification`.
@belimawr
Copy link
Contributor Author

rebase onto main, force-push

@belimawr
Copy link
Contributor Author

/test

@belimawr belimawr marked this pull request as ready for review February 10, 2022 17:41
@elasticmachine
Copy link
Collaborator

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@cmacknz
Copy link
Member

cmacknz commented Feb 10, 2022

Did we sanity check this on Windows 10 specifically to ensure the issue with the original change is fixed?

@belimawr
Copy link
Contributor Author

Did we sanity check this on Windows 10 specifically to ensure the issue with the original change is fixed?

The issue wasn't Windows-specific, I believe some Windows tests triggered it first or they have a different test suit that triggered the bug.

@belimawr
Copy link
Contributor Author

Anyway, I'll try to test it on Windows before merging this PR.

@belimawr belimawr merged commit 4eeb5a9 into elastic:main Feb 11, 2022
@belimawr belimawr deleted the fix-tls-message-v2 branch February 11, 2022 13:28
@belimawr belimawr added the backport-7.17 Automated backport to the 7.17 branch with mergify label Aug 29, 2022
mergify bot pushed a commit that referenced this pull request Aug 29, 2022
This commit fixes the log message issued by the `test output` command.
Our current TLS verification relies on more than the value of
`tlsConfig.InsecureSkipVerify`, so the previous implementation would
log that TLS was disabled when it was not.

This commit fixes it by checking the value of `config.Verification`.

(cherry picked from commit 4eeb5a9)
belimawr added a commit that referenced this pull request Aug 30, 2022
…ut TLS (#32909)

This commit fixes the log message issued by the `test output` command.
Our current TLS verification relies on more than the value of
`tlsConfig.InsecureSkipVerify`, so the previous implementation would
log that TLS was disabled when it was not.

This commit fixes it by checking the value of `config.Verification`.

(cherry picked from commit 4eeb5a9)

Co-authored-by: Tiago Queiroz <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-7.17 Automated backport to the 7.17 branch with mergify backport-skip Skip notification from the automated backport with mergify bug Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants