-
Notifications
You must be signed in to change notification settings - Fork 278
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
Secure Package Installation #602
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 we really needed to do this! However as per my comment in #594 we need to install apt-transport-https
on debian based installs to avoid a breaking change.
CHANGELOG.md
Outdated
@@ -4,6 +4,7 @@ This file is used to track changes made in recent versions of the Sensu | |||
cookbook. Please see HISTORY.md for changes from older versions of this project. | |||
|
|||
## [Unreleased] | |||
* Enable gpg check for all linux repo installs using a key downloaded over HTTPS. Download windows MSI over HTTPS. #578 (@mike-stewart) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
recipes/_linux.rb
Outdated
@@ -23,9 +23,13 @@ | |||
when "debian" | |||
include_recipe "apt" | |||
|
|||
package 'apt-transport-https' do | |||
action :remove |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we need to install this not remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry - this was a test commit, just trying to validate an assumption on the Travis build.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, no problem if it is a wip then it's best to label the PR title with [WIP]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also sadly we never added travis and kitchen integration. It's something I want to add when I have the time.
@majormoses We shouldn't actually need to install I've confirmed this through a manual test on Ubuntu 16.04. With Let me know if this makes sense. I can dig into the test suite more later to try to prove this if necessary. |
@mike-stewart gotcha I read the title and the code and after seeing #594 I assumed it was the same deal. 👍 on merging whether we switch over later and agree that a
Nope I got you, I will run it through the test suites this weekend and if it looks good I will merge and release this before monday. I won't pretend to know much about windows but from what I read we should be good to use https. |
Sounds great. I hadn't noticed #594, but that would have some advantages as well. I decided to go with the least change required to get good security. From what I've read about apt, it's typically best from a compatibility perspective to allow package download over HTTP, as that doesn't break environments that use caching proxies for distributing packages. |
Validated this looks good with linux, the windows vagrant failed because of other reasons:
I say |
Description
Fixes /issues/578. This secures the package installation against MITM attacks for linux by downloading the GPG key over HTTPS.
I didn't change the linux repo URLs themselves as there is generally less benefit in downloading the packages over HTTPS given GPG checks. It requires an additional package in some cases, and it can get in the way of caching.
For Windows, I changed the package URL, as I'm not aware of a method to check package signatures there.
Motivation and Context
See #578.
How Has This Been Tested?
Executed tests.
Screenshots (if appropriate):
Types of changes
Checklist: