Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change /boot/ignition/config.ign permissions to 0600 and delete it after provisioning #889

Closed
xlejo opened this issue Jul 6, 2021 · 19 comments
Assignees

Comments

@xlejo
Copy link

xlejo commented Jul 6, 2021

In the ignition file sometimes contains secrets and the best option maybe for this is denied access to unauthorized users.
The only way to access has to be through sudo or with the root account.

@bgilbert
Copy link
Contributor

bgilbert commented Jul 6, 2021

Thanks for reporting this. coreos-installer change in coreos/coreos-installer#571.

@travier
Copy link
Member

travier commented Jul 6, 2021

Given that we only leave the Ignition config in the coreos-installer case, maybe we should add a cleanup stage to Ignition / dracut to remove the config once Ignition has completed?

@jlebon
Copy link
Member

jlebon commented Jul 6, 2021

Given that we only leave the Ignition config in the coreos-installer case, maybe we should add a cleanup stage to Ignition / dracut to remove the config once Ignition has completed?

Or we do this as part of https://github.com/coreos/ignition/blob/main/systemd/ignition-firstboot-complete.service. That's the source of truth for whether Ignition has completed, and it already has /boot rw. There's a related issue to have it moved to f-c-c: coreos/ignition#1125.

@jlebon
Copy link
Member

jlebon commented Jul 7, 2021

This was discussed in today's meeting:

13:12:06 < bgilbert> #agreed we will change firstboot-complete to delete /boot/ignition/config.ign.
                     we will also add a systemd service that removes /boot/ignition/config.ign on
                     existing nodes, and ship that service until after the next barrier release.
                     in parallel, we will change coreos-installer to write
                     /boot/ignition/config.ign with mode 0600.

@jlebon jlebon removed the meeting topics for meetings label Jul 7, 2021
@jlebon
Copy link
Member

jlebon commented Jul 7, 2021

Also

13:19:59 < bgilbert> #agreed we will post to coreos-status about /etc mode bits and config.ign
                     mode bits, timing to be determined

@jlebon jlebon changed the title /boot/ignition/config.ign permissions 0644 to 0600 Change /boot/ignition/config.ign permissions to 0600 and delete it after provisioning Jul 7, 2021
jlebon added a commit to jlebon/fedora-coreos-config that referenced this issue Jul 7, 2021
Once we're done provisioning, nuke any baked Ignition config since it
may contain secrets. We nuke the whole dir in the name of keeping
`/boot` neat and tidy.

Part of coreos/fedora-coreos-tracker#889.
jlebon added a commit to jlebon/coreos-assembler that referenced this issue Jul 7, 2021
jlebon added a commit to jlebon/coreos-assembler that referenced this issue Jul 7, 2021
@bgilbert
Copy link
Contributor

bgilbert commented Jul 8, 2021

Actions:

bgilbert added a commit to coreos/fedora-coreos-config that referenced this issue Jul 8, 2021
On subsequent boots, if /boot/ignition is present, remove it.  This fixes
up old nodes with a world-readable Ignition config in /boot.

coreos/fedora-coreos-tracker#889
jlebon added a commit to coreos/fedora-coreos-config that referenced this issue Jul 8, 2021
Once we're done provisioning, nuke any baked Ignition config since it
may contain secrets. We nuke the whole dir in the name of keeping
`/boot` neat and tidy.

Part of coreos/fedora-coreos-tracker#889.
jlebon added a commit to jlebon/fedora-coreos-config that referenced this issue Jul 13, 2021
jlebon added a commit to coreos/fedora-coreos-config that referenced this issue Jul 13, 2021
jlebon added a commit to jlebon/coreos-assembler that referenced this issue Jul 15, 2021
jlebon added a commit to coreos/coreos-assembler that referenced this issue Jul 16, 2021
@travier
Copy link
Member

travier commented Jul 16, 2021

coreos-status text for #829: https://hackmd.io/0_DtZQLhSxCjzaszinudqg

@dustymabe
Copy link
Member

Maybe include something in the text about the issue being resolved if you are following the latest updates etc.. and maybe mention what version the issue was fixed in.

@travier
Copy link
Member

travier commented Jul 21, 2021

Updated to address comments

@dustymabe
Copy link
Member

Updated to address comments

Looks mostly good to me. Maybe only add a little extra here highlighting "no action required":

New installations starting from version 34.20210611.3.0 (stable) and 34.20210611.2.0 (testing) and later are unaffected. If you have automatic updates enabled all existing systems have been automatically fixed on bootup after the update to those versions and no action is required.

Also, should we mention the next version too, since some percentage of people run that stream too.

@travier
Copy link
Member

travier commented Jul 23, 2021

Thanks, updated. I've also merged all find commands into one which should make it easier but this should be double checked.

@travier
Copy link
Member

travier commented Jul 23, 2021

See also coreos/fedora-coreos-config#1134

ravanelli pushed a commit to ravanelli/coreos-assembler that referenced this issue Aug 25, 2021
@bgilbert
Copy link
Contributor

(Belatedly) added a description of this issue to the draft coreos-status post in https://hackmd.io/0_DtZQLhSxCjzaszinudqg.

@dustymabe
Copy link
Member

The fix for this went into next stream release 34.20210711.1.1. Please try out the new release and report issues.

@dustymabe
Copy link
Member

dustymabe commented Oct 21, 2021

The fix for this went into testing stream release 34.20210711.2.0. Please try out the new release and report issues.

@dustymabe
Copy link
Member

The fix for this went into stable stream release 34.20210711.3.0.

@xlejo
Copy link
Author

xlejo commented Nov 1, 2021

Seems to work well. Tested with new instances and old instances updated. The /boot/ignition is gone.

For me, this issue is more than solved :)

@bgilbert
Copy link
Contributor

bgilbert commented Nov 9, 2021

This is now CVE-2021-3917.

@bgilbert
Copy link
Contributor

coreos-status post sent!

HuijingHei pushed a commit to HuijingHei/fedora-coreos-config that referenced this issue Oct 10, 2023
On subsequent boots, if /boot/ignition is present, remove it.  This fixes
up old nodes with a world-readable Ignition config in /boot.

coreos/fedora-coreos-tracker#889
HuijingHei pushed a commit to HuijingHei/fedora-coreos-config that referenced this issue Oct 10, 2023
Once we're done provisioning, nuke any baked Ignition config since it
may contain secrets. We nuke the whole dir in the name of keeping
`/boot` neat and tidy.

Part of coreos/fedora-coreos-tracker#889.
HuijingHei pushed a commit to HuijingHei/fedora-coreos-config that referenced this issue Oct 10, 2023
HuijingHei pushed a commit to HuijingHei/fedora-coreos-config that referenced this issue Oct 10, 2023
On subsequent boots, if /boot/ignition is present, remove it.  This fixes
up old nodes with a world-readable Ignition config in /boot.

coreos/fedora-coreos-tracker#889
HuijingHei pushed a commit to HuijingHei/fedora-coreos-config that referenced this issue Oct 10, 2023
Once we're done provisioning, nuke any baked Ignition config since it
may contain secrets. We nuke the whole dir in the name of keeping
`/boot` neat and tidy.

Part of coreos/fedora-coreos-tracker#889.
HuijingHei pushed a commit to HuijingHei/fedora-coreos-config that referenced this issue Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants