Are docker containers secure by default?

Short answer No, is it is not more secure by default. But, we can make container secure by implementing various technologies. As we know that docker uses OS level virtualization where as VM uses hardware level virtualization.

Some of the default security model applied in docker are:

1. Kernel namespace makes it difficult for container to interact with each other.

2. cgroups (Control groups) provides accounting and limiting of resources in docker.

3. To run container or container daemon, user requires to have root privileges.

These above provides certain level of security. But still having these container are comparatively less secure than VM. This leads us if someone has to attack a container they can use kernel level exploit for that container to break it, but for VMs they need to exploit host kernel, hypervisor and VM kernel. This does not mean it is more secure, it just provides more layer of abstraction.

So, not deviating from our discussion, we can say docker containers are not secure by default. Container isolation makes it a bit a little more secure but not enough impossible to crack.

It does not mean we can’t secure it. There are various ways you can secure a docker container. Some of them are:

  1. Use trusted images.
  2. Monitoring of container activity for unusual activities.
  3. Enable AppArmor.
  4. Enable SELINUX.
  5. Use bastille Security hardening feature.

If you want to know more here are some resources you can check:

https://www.threatstack.com/blog/docker-security-tips-best-practices

https://docs.docker.com/engine/security/security/

Thank you for reading. Hope you learned something.

要查看或添加评论,请登录

Prabesh .的更多文章

  • Why should everyone in the team be involved in the recruitment process?

    Why should everyone in the team be involved in the recruitment process?

    Hello everyone, I wanted to share some interesting things that happened to me in the workplace. I am sure this has…

    1 条评论
  • Why should you be honest in an IT interview?

    Why should you be honest in an IT interview?

    I have faced this and most of you might have as well. Today, I wanted to share some learning experiences that I faced…

    5 条评论
  • What is container and what is docker?

    What is container and what is docker?

    What is docker? It is a powerful tool which allows devops (system administrator, developers) to deploy application from…

  • Could not get lock /var/lib/dpgk/lock-front end

    Could not get lock /var/lib/dpgk/lock-front end

    When you are new to Linux, you might bump into following error and can be frustrating if you don’t know what actually…

  • Find all the sleeping processes

    Find all the sleeping processes

    Hello today, i am going to show you how you can find all the processes that are sleeping. First you need to see what…

  • kill -15 vs kill -9

    kill -15 vs kill -9

    When we issue kill -15 which in Linux is called SIGTERM. A SIGTERM means termination signal.

  • Dissecting DIG command

    Dissecting DIG command

    Dig stands for Domain Information Groper. As the name suggests it is used to grab information from DNS server.

  • Why "Systemd" outperformed "Init" ?

    Why "Systemd" outperformed "Init" ?

    Before answering this question let me first give an overview what both of these mean. SysVinit: It is a Linux process…

    2 条评论
  • Special permissions (SetUID, SetGID, Stickybit)

    Special permissions (SetUID, SetGID, Stickybit)

    Have you ever thought why normal user can issue passwd command even when user is not the owner of /usr/bin/passwd nor…

  • Background jobs/process handling

    Background jobs/process handling

    I was going through my old notes where i came to know about running background jobs starting, stopping, suspending and…