Kubernetes Security : Pillars of Authentication ☸☸

Demystifying the mysteries of Kubernetes Security :))

Vibhor Chinda
Google Cloud - Community
5 min readApr 24, 2023

--

Introduction 🚩🚩

Hi fellow Readers 👋 :))
I have been writing about the overview of Kubernetes concepts and it’s objects for a while now.
Continuing on those lines, Today I will be again writing about another major concept from the world of Kubernetes. As you all might have guessed from the title, the article is about Kubernetes Security.

Kubernetes plays an extremely important role in today’s tech world. It is being used for managing the lifecycle of different important applications used by millions of users around the world.

So securing such software becomes extremely important for everyone. Thus Kubernetes Security is one of the most important aspect of Kubernetes which everyone should be aware of

In this article, we will try to learn about :

✨ What is meant by Authentication and why do we need it ??

✨ What are TLS certificates and why do we need them in Kubernetes ??

Photo by Franck on Unsplash

Before starting with this Article.
I just wanna say that if you have been following me in my Technical Journey and if you like my writings and want to read more from me in the future :))
Please Do clap and follow me 🙈.

Plus In case of any doubts around this article or for some general chit chat, feel free to reach out to me on my social media handles😃.

Twitterhttps://twitter.com/ChindaVibhor

LinkedInhttps://www.linkedin.com/in/vibhor-chinda-465927169

It will be a small but an extremely interesting article.
So without any further delay, lets get started with it 🐵

What is meant by Authentication and why do we need it ?? 😐😐

Photo by FLY:D on Unsplash

Kubernetes Security can only be strong if the pillars on which it rest are strong enough to hold it against the malicious users attacking the applications.

One such pillar is Authentication. If we try to define the word Authentication in simple terms, then Authentication is the process of verifying a user or device before allowing access to a system or resources.

In other words, authentication means confirming that a user is who they say they are. This ensures only those with authorized credentials gain access to secure systems.

Authentication is extremely important as it enables the organizations to keep their workloads secure by permitting only authenticated users or processes to gain access to their Kubernetes clusters.

Let us try to understand what authentication does and why it important for the Kubernetes workloads in the following few simple points :

  1. Kube-Api server is the backbone of all the communication happening inside a Kubernetes cluster.
  2. Various components of the cluster communicate with each other using the Kube-Api server.
  3. Whenever a user wants to communicate with the cluster. Kube-Api server is the carrier of its commands back and forth.
  4. So it means that if anyone can get access to Kube-Api server, then they can control the whole scenario of the cluster without any problem.
  5. Now imagine if some hacker gains access to kube-api server now the whole infrastructure and information is under major threat.
  6. So just to make sure that only right people can get access to the infrastructure, Authentication mechanisms are present which helps to keep the Kubernetes Security up and running.

What are TLS certificates and why do we need them in Kubernetes ?? 👀👀

Photo by regularguy.eth on Unsplash

Till this point of the article, we know that why Authentication is important for the whole organization and its underlying infrastructure.

But now the question arises how does a Kubernetes setup enforces the concept of Authentication for its underlying infrastructure.
Here comes the entry of our hero i.e “TLS Certificates” 🙌 🙌

TLS is the cryptographic protocol that powers encryption for many network applications. One can secure an application running on Kubernetes by creating TLS certificates. TLS (Transport Layer Security) certificates are fundamental to standing up a Kubernetes cluster and for interacting with/within the cluster.

Let us try to understand the whole concept of TLS Certificates for Kubernetes in the following simple points :

  1. A single Kubernetes cluster is made after combining different components together in sync.
  2. These components interact with each other in order to carry out the usual working of a Kubernetes infrastructure.
  3. Users (administrators, developers, bots) also interact with the Kubernetes components to run various commands and fetch information they need.
  4. So be it any internal component, end user or any bot. First and foremost, it has to develop a trust stating its identity. That yes I am who I am claiming to be. Then only the communication will take place.
  5. Thus in order to develop the trust for its own identity. All these internal components, end users or bots have some certificates generated.
  6. These certificates are a hallmark of their identity and authenticity but only if they are valid certificates.
  7. A certificate is only valid when it is being signed by a genuine Certificate Authority.

Certificate authority is nothing more than a set of public and private key. Which is being used to sign the certificate signing request (csr) of various entities just to prove their authenticity in the eyes of world.

Note* : If the Kubernetes Infrastructure is spined up by kubeadm.
Then one can find the certificates under the Yaml file of various components. In order to describe the certificate file in detail one can use the below command

$ openssl x509 -in give_file_path_here -text -noout

What next ?? 👀 👀

Thanks a lot for reaching till here! This is the end of this article.
But we have only scratched the surface of the K8s ecosystem :))
Much more to go, it will be a fun journey where we will learn a lot of cool stuff together.

Do clap and follow me 🙈 if you like my writings and want to read more from me in the future :))

In case of any doubts around this article or for some general chit chat, feel free to reach out to me on my social media handles

Twitter — https://twitter.com/ChindaVibhor

LinkedIn — https://www.linkedin.com/in/vibhor-chinda-465927169/

Related Articles

I will still keep on coming with new articles covering a bunch of topics I am exploring.

That’s All folks !! Doodles :))

--

--

Vibhor Chinda
Google Cloud - Community

Software Developer 2 @Guidewire | Ex - VMware | CKA | Exploring Cloud Tech | Developing Patience ✨✨