Skip to content

test: fix e2e test for privileged builds#10873

Merged
milas merged 1 commit into
docker:v2from
milas:fix-e2e-build-privileged
Aug 3, 2023
Merged

test: fix e2e test for privileged builds#10873
milas merged 1 commit into
docker:v2from
milas:fix-e2e-build-privileged

Conversation

@milas

@milas milas commented Aug 3, 2023

Copy link
Copy Markdown
Contributor

What I did
We cannot guarantee the exact value of CapEff across environments, and this test has started failing some places, e.g. Docker Desktop, and now GitHub Actions (likely due to a kernel upgrade on the runners or similar).

By setting privileged: true on the build, we're asking for the security.insecure entitlement on the build. A safe assumption is that will include CAP_SYS_ADMIN, which won't be present otherwise, so mask the CapEff value and check for that.

It's worth noting that realistically, the build won't even be able to complete without the correct entitlement, since the Dockerfile uses RUN --security=insecure, so this is really an additional sanity check.

(not mandatory) A picture of a cute animal, if possible in relation to what you did
a cat escaping from a kennel

We cannot guarantee the exact value of `CapEff` across
environments, and this test has started failing some places,
e.g. Docker Desktop, and now GitHub Actions (likely due to
a kernel upgrade on the runners or similar).

By setting `privileged: true` on the build, we're asking for
the `security.insecure` entitlement on the build. A safe
assumption is that will include `CAP_SYS_ADMIN`, which won't
be present otherwise, so mask the `CapEff` value and check
for that.

It's worth noting that realistically, the build won't even
be able to complete without the correct entitlement, since the
`Dockerfile` uses `RUN --security=insecure`, so this is really
an additional sanity check.

Signed-off-by: Milas Bowman <[email protected]>
@milas
milas requested a review from a team August 3, 2023 13:57
@milas milas self-assigned this Aug 3, 2023
@milas
milas requested review from StefanScherer, glours, laurazard, ndeloof, nicksieger and ulyssessouza and removed request for a team August 3, 2023 13:57
@milas

milas commented Aug 3, 2023

Copy link
Copy Markdown
Contributor Author

h/t @neersighted for reminding me how capabilities work and suggesting this approach like a month ago

@glours glours 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.

👍

@milas
milas merged commit f94cb49 into docker:v2 Aug 3, 2023
@milas
milas deleted the fix-e2e-build-privileged branch August 3, 2023 16:23
kylos101 pushed a commit to gitpod-io/compose that referenced this pull request Aug 8, 2023
We cannot guarantee the exact value of `CapEff` across
environments, and this test has started failing some places,
e.g. Docker Desktop, and now GitHub Actions (likely due to
a kernel upgrade on the runners or similar).

By setting `privileged: true` on the build, we're asking for
the `security.insecure` entitlement on the build. A safe
assumption is that will include `CAP_SYS_ADMIN`, which won't
be present otherwise, so mask the `CapEff` value and check
for that.

It's worth noting that realistically, the build won't even
be able to complete without the correct entitlement, since the
`Dockerfile` uses `RUN --security=insecure`, so this is really
an additional sanity check.

Signed-off-by: Milas Bowman <[email protected]>
kylos101 pushed a commit to gitpod-io/compose that referenced this pull request Aug 8, 2023
We cannot guarantee the exact value of `CapEff` across
environments, and this test has started failing some places,
e.g. Docker Desktop, and now GitHub Actions (likely due to
a kernel upgrade on the runners or similar).

By setting `privileged: true` on the build, we're asking for
the `security.insecure` entitlement on the build. A safe
assumption is that will include `CAP_SYS_ADMIN`, which won't
be present otherwise, so mask the `CapEff` value and check
for that.

It's worth noting that realistically, the build won't even
be able to complete without the correct entitlement, since the
`Dockerfile` uses `RUN --security=insecure`, so this is really
an additional sanity check.

Signed-off-by: Milas Bowman <[email protected]>
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.

3 participants