Skip to content

lifecycle/container: remove curl and perl from the container image - #23953

Closed
emilburzo wants to merge 1 commit into
mainfrom
remove-curl-and-perl-from-docker
Closed

emilburzo wants to merge 1 commit into
mainfrom
remove-curl-and-perl-from-docker

Conversation

@emilburzo

@emilburzo emilburzo commented Jul 13, 2026 •

Copy link
Copy Markdown
Member

Reduces CRITICAL/HIGH vulnerabilities from 80 to 20:

Before

 ✔ Scanned for vulnerabilities     [276 vulnerability matches]
   ├── by severity: 26 critical, 54 high, 60 medium, 5 low, 95 negligible (36 unknown)
   └── by status:   5 fixed, 271 not-fixed, 0 ignored

After:

 ✔ Scanned for vulnerabilities     [194 vulnerability matches]
   ├── by severity: 2 critical, 18 high, 50 medium, 5 low, 83 negligible (36 unknown)
   └── by status:   5 fixed, 189 not-fixed, 0 ignored

Details

Container image security scanners like grype or trivy report even CVEs which have no fixes, like these curl/perl ones:

curl                8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-11856       Critical    1.1% (60th)   1.0
curl                8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-9079        Critical    1.1% (60th)   1.0
libcurl4t64         8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-11856       Critical    1.1% (60th)   1.0
libcurl4t64         8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-9079        Critical    1.1% (60th)   1.0
curl                8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-10536       Critical    0.9% (55th)   0.8
libcurl4t64         8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-10536       Critical    0.9% (55th)   0.8
curl                8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-8927        Critical    0.8% (50th)   0.7
libcurl4t64         8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-8927        Critical    0.8% (50th)   0.7
curl                8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-8924        Critical    0.6% (46th)   0.6
libcurl4t64         8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-8924        Critical    0.6% (46th)   0.6
curl                8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-8926        Critical    0.6% (45th)   0.6
libcurl4t64         8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-8926        Critical    0.6% (45th)   0.6
curl                8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-12064       High        0.6% (43rd)   0.4
libcurl4t64         8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-12064       High        0.6% (43rd)   0.4
curl                8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-8286        High        0.5% (40th)   0.4
libcurl4t64         8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-8286        High        0.5% (40th)   0.4
libperl5.40         5.40.1-6                              (won't fix)  deb     CVE-2026-42496       Critical    0.4% (34th)   0.4
perl                5.40.1-6                              (won't fix)  deb     CVE-2026-42496       Critical    0.4% (34th)   0.4
perl-base           5.40.1-6                              (won't fix)  deb     CVE-2026-42496       Critical    0.4% (34th)   0.4
perl-modules-5.40   5.40.1-6                              (won't fix)  deb     CVE-2026-42496       Critical    0.4% (34th)   0.4
curl                8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-9547        High        0.5% (39th)   0.4
libcurl4t64         8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-9547        High        0.5% (39th)   0.4
libperl5.40         5.40.1-6                              (won't fix)  deb     CVE-2026-8376        Critical    0.4% (31st)   0.4
perl                5.40.1-6                              (won't fix)  deb     CVE-2026-8376        Critical    0.4% (31st)   0.4
perl-base           5.40.1-6                              (won't fix)  deb     CVE-2026-8376        Critical    0.4% (31st)   0.4
perl-modules-5.40   5.40.1-6                              (won't fix)  deb     CVE-2026-8376        Critical    0.4% (31st)   0.4
curl                8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-9080        High        0.5% (38th)   0.4
libcurl4t64         8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-9080        High        0.5% (38th)   0.4
libperl5.40         5.40.1-6                                           deb     CVE-2026-12087       Critical    0.4% (31st)   0.4
perl                5.40.1-6                                           deb     CVE-2026-12087       Critical    0.4% (31st)   0.4
perl-base           5.40.1-6                                           deb     CVE-2026-12087       Critical    0.4% (31st)   0.4
perl-modules-5.40   5.40.1-6                                           deb     CVE-2026-12087       Critical    0.4% (31st)   0.4
libperl5.40         5.40.1-6                              (won't fix)  deb     CVE-2026-9538        High        0.4% (35th)   0.3
perl                5.40.1-6                              (won't fix)  deb     CVE-2026-9538        High        0.4% (35th)   0.3
perl-base           5.40.1-6                              (won't fix)  deb     CVE-2026-9538        High        0.4% (35th)   0.3
perl-modules-5.40   5.40.1-6                              (won't fix)  deb     CVE-2026-9538        High        0.4% (35th)   0.3
libperl5.40         5.40.1-6                              (won't fix)  deb     CVE-2026-42497       High        0.4% (33rd)   0.3
perl                5.40.1-6                              (won't fix)  deb     CVE-2026-42497       High        0.4% (33rd)   0.3
perl-base           5.40.1-6                              (won't fix)  deb     CVE-2026-42497       High        0.4% (33rd)   0.3
perl-modules-5.40   5.40.1-6                              (won't fix)  deb     CVE-2026-42497       High        0.4% (33rd)   0.3
curl                8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-8458        Medium      0.5% (41st)   0.3
libcurl4t64         8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-8458        Medium      0.5% (41st)   0.3
curl                8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-9545        High        0.4% (32nd)   0.3
libcurl4t64         8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-9545        High        0.4% (32nd)   0.3
libperl5.40         5.40.1-6                                           deb     CVE-2026-48959       High        0.4% (29th)   0.3
perl                5.40.1-6                                           deb     CVE-2026-48959       High        0.4% (29th)   0.3
perl-base           5.40.1-6                                           deb     CVE-2026-48959       High        0.4% (29th)   0.3
perl-modules-5.40   5.40.1-6                                           deb     CVE-2026-48959       High        0.4% (29th)   0.3
curl                8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-8932        High        0.4% (28th)   0.3
libcurl4t64         8.14.1-2+deb13u4                      (won't fix)  deb     CVE-2026-8932        High        0.4% (28th)   0.3
libperl5.40         5.40.1-6                                           deb     CVE-2026-48962       High        0.3% (21st)   0.2
perl                5.40.1-6                                           deb     CVE-2026-48962       High        0.3% (21st)   0.2
perl-base           5.40.1-6                                           deb     CVE-2026-48962       High        0.3% (21st)   0.2
perl-modules-5.40   5.40.1-6                                           deb     CVE-2026-48962       High        0.3% (21st)   0.2
libperl5.40         5.40.1-6                                           deb     CVE-2026-48961       High        0.3% (17th)   0.2
perl                5.40.1-6                                           deb     CVE-2026-48961       High        0.3% (17th)   0.2
perl-base           5.40.1-6                                           deb     CVE-2026-48961       High        0.3% (17th)   0.2
perl-modules-5.40   5.40.1-6                                           deb     CVE-2026-48961       High        0.3% (17th)   0.2
libperl5.40         5.40.1-6                                           deb     CVE-2026-7017        High        0.3% (17th)   0.2
perl                5.40.1-6                                           deb     CVE-2026-7017        High        0.3% (17th)   0.2
perl-base           5.40.1-6                                           deb     CVE-2026-7017        High        0.3% (17th)   0.2
perl-modules-5.40   5.40.1-6                                           deb     CVE-2026-7017        High        0.3% (17th)   0.2
libperl5.40         5.40.1-6                                           deb     CVE-2026-7010        Medium      0.2% (13th)   0.1
perl                5.40.1-6                                           deb     CVE-2026-7010        Medium      0.2% (13th)   0.1
perl-base           5.40.1-6                                           deb     CVE-2026-7010        Medium      0.2% (13th)   0.1
perl-modules-5.40   5.40.1-6                                           deb     CVE-2026-7010        Medium      0.2% (13th)   0.1
libperl5.40         5.40.1-6                                           deb     CVE-2025-15649       Medium      0.1% (2nd)    < 0.1
perl                5.40.1-6                                           deb     CVE-2025-15649       Medium      0.1% (2nd)    < 0.1
perl-base           5.40.1-6                                           deb     CVE-2025-15649       Medium      0.1% (2nd)    < 0.1
perl-modules-5.40   5.40.1-6                                           deb     CVE-2025-15649       Medium      0.1% (2nd)    < 0.1
libperl5.40         5.40.1-6                                           deb     CVE-2011-4116        Negligible  0.5% (40th)   < 0.1
perl                5.40.1-6                                           deb     CVE-2011-4116        Negligible  0.5% (40th)   < 0.1
perl-base           5.40.1-6                                           deb     CVE-2011-4116        Negligible  0.5% (40th)   < 0.1
perl-modules-5.40   5.40.1-6                                           deb     CVE-2011-4116        Negligible  0.5% (40th)   < 0.1
curl                8.14.1-2+deb13u4                                   deb     CVE-2025-15079       Negligible  0.5% (36th)   < 0.1
libcurl4t64         8.14.1-2+deb13u4                                   deb     CVE-2025-15079       Negligible  0.5% (36th)   < 0.1
curl                8.14.1-2+deb13u4                                   deb     CVE-2025-15224       Negligible  0.4% (33rd)   < 0.1
libcurl4t64         8.14.1-2+deb13u4                                   deb     CVE-2025-15224       Negligible  0.4% (33rd)   < 0.1
curl                8.14.1-2+deb13u4                                   deb     CVE-2025-10966       Negligible  0.4% (31st)   < 0.1
libcurl4t64         8.14.1-2+deb13u4                                   deb     CVE-2025-10966       Negligible  0.4% (31st)   < 0.1
curl                8.14.1-2+deb13u4                                   deb     CVE-2025-14017       Negligible  0.1% (1st)    < 0.1
libcurl4t64         8.14.1-2+deb13u4                                   deb     CVE-2025-14017       Negligible  0.1% (1st)    < 0.1

Since we only use these at build time, they should be removed from the runtime image (at least until we have separate build/runtime images), which also reduces the attack surface.

@emilburzo emilburzo self-assigned this Jul 13, 2026
@netlify

netlify Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-storybook ready!

Name Link
🔨 Latest commit 1f95fc8
🔍 Latest deploy log https://app.netlify.com/projects/authentik-storybook/deploys/6a54edde2934d00008d4d12e
😎 Deploy Preview https://deploy-preview-23953--authentik-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-integrations ready!

Name Link
🔨 Latest commit 1f95fc8
🔍 Latest deploy log https://app.netlify.com/projects/authentik-integrations/deploys/6a54edde9c105600080e6f28
😎 Deploy Preview https://deploy-preview-23953--authentik-integrations.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify

netlify Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 1f95fc8
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6a54eddefc0f810008229fc7
😎 Deploy Preview https://deploy-preview-23953--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@emilburzo
emilburzo force-pushed the remove-curl-and-perl-from-docker branch from cc5a966 to 1f95fc8 Compare July 13, 2026 13:53
@codecov

codecov Bot commented Jul 13, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.21%. Comparing base (bc65b25) to head (1f95fc8).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #23953      +/-   ##
==========================================
+ Coverage   93.15%   93.21%   +0.06%     
==========================================
  Files        1037     1045       +8     
  Lines       60783    61207     +424     
  Branches        0      424     +424     
==========================================
+ Hits        56621    57055     +434     
+ Misses       4162     4152      -10     
Flag Coverage Δ
conformance 36.21% <ø> (+0.30%) ⬆️
e2e 41.38% <ø> (?)
integration 32.14% <ø> (-0.49%) ⬇️
rust 0.00% <ø> (?)
unit 92.35% <ø> (+7.30%) ⬆️
unit-migrate 92.39% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@github-actions

Copy link
Copy Markdown
Contributor

authentik PR Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-1f95fc828052e56df940ea597b1db62b927f4d44
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

authentik:
    outposts:
        container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
    image:
        repository: ghcr.io/goauthentik/dev-server
        tag: gh-1f95fc828052e56df940ea597b1db62b927f4d44

Afterwards, run the upgrade commands from the latest release notes.

@emilburzo
emilburzo marked this pull request as ready for review July 13, 2026 14:22
@emilburzo
emilburzo requested a review from a team as a code owner July 13, 2026 14:22
Copilot AI review requested due to automatic review settings July 13, 2026 14:22
chown authentik:authentik /certs /data /data/media /media /authentik/.ssh /ak-root
chown authentik:authentik /certs /data /data/media /media /authentik/.ssh /ak-root && \
# remove runtime-unused packages until we have separate build/run images
dpkg --purge --force-remove-essential --force-depends \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

why not apt remove --purge -y?

@emilburzo emilburzo Jul 13, 2026 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

because it also removes runit, which we need for priv drop (chpst), until we find an alternative

the dependency chain is: runit -> sysuser-helper -> perl

Copilot AI 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.

Pull request overview

This PR reduces the vulnerability footprint of the authentik runtime container image by removing build-time-only packages (notably curl and perl) from the final stage, aiming to lower reported CRITICAL/HIGH CVEs and shrink attack surface.

Changes:

  • Adds a package-removal step in the final image build to purge curl, libcurl, and perl-related packages after setup.
  • Keeps the runtime package install set focused on libraries needed for server operation and healthchecking.

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

Comment on lines +262 to +264
# remove runtime-unused packages until we have separate build/run images
dpkg --purge --force-remove-essential --force-depends \
curl libcurl4t64 perl perl-base perl-modules-5.40 libperl5.40 sysuser-helper

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We can't use apt because it would also remove runit. It's a valid point but I'm not sure there's a good solution for it.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Well, there is one alternative, we stop depending on chpst from runit, so nothing would pull in perl anymore.

@emilburzo

Copy link
Copy Markdown
Member Author

Closing in favor of #24008

@emilburzo emilburzo closed this Jul 14, 2026
@emilburzo
emilburzo deleted the remove-curl-and-perl-from-docker branch July 14, 2026 11:19
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