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

Upgrade select CyHy instances from Debian Bullseye to Debian Bookworm #746

Merged
merged 4 commits into from
Mar 6, 2024

Conversation

mcdonnnj
Copy link
Member

@mcdonnnj mcdonnnj commented Feb 15, 2024

🗣 Description

This pull request is focused on basing the bastion, docker, nessus, and nmap AMIs on Debian Bookworm (latest release) instead of Debian Bullseye. This includes updating the AMI configurations, adjusting metadata for Ansible roles defined in this project, and adjusting the cloud-init configurations.

This mirrors the work in cisagov/skeleton-packer#242.

💭 Motivation and context

It is good to stay up-to-date and all of the instances being updated have public IPs so it is extra important to update them accordingly.

🧪 Testing

Automated tests pass. I deployed this configuration in my test environment and verified that I was able to reach the new instances over SSH and that the cyhy-commander functioned as expected with the new scanner instances.

✅ Pre-approval checklist

  • This PR has an informative and human-readable title.
  • Changes are limited to a single goal - eschew scope creep!
  • All relevant type-of-change labels have been added.
  • I have read the CONTRIBUTING document.
  • These code changes follow cisagov code standards.
  • All relevant repo and/or project documentation has been updated
    to reflect the changes in this PR.
  • All new and existing tests pass.

mcdonnnj and others added 4 commits January 5, 2024 14:28
With the release of Debian Bookworm on 2023-06-10 it makes sense to
migrate our Debian Bullseye Packer configurations to Debian Bookworm.
Update the platforms supported for all of the Ansible roles defined in
this repository.
We prefer to install the system package for Python packages whenever
possible. This is especially important with Debian Bookworm because you
cannot modify the system Python environment directly (with pip) by
default. Switching from installing the pexpect package directly with pip
to installing the python3-pexpect package is a suitable resolution.
Debian Bookworm switches DNS management from resolvconf to
systemd-resolved. This change results in Bookworm instances having an
incompatible hostname resolution configuration. Since we rely on
cloud-init to automatically configure some of our DNS settings we need
to adjust the configuration of Netplan (used by cloud-init) to get the
correct configuration for our system.

The issue is that Netplan uses a default of false for the value of
dhcp4-overrides.use-domains and cloud-init does not explicitly set this
key or provide a means to do so. We remedy this by modifying the
cloud-init configuration of Bookworm instances to use a Python script
to adjust the Netplan configuration and then re-apply Netplan to enable
our desired configuration.

Co-authored-by: Shane Frasier <[email protected]>
@mcdonnnj mcdonnnj added improvement This issue or pull request will add or improve functionality, maintainability, or ease of use terraform Pull requests that update Terraform code ansible Pull requests that update Ansible code packer Pull requests that update Packer code labels Feb 15, 2024
@mcdonnnj mcdonnnj self-assigned this Feb 15, 2024
Copy link
Member

@dav3r dav3r left a comment

Choose a reason for hiding this comment

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

Fantastic- thanks for getting this done! 💪 💼

Copy link
Member

@jsf9k jsf9k left a comment

Choose a reason for hiding this comment

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

Thanks for taking care of this.

@mcdonnnj mcdonnnj merged commit 4b794f2 into develop Mar 6, 2024
8 checks passed
@mcdonnnj mcdonnnj deleted the improvement/bullseye_to_bookworm branch March 6, 2024 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ansible Pull requests that update Ansible code improvement This issue or pull request will add or improve functionality, maintainability, or ease of use packer Pull requests that update Packer code terraform Pull requests that update Terraform code
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants