ca_certs: remove_defaults is undone by the next CA package update on p11-kit distros
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
Read the cloud-init changes referenced as #7250 and #7297, then inspect the rhel CA certificate handling and its tests to see how remove_defaults currently clears trust sources. Compare the proposed p11-kit module configuration override with blocklisting, including how each behaves on Fedora and Arch after a CA package update. Done means choosing and implementing an approach that keeps defaults excluded after updates, with tests covering the behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Bug report
On distros that use the p11-kit trust store (the RHEL family, and Arch in #7297), remove_defaults: true deletes the packaged CA source files. The package manager owns those files, so the next update or reinstall of the CA package puts them back, update-ca-trust runs from the package scriptlet/hook, and every default CA is trusted again. Nothing tells the user that the setting stopped working.
This came up as a known limitation in #7299 and #7297, but there is no issue for it yet.
Steps to reproduce the problem
Fedora 45 container (ca-certificates 2026.2.92). This removes the same trust sources that remove_default_ca_certs() clears for the rhel family once #7250 is in:
dnf -y download --destdir /tmp/pkg ca-certificates
B=/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem
grep -c BEGIN $B # 118
find /usr/share/pki/ca-trust-source /etc/pki/ca-trust/source -type f -delete
update-ca-trust; grep -c BEGIN $B # 0
rpm -Uvh --replacepkgs --nodeps /tmp/pkg/ca-certificates-*.rpm
grep -c BEGIN $B # 118 again
Same result on Arch (ca-certificates-mozilla 3.134-1) running the module itself from the #7297 branch with remove_defaults: true and one trusted CA: the bundle has 1 certificate, and after reinstalling ca-certificates-mozilla it has 114.
Possible fix
Instead of deleting package-owned files, limit p11-kit's trust paths to the local admin directory with a module config override, e.g. on Fedora:
# /etc/pkcs11/modules/p11-kit-trust.module
module: p11-kit-trust.so
x-init-reserved: paths=/etc/pki/ca-trust/source
(/etc/ca-certificates/trust-source on Arch.) I tested this by hand:
| Fedora 45 | Arch | |
|---|---|---|
| default | 118 | 113 |
override + trusted CA, after update-ca-trust |
1 | 1 |
| after reinstalling the CA package | 1 | 1 |
override file removed + update-ca-trust |
119 (118 + the trusted CA) |
The package files stay untouched, so updates don't undo the setting, CAs added by later package versions are excluded too, and removing one file reverts it. update-ca-trust extract and trust list both honour it. The override applies to every p11-kit consumer, which is what remove_defaults means anyway.
Another option is to blocklist the default CAs (.../source/blocklist/). That also survives updates, but it only covers the CAs present when cloud-init ran, not CAs added by later packages.
I'm happy to implement either one once #7250 and #7205 have landed, if you agree with the direction. Which approach would you prefer?
Environment details
- Cloud-init version: main (faa0d79), plus the #7297 branch for the Arch run
- Operating System Distribution: Fedora 45 and Arch Linux containers
- Cloud provider, platform or installer type: N/A (module behaviour, reproduced in containers)
cloud-init logs
Not applicable: the module succeeds. The defaults come back later, when the CA package is updated.
- Lingua principale
- Python
- Stelle
- 3.9k
- Fork
- 1.2k
- Merge medio
- 2g 24m
- PR unite (30g)
- 18
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di canonical/cloud-init
-
ssh_authorized_keys silently drops OpenSSH 10.6 ssh-mldsa44-ed25519 (post-quantum hybrid) keysAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
canonical/cloud-init#7303 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
canonical/cloud-init#7284 ·
I maintainer di solito rispondono entro 1 giorno
-
documentation new
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
canonical/cloud-init#7276 ·
I maintainer di solito rispondono entro 1 giorno
-
apt: an unavailable package given with a version is still passed to apt-get and fails the whole installForse già presa @HemanthGangula l’ha presa 3 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
canonical/cloud-init#7265 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Fails to setup IPv4 ephemeral network on IPv6-only EC2 instanceForse già presa @aayushostwal l’ha presa 5 giorni fa. Apertabug new
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
canonical/cloud-init#7253 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di canonical/cloud-init
Issue simili
-
Test: to_hijri() accepts datetime.datetime and uses only the date partForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertagood first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
omarelshamy25x/shamy-hijri#63 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
polish
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scoresForse già presa @AshutoshSingh840 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
UKGovernmentBEIS/control-arena#992 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
mvalentsev/awesome-free-ai-coding#70 ·
I maintainer di solito rispondono entro 1 giorno