Skip to content

Remove curl -k from examples and add certificate guidance#6078

Merged
marciw merged 22 commits into
mainfrom
mw-curlk-5776
May 12, 2026
Merged

Remove curl -k from examples and add certificate guidance#6078
marciw merged 22 commits into
mainfrom
mw-curlk-5776

Conversation

@marciw
Copy link
Copy Markdown
Member

@marciw marciw commented Apr 22, 2026

Fixes #5776 (opened by a security researcher). Instead of specifying -k in curl examples, offer it as an option for testing and note that it's insecure.

Generative AI disclosure

Did you use a generative AI (GenAI) tool to assist in creating this
contribution?

  • Yes Claude Code and Cursor Auto
  • No

👇 PR description written by Claude 🤖

Summary

Fixes #5776. Documentation across the repo recommended curl -k / --insecure, which disables TLS certificate verification and exposes users to MITM attacks if copied into real environments.

Changes:

  • Remove -k / --insecure from all curl command examples (29 files)
  • Add one admonition per page explaining the secure alternative and the testing escape hatch
more details

Two-tier admonition approach

Pages use one of two admonition types depending on deployment context.

ECE pages — ::::{important} (18 files)

ECE installations use a self-signed certificate by default, so the --cacert guidance is immediately actionable and the risk of blindly adding -k to production commands is higher. The admonition leads with the secure path:

The curl examples on this page use HTTPS. If your ECE installation uses the default self-signed certificate, add --cacert /path/to/ca.pem to your curl commands, specifying the associated CA certificate.

For testing only, you can use --insecure (or -k) to skip certificate verification. Don't use --insecure or -k in production environments.

Non-ECE pages — ::::{tip} (11 files)

ECK, Elastic Cloud (hosted), troubleshooting, and AutoOps pages assume a valid certificate in most scenarios. The tip documents the escape hatch without implying users need --cacert or are running an ECE coordinator with a self-signed default:

The following examples assume your endpoint has a valid certificate. If you're testing with self-signed certificates, add --insecure (or -k) to the curl command to skip SSL/TLS verification. Don't use this flag in production environments.

One exception: ec-remote-cluster-same-ess.md has applies_to: deployment: ess: ga (Elastic Cloud hosted), not ECE — it gets the tip even though it lives next to ECE remote-cluster pages.

One exception: autoscaling-in-ece-and-ech.md has both an ECE tab and an ESS tab — the ::::{important} is scoped inside the ::::{applies-item} ece: block, and the ::::{tip} is inside the ::::{applies-item} ess: block.

Files changed

ECE — ::::{important}:

  • deploy-manage/api-keys/elastic-cloud-enterprise-api-keys.md
  • deploy-manage/autoscaling/autoscaling-in-ece-and-ech.md
  • deploy-manage/deploy/cloud-enterprise/ce-add-support-for-node-roles-autoscaling.md
  • deploy-manage/deploy/cloud-enterprise/configure-allocator-affinity.md
  • deploy-manage/deploy/cloud-enterprise/deploy-large-installation.md
  • deploy-manage/deploy/cloud-enterprise/deploy-medium-installation.md
  • deploy-manage/deploy/cloud-enterprise/deploy-small-installation.md
  • deploy-manage/deploy/cloud-enterprise/ece-ce-add-support-for-integrations-server.md
  • deploy-manage/deploy/cloud-enterprise/ece-configuring-ece-configure-system-templates.md
  • deploy-manage/deploy/cloud-enterprise/ece-configuring-ece-create-templates.md
  • deploy-manage/deploy/cloud-enterprise/ece-configuring-ece-instance-configurations-create.md
  • deploy-manage/deploy/cloud-enterprise/ece-configuring-ece-tag-allocators.md
  • deploy-manage/deploy/cloud-enterprise/ece-integrations-server-api-example.md
  • deploy-manage/deploy/cloud-enterprise/manage-elastic-stack-versions.md
  • deploy-manage/deploy/cloud-enterprise/switch-from-apm-to-integrations-server-payload.md
  • deploy-manage/remote-clusters/ece-remote-cluster-other-ece.md
  • deploy-manage/remote-clusters/ece-remote-cluster-same-ece.md
  • deploy-manage/upgrade/orchestrator/upgrade-cloud-enterprise.md

Non-ECE — ::::{tip}:

  • deploy-manage/deploy/cloud-on-k8s/elasticsearch-deployment-quickstart.md
  • deploy-manage/deploy/cloud-on-k8s/quickstart-beats.md
  • deploy-manage/deploy/cloud-on-k8s/quickstart-standalone.md
  • deploy-manage/monitor/autoops/autoops-sm-troubleshoot-firewalls.md
  • deploy-manage/remote-clusters/ec-remote-cluster-same-ess.md
  • explore-analyze/alerting/alerts/alerting-troubleshooting.md
  • troubleshoot/elasticsearch/diagnostic.md
  • troubleshoot/elasticsearch/unable-to-retrieve-node-fs-stats.md
  • troubleshoot/ingest/logstash/diagnostic.md
  • troubleshoot/kibana/alerts.md
  • troubleshoot/kibana/capturing-diagnostics.md

Test plan

  • Verify no remaining bare curl -k in changed files: grep -rn "curl -k\b" . --include="*.md" | grep -v "\.claude/" (expect zero)
  • Verify --insecure appears only inside admonition text and the curl manpage link: grep -rn "\-\-insecure" . --include="*.md" | grep -v "\.claude/\|curl\.se/docs" (expect zero)
  • Spot-check ECE admonitions have two paragraphs with --cacert in paragraph 1 and --insecure / -k in paragraph 2
  • Confirm autoscaling-in-ece-and-ech.md has ECE important inside the ECE tab and ESS tip inside the ESS tab
  • Confirm ec-remote-cluster-same-ess.md has a tip (not important)

🤖 Generated with Claude Code

@marciw marciw requested review from a team as code owners April 22, 2026 21:34
@marciw marciw marked this pull request as draft April 22, 2026 21:35
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 22, 2026

🔍 Preview links for changed docs

More links …

@github-actions

This comment was marked as resolved.

@marciw

This comment was marked as outdated.

marciw

This comment was marked as resolved.

@marciw marciw changed the title Remove curl -k from examples and add certificate guidance [WIP] Remove curl -k from examples and add certificate guidance Apr 22, 2026
marciw and others added 4 commits April 22, 2026 18:42
…gnostic

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates documentation examples to avoid recommending curl -k/--insecure by default, and adds guidance on using CA certificates (or using --insecure only for testing) to address issue #5776.

Changes:

  • Removes -k/--insecure from curl command examples across docs.
  • Adds tip/important admonitions explaining secure TLS options (--cacert) and the testing-only escape hatch (--insecure).
  • Adjusts a few pages’ surrounding wording/structure to accommodate the new guidance.

Reviewed changes

Copilot reviewed 29 out of 29 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
troubleshoot/kibana/capturing-diagnostics.md Adds TLS tip and removes -k from Kibana diagnostic curl example.
troubleshoot/kibana/alerts.md Adds TLS tip and removes -k from connector execute curl example.
troubleshoot/ingest/logstash/diagnostic.md Adds TLS tip and removes -k from Logstash diagnostic curl example.
troubleshoot/elasticsearch/unable-to-retrieve-node-fs-stats.md Replaces insecure TLS testing snippet with tip + --cacert guidance.
troubleshoot/elasticsearch/diagnostic.md Adds TLS tip and removes -k from Elasticsearch diagnostic curl example.
explore-analyze/alerting/alerts/alerting-troubleshooting.md Adds TLS tip and removes -k from connector execute curl example.
deploy-manage/upgrade/orchestrator/upgrade-cloud-enterprise.md Adds ECE-focused important TLS guidance; removes -k from license check example.
deploy-manage/remote-clusters/ece-remote-cluster-same-ece.md Adds ECE TLS important admonition; removes -k from multiple API examples.
deploy-manage/remote-clusters/ece-remote-cluster-other-ece.md Adds ECE TLS important admonition; removes -k from trust API example.
deploy-manage/remote-clusters/ec-remote-cluster-same-ess.md Adds TLS tip admonition; removes -k from hosted/ESS remote cluster example.
deploy-manage/monitor/autoops/autoops-sm-troubleshoot-firewalls.md Adds TLS tip admonition and updates troubleshooting table guidance around --insecure.
deploy-manage/deploy/cloud-on-k8s/quickstart-standalone.md Adds TLS tip admonition; removes -k from ECK quickstart curl.
deploy-manage/deploy/cloud-on-k8s/quickstart-beats.md Adds TLS tip admonition; removes -k from ECK beats quickstart curl.
deploy-manage/deploy/cloud-on-k8s/elasticsearch-deployment-quickstart.md Adds TLS tip admonition; removes -k and updates surrounding TLS wording.
deploy-manage/deploy/cloud-enterprise/switch-from-apm-to-integrations-server-payload.md Adds ECE TLS important admonition; removes -k from deployment API example.
deploy-manage/deploy/cloud-enterprise/manage-elastic-stack-versions.md Replaces prior -k mention with ECE TLS important admonition.
deploy-manage/deploy/cloud-enterprise/ece-integrations-server-api-example.md Adds ECE TLS important admonition; removes -k from deployment API example.
deploy-manage/deploy/cloud-enterprise/ece-configuring-ece-tag-allocators.md Adds ECE TLS important admonition; removes -k from allocator API examples and removes older -k tip text.
deploy-manage/deploy/cloud-enterprise/ece-configuring-ece-instance-configurations-create.md Adds ECE TLS important admonition; removes -k from instance configuration API examples.
deploy-manage/deploy/cloud-enterprise/ece-configuring-ece-create-templates.md Adds ECE TLS important admonition; removes -k from template API examples.
deploy-manage/deploy/cloud-enterprise/ece-configuring-ece-configure-system-templates.md Adds ECE TLS important admonition; removes -k from system template API examples.
deploy-manage/deploy/cloud-enterprise/ece-ce-add-support-for-integrations-server.md Adds ECE TLS important admonition; removes -k from template API examples.
deploy-manage/deploy/cloud-enterprise/deploy-small-installation.md Adds ECE TLS important admonition; removes -k from enrollment token curl example.
deploy-manage/deploy/cloud-enterprise/deploy-medium-installation.md Adds ECE TLS important admonition; removes -k from enrollment token curl example.
deploy-manage/deploy/cloud-enterprise/deploy-large-installation.md Adds ECE TLS important admonition; removes -k from enrollment token curl example.
deploy-manage/deploy/cloud-enterprise/configure-allocator-affinity.md Adds ECE TLS important admonition; removes -k from allocator affinity API examples.
deploy-manage/deploy/cloud-enterprise/ce-add-support-for-node-roles-autoscaling.md Adds ECE TLS important admonition; removes -k from deployment template API examples.
deploy-manage/autoscaling/autoscaling-in-ece-and-ech.md Adds ECE/ESS-scoped TLS admonitions inside applies-switch; removes -k from ECE autoscaling API example.
deploy-manage/api-keys/elastic-cloud-enterprise-api-keys.md Adds ECE TLS important admonition; removes -k from login API example.
Comments suppressed due to low confidence (1)

deploy-manage/autoscaling/autoscaling-in-ece-and-ech.md:676

  • The applies-switch block opens with 5 colons (:::::) but is closed with 4 (::::). This mismatched fence is likely to break MyST parsing / the docs build. Close the outer applies-switch with the same number of colons used to open it (and ensure nested applies-item blocks are closed before that).
::::

:::::


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread deploy-manage/remote-clusters/ece-remote-cluster-other-ece.md Outdated
Comment thread deploy-manage/monitor/autoops/autoops-sm-troubleshoot-firewalls.md Outdated
Comment thread troubleshoot/ingest/logstash/diagnostic.md Outdated
Comment thread troubleshoot/kibana/capturing-diagnostics.md
Comment thread troubleshoot/elasticsearch/diagnostic.md
marciw and others added 6 commits April 23, 2026 12:57
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@github-actions

This comment was marked as resolved.

@marciw marciw marked this pull request as ready for review April 23, 2026 18:04
@marciw marciw changed the title [WIP] Remove curl -k from examples and add certificate guidance Remove curl -k from examples and add certificate guidance Apr 23, 2026
leemthompo
leemthompo previously approved these changes Apr 24, 2026
Copy link
Copy Markdown
Member

@leemthompo leemthompo left a comment

Choose a reason for hiding this comment

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

[edit] @eedugon raised some concerns so dismissing my overhasty ✅ 😄

@leemthompo leemthompo dismissed their stale review April 24, 2026 09:04

overhasty review from me

Copy link
Copy Markdown
Contributor

@eedugon eedugon left a comment

Choose a reason for hiding this comment

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

I think we should create 2 snippets to be able to maintain this better in the future:

  • One snippet for the ECE message
  • One snippet for the more generic message
  • Maybe a snippet for ECK if we want to include the command to obtain the cluster CA (generated by ECK by default, shared in a comment).

Shared other comments for your consideration, for example I'd avoid saying valid certificate as that's unclear.

Comment thread deploy-manage/autoscaling/autoscaling-in-ece-and-ech.md Outdated
Comment thread deploy-manage/api-keys/elastic-cloud-enterprise-api-keys.md
Comment thread deploy-manage/deploy/cloud-on-k8s/elasticsearch-deployment-quickstart.md Outdated
Comment thread deploy-manage/deploy/cloud-on-k8s/quickstart-beats.md Outdated
Comment thread deploy-manage/monitor/autoops/autoops-sm-troubleshoot-firewalls.md Outdated
Copy link
Copy Markdown
Member

@theletterf theletterf left a comment

Choose a reason for hiding this comment

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

Approving to unblock

@marciw
Copy link
Copy Markdown
Member Author

marciw commented Apr 28, 2026

@eedugon Re: snippets, of course! I was always planning to do those in a follow-up PR, for ease of reviews and to limit the scope of this one. There's a method to my madness 🙂

opened https://github.com/elastic/docs-content-internal/issues/1125

@github-actions
Copy link
Copy Markdown
Contributor

Elastic Docs AI PR menu

Check the box to run an AI review for this pull request.

  • Review docs changes (docs-review). Status: not started.

Powered by GitHub Agentic Workflows and docs-actions. For more information, reach out to the docs team.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 28, 2026

Vale Linting Results

Summary: 3 warnings, 5 suggestions found

⚠️ Warnings (3)
File Line Rule Message
deploy-manage/deploy/cloud-enterprise/ce-add-support-for-node-roles-autoscaling.md 1430 Elastic.DontUse Don't use 'just'.
deploy-manage/deploy/cloud-enterprise/ece-configuring-ece-instance-configurations-create.md 74 Elastic.DirectionalLanguage Don't use directional language. Use 'the label of the element' instead of 'on the right'.
deploy-manage/remote-clusters/ece-remote-cluster-same-ece.md 218 Elastic.DontUse Don't use 'just'.
💡 Suggestions (5)
File Line Rule Message
deploy-manage/deploy/cloud-enterprise/ce-add-support-for-node-roles-autoscaling.md 1430 Elastic.Wordiness Consider using 'to' instead of 'in order to'.
deploy-manage/deploy/cloud-enterprise/ece-ce-add-support-for-integrations-server.md 14 Elastic.Wordiness Consider using 'to' instead of 'in order to'.
deploy-manage/deploy/cloud-enterprise/ece-configuring-ece-configure-system-templates.md 25 Elastic.Wordiness Consider using 'to' instead of 'in order to'.
deploy-manage/remote-clusters/ece-remote-cluster-same-ece.md 218 Elastic.Wordiness Consider using 'to' instead of 'In order to'.
troubleshoot/elasticsearch/diagnostic.md 31 Elastic.Versions Use 'or later' instead of 'or higher' when referring to versions.

The Vale linter checks documentation changes against the Elastic Docs style guide.

To use Vale locally or report issues, refer to Elastic style guide for Vale.

@marciw
Copy link
Copy Markdown
Member Author

marciw commented Apr 28, 2026

@eedugon @leemthompo please take another look when you have a moment. thank you!

i like to do snippets separately 🙃 🤷‍♀️

@marciw marciw requested review from eedugon and leemthompo April 28, 2026 23:46
Copy link
Copy Markdown
Contributor

@eedugon eedugon left a comment

Choose a reason for hiding this comment

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

Looks great! Thanks a lot for doing this!

Once this is merged ping me in private and I'll add a small add-on to the ECK quickstarts in a separate PR.

The add-on will consist on linking to the instructions to obtain the CA in ECK (which we have in a separate doc). But let's not lose time on that now.

Copy link
Copy Markdown
Member

@mdbirnstiehl mdbirnstiehl left a comment

Choose a reason for hiding this comment

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

Unblocking from Experience docs side.

Copy link
Copy Markdown
Member

@leemthompo leemthompo left a comment

Choose a reason for hiding this comment

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

🥌 🧹

@marciw marciw merged commit ee884cf into main May 12, 2026
11 of 12 checks passed
@marciw marciw deleted the mw-curlk-5776 branch May 12, 2026 13:43
@marciw marciw mentioned this pull request May 19, 2026
2 tasks
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.

[Website]: Insecurely Documents the use of curl -k which disables SSL/TLS verification

6 participants