Skip to content

Commit

Permalink
Add user data to downgrade the system-wide crypto policy
Browse files Browse the repository at this point in the history
See #69 for details.

Also add a command to the final provisioner to undo this change.
  • Loading branch information
jsf9k committed Oct 15, 2021
1 parent e0cda95 commit d2f3772
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/packer.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"Team": "VM Fusion - Development"
},
"type": "amazon-ebs",
"user_data_file": "src/user_data.txt",
"vpc_filter": {
"filters": {
"tag:Name": "AMI Build"
Expand Down Expand Up @@ -93,6 +94,7 @@
{
"execute_command": "chmod +x {{ .Path }}; sudo env {{ .Vars }} {{ .Path }} ; rm -f {{ .Path }}",
"inline": [
"update-crypto-policies --set DEFAULT",
"sed -i '/^users:/ {N; s/users:.*/users: []/g}' /etc/cloud/cloud.cfg",
"rm --force /etc/sudoers.d/90-cloud-init-users",
"rm --force /root/.ssh/authorized_keys",
Expand Down
5 changes: 5 additions & 0 deletions src/user_data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

# See https://github.com/cisagov/freeipa-server-packer/issues/69 and
# https://fedoraproject.org/wiki/Changes/StrongCryptoSettings2#Upgrade.2Fcompatibility_impact
update-crypto-policies --set DEFAULT:FEDORA32

0 comments on commit d2f3772

Please sign in to comment.