<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 11, 2017 at 1:35 PM, Laurentiu Pancescu <span dir="ltr"><<a href="mailto:lpancescu@centosproject.org" target="_blank">lpancescu@centosproject.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi there,<br>
<br>
Emmanuel Kasper of the Debian Cloud Team contacted me about two days ago: they discovered that Vagrant simply ignores any --checksum parameter when adding the box.  You can even provide "1234" instead of a valid SHA256 sum, and Vagrant will just add the downloaded box, without any warning or error whatsoever:<br></blockquote><div><br></div><div>is this an open bug against vagrant?</div><div>By reading <a href="https://github.com/hashicorp/vagrant/issues/8714#issuecomment-311240889">https://github.com/hashicorp/vagrant/issues/8714#issuecomment-311240889</a> it seems that vagrant people are providing checksum verification</div><div><br></div><div>"<span style="color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">When the author of the ubuntu box created the entry in atlas, they provided a remote link for the download instead of storing the box within atlas. This is why Vagrant redirects to an HTTP connection, because it was instructed to do so. Vagrant will also checksum the box if the information is provided within the boxes metadata. If the owner does not provide that data, Vagrant will not perform the checksum."</span></div><div><span style="color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px"><br></span></div><div><span style="color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">Cheers</span></div><div><span style="color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px"><br></span></div><div><span style="color:rgb(36,41,46);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";font-size:14px">Marcin</span></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
vagrant box add --checksum-type sha256 --checksum 1234 --provider<br>
libvirt --box-version 1710.01 centos/7<br>
<br>
==> box: Loading metadata for box 'centos/7'<br>
    box: URL: <a href="https://atlas.hashicorp.com/centos/7" rel="noreferrer" target="_blank">https://atlas.hashicorp.com/ce<wbr>ntos/7</a><br>
==> box: Adding box 'centos/7' (v1710.01) for provider: libvirt<br>
    box: Downloading:<br>
<a href="https://vagrantcloud.com/centos/boxes/7/versions/1710.01/providers/libvirt.box" rel="noreferrer" target="_blank">https://vagrantcloud.com/cento<wbr>s/boxes/7/versions/1710.01/<wbr>providers/libvirt.box</a><br>
==> box: Successfully added box 'centos/7' (v1710.01) for 'libvirt'!<br>
<br>
echo $?<br>
0<br>
<br>
Our signatures are basically useless for most users: Vagrant will only check the signature if one is included in the metadata (which is not the one in the box we host, but generated by Vagrant Cloud, formerly known as Atlas - there's simply no way to get Hashicorp's servers to include the checksum, not even for the boxes they host themselves).  The --checksum argument is honored if you add a raw box, but I doubt our users would be willing to do that, even if they knew about it:<br>
<br>
$ vagrant box add --checksum-type sha256 --checksum 1234 --name c7tmp <a href="https://cloud.centos.org/centos/7/vagrant/x86_64/images/CentOS-7-x86_64-Vagrant-1710_01.Libvirt.box" rel="noreferrer" target="_blank">https://cloud.centos.org/cento<wbr>s/7/vagrant/x86_64/images/<wbr>CentOS-7-x86_64-Vagrant-1710_<wbr>01.Libvirt.box</a><br>
==> box: Box file was not detected as metadata. Adding it directly...<br>
==> box: Adding box 'c7tmp' (v0) for provider:<br>
    box: Downloading: <a href="https://cloud.centos.org/centos/7/vagrant/x86_64/images/CentOS-7-x86_64-Vagrant-1710_01.Libvirt.box" rel="noreferrer" target="_blank">https://cloud.centos.org/cento<wbr>s/7/vagrant/x86_64/images/<wbr>CentOS-7-x86_64-Vagrant-1710_<wbr>01.Libvirt.box</a><br>
    box: Calculating and comparing box checksum...<br>
The checksum of the downloaded box did not match the expected<br>
value. Please verify that you have the proper URL setup and that<br>
you're downloading the proper file.<br>
<br>
Expected: 1234<br>
Received: 9d1ddb812de88578326538d69fdd5f<wbr>59ba68adf04862144300c42d0293f6<wbr>1d2f<br>
$ echo $?<br>
1<br>
<br>
<br>
Another possibility would be to also host the metadata ourselves, along with the raw boxes, on <a href="http://cloud.centos.org" rel="noreferrer" target="_blank">cloud.centos.org</a>.  Endymion can already generate the needed metadata, and I already verified that Vagrant works properly with it, even detecting newer versions of the boxes for updates.  The problem of convincing our users to use a cloud.c.o URL instead of Atlas still remains.<br>
<br>
I guess I'll have to replace the section in our future release announcements about verifying the images downloaded from Atlas with some sort of warning.  Any other ideas of what we could do?  Vagrant's behavior is described in its documentation, so I assume it's by design.<br>
<br>
How about adding the missing Vagrant functionality as distro patches, if upstream doesn't want to?<br>
<br>
Regards,<br>
Laurențiu<br>
<br>
<br>
<a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=878759" rel="noreferrer" target="_blank">https://bugs.debian.org/cgi-bi<wbr>n/bugreport.cgi?bug=878759</a><br>
<a href="https://github.com/lpancescu/endymion" rel="noreferrer" target="_blank">https://github.com/lpancescu/e<wbr>ndymion</a><br>
______________________________<wbr>_________________<br>
CentOS-devel mailing list<br>
<a href="mailto:CentOS-devel@centos.org" target="_blank">CentOS-devel@centos.org</a><br>
<a href="https://lists.centos.org/mailman/listinfo/centos-devel" rel="noreferrer" target="_blank">https://lists.centos.org/mailm<wbr>an/listinfo/centos-devel</a><br>
</blockquote></div><br></div></div>