Skip to content

Backport of NET-5186 Fix issue where consul-dataplane attempts to write to a read-only file system location into release/1.0.x#254

Merged
nathancoleman merged 1 commit intorelease/1.0.xfrom
backport/setcap-envoy-only/manually-master-badger
Sep 5, 2023
Merged

Backport of NET-5186 Fix issue where consul-dataplane attempts to write to a read-only file system location into release/1.0.x#254
nathancoleman merged 1 commit intorelease/1.0.xfrom
backport/setcap-envoy-only/manually-master-badger

Conversation

@hc-github-team-consul-core
Copy link
Collaborator

@hc-github-team-consul-core hc-github-team-consul-core commented Sep 1, 2023

Backport

This PR is auto-generated from #253 to be assessed for backporting due to the inclusion of the label backport/1.0.

The below text is copied from the body of the original PR.


Running setcap on the consul-dataplane binary results in a process that cannot see the TMPDIR envar intended to influence where the envoy bootstrap config is written to. This is due to a previously-uknown-to-us side effect of glibc, described here.

As a result, it attempts to write to the /tmp directory instead of /consul/connect-inject -- configured for injected sidecars here -- and gets a read-only file system error.

We previously considered dropping setcap for the consul-dataplane binary; however, the envoy binary that is forked from dataplane cannot itself have a capability that the consul-dataplane process does not have.

Instead, I've opted to keep setcap net_bind_service for both envoy and consul-dataplane. We can work around the fact that TMPDIR is invisible to consul-dataplane by not writing to the file system at all and using envoy --config-yaml <yaml or json string> where we were previously using envoy --config-path <string>.


Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/setcap-envoy-only/manually-master-badger branch from 705c8ac to fbaec06 Compare September 1, 2023 20:47
@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/setcap-envoy-only/manually-master-badger branch from fbaec06 to 705c8ac Compare September 1, 2023 20:47
@nathancoleman nathancoleman force-pushed the backport/setcap-envoy-only/manually-master-badger branch from 705c8ac to fc7a943 Compare September 1, 2023 21:05
@nathancoleman nathancoleman marked this pull request as ready for review September 1, 2023 21:06
@nathancoleman nathancoleman requested a review from a team as a code owner September 1, 2023 21:06
Copy link
Member

@nathancoleman nathancoleman left a comment

Choose a reason for hiding this comment

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

Matches source PR other than changes around FIPS envoy

@nathancoleman nathancoleman merged commit 8cb8701 into release/1.0.x Sep 5, 2023
@nathancoleman nathancoleman deleted the backport/setcap-envoy-only/manually-master-badger branch September 5, 2023 17:28
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.

2 participants