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

update list of root certificates that Chef client trusts #43370

Merged
merged 4 commits into from Nov 10, 2021

Conversation

sureshc
Copy link
Contributor

@sureshc sureshc commented Nov 4, 2021

https://codedotorg.atlassian.net/browse/INF-492

Testing story

Provisioning a new adhoc works:
bundle exec rake adhoc:start RAILS_ENV=adhoc

excerpt from /var/log/chef-bootstrap-debug.log:

  * remote_file[/etc/chef/local-mode-cache/cache/pdftk-java_3.1.1-1_all.deb] action create
    - create new file /etc/chef/local-mode-cache/cache/pdftk-java_3.1.1-1_all.deb
    - update content in file /etc/chef/local-mode-cache/cache/pdftk-java_3.1.1-1_all.deb from none to 8a28ba
    (new content is binary, diff output suppressed)
  * apt_package[default-jre-headless, libbcprov-java, libcommons-lang3-java] action install
    - install version 2:1.11-68ubuntu1~18.04.1 of package default-jre-headless
    - install version 1.59-1 of package libbcprov-java
    - install version 3.8-1~18.04.2 of package libcommons-lang3-java
  * dpkg_package[pdftk-java] action install
    - install version 3.1.1-1 of package pdftk-java

An existing adhoc (that runs local mode chef):

  1. Created feature branch test-update-chef-certs-on-existing-instance With a commit to comment out installation of pdftk-java package
  2. Successfully provisioned an adhoc and verified it has the old root certificate file embedded in the Chef client
  3. Added a commit that replaces the Chef embedded root certificate on an existing “local mode” system with a newer one from our repository each time /aws/ci_build runs. Also merged in update-chef-trusted-root-certificates And a commit that re-enabled installation of pdftk-java package and pushed to origin
  4. Existing adhoc picked up the new commits and rebuilt it self and correctly replaced the root certificate embedded in the Chef client.
  5. However dpkg -s pdftk-java showed that the the package was not installed. It appears that for an existing local mode EC2 Instance, we do not re-run Chef client with each build to apply new commits.
  6. Manually ran chef client to apply cookbook updates (sudo /opt/chef/bin/chef-client --chef-license accept-silent) and verified with dpkg -s pdftk-java that the package was installed.

Deployment strategy

Follow-up work

Should we modify our build process to run Chef client for existing local mode environments each time a build runs?

Privacy

Security

Caching

PR Checklist:

  • Tests provide adequate coverage
  • Privacy and Security impacts have been assessed
  • Code is well-commented
  • New features are translatable or updates will not break translations
  • Relevant documentation has been added or updated
  • User impact is well-understood and desirable
  • Pull Request is labeled appropriately
  • Follow-up work items (including potential tech debt) are tracked and linked

@sureshc sureshc requested a review from a team November 5, 2021 16:41
Copy link
Contributor

@Hamms Hamms left a comment

Choose a reason for hiding this comment

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

This change looks good to me, and your validation process seems thorough!

I think it would make sense to do a full chef run on each build. That's the way chef expects to be used, after all. But I also expect that we'll have to do some work to make that a practical solution.

@Hamms Hamms added the Chef Upgrade Work related to upgrading between major versions of chef label Nov 5, 2021
@sureshc sureshc merged commit e0fd769 into staging Nov 10, 2021
@sureshc sureshc deleted the update-chef-trusted-root-certificates branch November 10, 2021 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Chef Upgrade Work related to upgrading between major versions of chef
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants