0

In our company, we have to deal with a lot of user uploads, for example images and videos. Now I was wondering: how do you guys "deal with that" in terms of safety? Is it possible for an image to contain malicious content? Of course, there are the "unwanted" pixels, like porn or something. But that's not what I mean now. I mean images which "break" machines while they are being decoded, etc. I already saw this: How can a virus exist in an image.

Basically I was planning to do this:

  • Create a DMZ
  • Store the assets in a bucket (we use GCP here) which lives inside the DMZ
  • Then apply "malicious code"-detection on the file
  • If it turns out to be fine... then move the asset into the "real" landscape (the non-dmz)

Now the 3rd part... what can I do here?

Applying a virus scanner No problem with this, there are a lot of options here. Simple approach and good chance that viruses are being caught.

Do mime-type detection Based on the first few bytes, I do a mime type detection. For example, if someone sends us a "image.jpg" but in fact its an executable, then we would detect this. Right? Is this safe enough? I was thinking about this package.

What else??? Now... what else can I do? How do other big companies do this? I'm not really looking for answers in terms of orchestration, etc. I know how to use a DMZ, link it all together with a few pubsub topics, etc. I'm purely interested in what techniques to apply to really find out that an incoming asset is "safe".

Rogier Lommers
  • 2,263
  • 3
  • 24
  • 38

1 Answers1

0

What I would suggest is to not to do it outside the DMZ , let this be within your DMZ and it should have all the regular security controls as any other system will have within your data center.

Besides the things ( Virus Scan , Mime - Type detection ) that you have outlined , i would suggest a few additional checks to perform.

  1. Size Limitation - You would not want anyone to just bloat out all the space and choke your server.

  2. Throttling - Again you may want to control the throughput , at least have the ability to limit to some maximum value.

  3. Heuristic Scan - Perhaps add a layer to the Anti Virus to do heuristics as well rather than simple signature scans.

  4. File System Access Control - Make sure that the file system access control is foolproof , even in case something malicious comes in it should be able to propagate out to other folders / paths .

  5. Network control - Make sure all the outbound connections are fire walled as well , just in case anything tries to make outward connections.

Soumen Mukherjee
  • 2,953
  • 3
  • 22
  • 34