Comments (4)
current workaround, in my site_settings:
# https://github.com/facebook/chef-cookbooks/issues/63
node.default['fb_apt']['keyring'] = '/etc/apt/trusted.gpg.d/fb_keyring.gpg'
node.default['fb_apt']['keys'] = {}
from chef-cookbooks.
That didn't work... even with a fix I had to make, I had to make keyring
be nil to avoid it touching keys at all.
from chef-cookbooks.
OK so it gets a bit worse:
fb_apt
isn't passing--keyring #{keyring}
intoapt-key add
... but even if you do, it's totally ignored- As such, specifying a key will always give you an asymmetric bug - so the only sane way to do things is to never specify a keyring. This means we will see all loaded keys, and never try to load a key that's loaded. But it ALSO means all keys we want to mess with are loaded into
/etc/apt/trusted.gpg
, which is probably fine. - Debian has stopped putting any official keys in the main keyring - they are all in files in
/etc/apt/trusted.gpg.d/
, the keys I have on the main keyring are all from other repos I have - dropbox, bjn, etc.
So, I can see two paths forward:
Option 1
- Drop the
node['fb_apt']['keyring']
option - Pre-poluate the
keys
hash (atattribute
time) with all keys from "official" files (/etc/apt/trusted.gpg.d/debian-archive-*
and/etc/apt/trusted.gpg.d/ubuntu-keyring.*
) so that we don't try to delete them (it won't work anyway, it'll try to delete them from the main keyring and fail). - Then security-concious people could instead overwrite that as well as make their own rule to nuke
/etc/apt/trusted.gpg.d/*
, and put whatever keys they wanted trusted innode['fb_apt']['keys']
, but for everyone else, everything would "just work" - new keys would get added properly, keys dropped would be removed properly, and "official" keys would stay out of the way. - By default cleanup keyrings in
/etc/trusted.gpg.d
that are not owned by any rpm/deb. If we do this, keyids on files that aren't part of the OS but are part of a package ALSO need to be pre-populated.
Option 2
- Drop the
node['fb_apt']['keyring']
option - Not pre-populate
keys
, but instead have an option likepreserve_pkg_owned_keyrings
. It defaults to true- If it's true then in the provider, we build a hash like of file to keyids from the output of
apt-key finger
. Any file owned by a package, we preserve, any others we don't. We take the list of preserved keyids, along with any the user specified, and remove any keys still left over. - If it's false, we delete every single file in
/etc/trusted.gpg.d/
, and then hope the user has all necessary keyids in thekeys
hash. We can pre-populate some, but we're not going to always be on top of everytime debian or ubuntu adds a key (we're already missing ubuntu keys), so there should be big warnings to the user
- If it's true then in the provider, we build a hash like of file to keyids from the output of
Option 3
Stop trying to holistically manage keys altogether. Have a list of "keys" and "blacklisted_keys". We add keys if they're not there, and we remove blacklisted keys if they are there and on the main keyring (or if they're the only key on some other keyring).
My preference is option 1...
from chef-cookbooks.
Fixed in #66
from chef-cookbooks.
Related Issues (20)
- Small copy-pasta in the fb_ethtool README.md HOT 2
- fb_postfix should not default mydomain to fb.com
- fb_systemd::udevd fails on Ubuntu 20.04 LTS due to missing symlink HOT 1
- fb_vsftpd is broken on debian 9
- fix shellcheck issues in fb_ipset and fb_less
- fb_tmpclean doesn't include tmpreaper defaults on debian/ubuntu - breaks /tmp cleanup
- fb_network_scripts changes should be reflected in /var/chef/backup HOT 1
- fb_helpers_reboot lies about :now HOT 2
- validate the config in fb_apache HOT 8
- fb_storage always ignores override files when '_clowntown_override_file_method' not defined
- codemod internal library methods in fb_fstab to make it clear they're not part of the API
- fb_ntp shouldn't default to facebook timeservers HOT 18
- Enablement of `unified_mode` for v17+ Chef client compatibility HOT 4
- Fix CI failures HOT 2
- fb_helpers contains namespace collisions with official chef node objects HOT 14
- node.antlir_build? not defined in open source HOT 2
- Definitions for antlir2 fix are not exposed in open source HOT 2
- Compound API interactions for cookbooks included by `fb_init` are difficult to implement HOT 25
- Regression with recent log output change HOT 3
- fb_apt update HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chef-cookbooks.