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

Add logs for ca_trusted_fingerprint workflow #29312

Merged
merged 1 commit into from
Dec 7, 2021

Conversation

belimawr
Copy link
Contributor

@belimawr belimawr commented Dec 7, 2021

What does this PR do?

This PR adds logs to clearly show when Beats is trusting a self-signed certificate through a fingerprint provided by ssl.ca_trusted_fingerprint.

Why is it important?

If there is any issue connecting to an output (the main use case is ES >= 8.0) using a self-signed certificate it will be easier to debug/understand what is happening.

Checklist

  • My code follows the style guidelines of this project
  • 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
    - [ ] I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

How to test this PR locally

  1. Run an Elasticsearch 8.0 Instance with self signed certs
  2. Edit the Elasticsearch output configuration from your beat:
output.elasticsearch:
  # Array of hosts to connect to.
  hosts: ["https://<your IP address>:9200"]

  username: "elastic"
  password: "<your elastic use password>"
  ssl.ca_trusted_fingerprint: "<ES CA certificate fingerprint>"
  1. Run your Beat
  2. Look for the log messages from the tls logger ("log.logger":"tls")

Related issues

Use cases

Screenshots

Logs

@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Dec 7, 2021
@mergify
Copy link
Contributor

mergify bot commented Dec 7, 2021

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 Dec 7, 2021
@belimawr belimawr changed the title [WIP] Add logs for ca_trusted_fingerprint workflow Add logs for ca_trusted_fingerprint workflow Dec 7, 2021
@belimawr belimawr added backport-v8.0.0 Automated backport with mergify Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team labels Dec 7, 2021
@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Dec 7, 2021
@mergify mergify bot removed the backport-skip Skip notification from the automated backport with mergify label Dec 7, 2021
@belimawr belimawr marked this pull request as ready for review December 7, 2021 10:26
@elasticmachine
Copy link
Collaborator

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

@belimawr belimawr added the review label Dec 7, 2021
@elasticmachine
Copy link
Collaborator

elasticmachine commented Dec 7, 2021

💚 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: 2021-12-07T13:26:33.122+0000

  • Duration: 25 min 53 sec

  • Commit: fd29885

Test stats 🧪

Test Results
Failed 0
Passed 980
Skipped 190
Total 1170

💚 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!)

This commit adds logs to clearly show when Beats is trusting a
self-signed certificate through a fingerprint provided by
ssl.ca_trusted_fingerprint.

It also cleans up some struct tags on tlscommon.TLSConfig.
@belimawr belimawr force-pushed the ca-trusted-fingerprint-logs branch from b62cb5f to fd29885 Compare December 7, 2021 10:36
@belimawr
Copy link
Contributor Author

belimawr commented Dec 7, 2021

/test

@belimawr belimawr merged commit db9b410 into elastic:master Dec 7, 2021
@belimawr belimawr deleted the ca-trusted-fingerprint-logs branch December 7, 2021 13:53
mergify bot pushed a commit that referenced this pull request Dec 7, 2021
This commit adds logs to clearly show when Beats is trusting a
self-signed certificate through the fingerprint provided by
`ssl.ca_trusted_fingerprint`.

It also cleans up some struct tags on `tlscommon.TLSConfig`.

(cherry picked from commit db9b410)

# Conflicts:
#	libbeat/common/transport/tlscommon/tls_config.go
belimawr added a commit that referenced this pull request Dec 8, 2021
…29316)

* Add logs for ca_trusted_fingerprint workflow (#29312)

This commit adds logs to clearly show when Beats is trusting a
self-signed certificate through the fingerprint provided by
`ssl.ca_trusted_fingerprint`.

It also cleans up some struct tags on `tlscommon.TLSConfig`.

(cherry picked from commit db9b410)

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-v8.0.0 Automated backport with mergify review 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