Jira (PUP-10368) Checksums not validated when downloading file http(s):// sources

0 views
Skip to first unread message

Reid Vandewiele (Jira)

unread,
Mar 13, 2020, 12:09:04 PM3/13/20
to puppe...@googlegroups.com
Reid Vandewiele created an issue
 
Puppet / Bug PUP-10368
Checksums not validated when downloading file http(s):// sources
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2020/03/13 9:08 AM
Priority: Normal Normal
Reporter: Reid Vandewiele

Puppet Version: all
OS Name/Version: all

When using a File resource with an http(s) source type and a checksum_value, Puppet does not validate that the content it downloads and puts into place matches the mandated checksum. This can cause Puppet to repeatedly re-download the file on every run, constantly reporting success, when in fact it is failing to retrieve the expected content.

Assume the following manifest.

file { '/tmp/file':
  ensure         => file,
  source         => 'http://httpstat.us/200',
  checksum       => 'sha256',
  checksum_value => 'ea8fac7c65fb589b0d53560f5251f74f9e9b243478dcb6b3ea79b5e36449c8d9',
  #checksum_value => 'f9bafc82ba5f8fb02b25020d66f396860604f496ca919480147fa525cb505d88',
}

Let the commented-out f9bafc8 checksum be correct, and ea8fac7 be incorrect.

Desired Behavior:

When Puppet applies this manifest and downloads f9bafc8 from http://httpstat.us/200, it should report failure. The content does not match the checksum_value parameter ea8fac7.

Actual Behavior:

When Puppet applies this manifest, it saves the f9bafc8 file and reports success. On subsequent runs it observes that the f9bafc8 content is present, does not match the required ea8fac7, re-downloads the f9bafc8 content from http://httpstat.us/200, and reports a successful change. It incorrectly reports that it changed the file content to ea8fac7.

The current behavior for three consecutive Puppet runs is shown below.

[reidmv@reids-mbp:~/Workspace/tmp/puppet-code/] % puppet apply test.pp
Notice: Compiled catalog for reids-macbook-pro.local in environment production in 0.02 seconds
Notice: /Stage[main]/Main/File[/tmp/file]/ensure: created
Notice: Applied catalog in 0.50 seconds
[reidmv@reids-mbp:~/Workspace/tmp/puppet-code/] % puppet apply test.pp
Notice: Compiled catalog for reids-macbook-pro.local in environment production in 0.02 seconds
Notice: /Stage[main]/Main/File[/tmp/file]/checksum_value: checksum_value changed 'f9bafc8...' to 'ea8fac7...'
Notice: Applied catalog in 0.67 seconds
[reidmv@reids-mbp:~/Workspace/tmp/puppet-code/] % puppet apply test.pp
Notice: Compiled catalog for reids-macbook-pro.local in environment production in 0.02 seconds
Notice: /Stage[main]/Main/File[/tmp/file]/checksum_value: checksum_value changed 'f9bafc8...' to 'ea8fac7...'
Notice: Applied catalog in 0.52 seconds

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Josh Cooper (Jira)

unread,
Mar 13, 2020, 12:50:02 PM3/13/20
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-10368
 
Re: Checksums not validated when downloading file http(s):// sources

I'm pretty sure this is a duplicate of PUP-8300, but I'll leave it open as there are a few different issues with http(s) file sources, which we will be fixing in the HTTP(S) File Sources epic: PUP-9910.

Josh Cooper (Jira)

unread,
Mar 13, 2020, 12:50:03 PM3/13/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Mar 13, 2020, 12:50:04 PM3/13/20
to puppe...@googlegroups.com

Reid Vandewiele (Jira)

unread,
Mar 13, 2020, 12:56:03 PM3/13/20
to puppe...@googlegroups.com
Reid Vandewiele commented on Bug PUP-10368
 
Re: Checksums not validated when downloading file http(s):// sources

This bug doesn't involve redirects or HEAD requests (manually supplied checksum), so I think it's probably not related to PUP-8300. The HTTP(S) epic does look like a good home for it though. 

Josh Cooper (Jira)

unread,
Jun 12, 2020, 9:03:03 PM6/12/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jun 30, 2020, 1:50:05 PM6/30/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sprint: Coremunity Hopper Platform Core KANBAN

Josh Cooper (Jira)

unread,
Jun 30, 2020, 1:50:06 PM6/30/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jun 30, 2020, 1:50:07 PM6/30/20
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jul 1, 2020, 1:17:03 PM7/1/20
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Release Notes: Bug Fix
Release Notes Summary: If a file resource has a desired checksum type and value, but the file downloaded from the remote source doesn't match, then puppet will now raise an error that they mismatch, and will not update the file on the local system.

Claire Cadman (Jira)

unread,
Jul 7, 2020, 9:51:04 AM7/7/20
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages