Sunday, April 18, 2021
  • Setup menu at Appearance » Menus and assign menu to Top Bar Navigation
Advertisement
  • AI Development
    • Artificial Intelligence
    • Machine Learning
    • Neural Networks
    • Learn to Code
  • Data
    • Blockchain
    • Big Data
    • Data Science
  • IT Security
    • Internet Privacy
    • Internet Security
  • Marketing
    • Digital Marketing
    • Marketing Technology
  • Technology Companies
  • Crypto News
No Result
View All Result
NikolaNews
  • AI Development
    • Artificial Intelligence
    • Machine Learning
    • Neural Networks
    • Learn to Code
  • Data
    • Blockchain
    • Big Data
    • Data Science
  • IT Security
    • Internet Privacy
    • Internet Security
  • Marketing
    • Digital Marketing
    • Marketing Technology
  • Technology Companies
  • Crypto News
No Result
View All Result
NikolaNews
No Result
View All Result
Home Technology Companies

Basics of Kubernetes security – IBM Developer

January 1, 2021
in Technology Companies
Basics of Kubernetes security – IBM Developer
585
SHARES
3.3k
VIEWS
Share on FacebookShare on Twitter

Credit: IBM

You might also like

How AI helps Overwatch League process 410M data points to build power rankings – IBM Developer

A brief intro to Red Hat OpenShift for Node.js developers – IBM Developer

IBM joins Eclipse Adoptium and offers free certified JDKs with Eclipse OpenJ9 – IBM Developer

Kubernetes is popular among developers and administrators, and the concepts of deploying, scaling, and managing containerized applications are very familiar. However, when production deployments are discussed, one area of Kubernetes that is critical to production deployments is security. It’s important to understand how the platform manages authentication and authorization of users and applications.

If your Kubernetes cluster holds sensitive information such as bank account details, medical records, or anything confidential, you should take advantage of all the security precautions that Kubernetes offers. In addition, you can use plenty of non-Kubernetes-specific security tools and approaches to add extra security layers.

Important components of Kubernetes security

The Kubernetes API server (kube-apiserver) is the component that receives all the incoming requests. The incoming requests are processed to modify the state of the cluster. All requests in Kubernetes originate from:

  • External users
  • Service accounts
  • Kubernetes components

But before reaching kube-apiserver, there are security components that help to bring in security measures to your application. Following are the components which will help you to secure your Kubernetes application:

  • Authentication
  • Authorization
  • Admission controllers

Figure 1 shows the Kubernetes workflow diagram. After the request moves through the authentication modules, authorization modules, and admission controller, then the request is processed.

Figure 1. Kubernetes workflow

Authentication modules

If the origin of a request is unknown, Kubernetes treats it as an anonymous request. Depending on the configuration of the components, the authentication modules may allow or drop anonymous requests. Following are some of the most used authentication strategies:

  • Client certificates
    The certificate authority helps to create X509 certificates, which help validate client certificates.

  • Static tokens
    The API server uses a static file to read the bearer tokens. The token file is a comma-separated file consisting of secret, user, uid, group1, and group2.

  • Basic authentication
    Kubernetes also supports basic authentication. The authentication credentials are stored in a CSV file as password, user, uid, group1, and group2.

  • Service account tokens
    Service accounts are created by the kube-apiserver and are associated with the pods. It verifies signed bearer tokens.

  • Webhook tokens
    Kubernetes makes a call to a REST API outside the cluster to determine the user’s identity.

Learn more about Kubernetes authentication.

Authorization modules

Once the authentication modules identify the origin of the request, active authorization modules evaluate the attributes of the request against the authorization policies of the user to allow or deny the request. Each request passes through the authorization module sequentially and if any module provides a decision to allow or deny, it is automatically accepted or denied. Following are some of the authorization strategies that are frequently used:

  • Request attributes
    Authorization modules parse a set of attributes in a request to determine whether the request should be parsed, allowed, or denied.

  • Nodes
    Node authorization mode grants permissions to kubelets to access services, endpoints, nodes, pods, secrets, and persistent volumes for a node.

  • Attribute-based access control (ABAC)
    With ABAC, requests are allowed by validating policies against the attributes of the request.

  • Role-based access control (RBAC)
    With RBAC, access to resources is regulated using the roles assigned to individual users.

  • Webhooks
    Similar to the webhook mode for authentication, the webhook mode for authorization uses a remote API server to check user permissions.

Learn more about Kubernetes authorization.

Admission controllers

Admission controllers are modules that intercept requests to the API server after the request is authenticated and authorized. The controllers validate and mutate the request before modifying the state of the objects in the cluster. A controller can be both mutating and validating. If any of the controllers reject the request, the request is dropped immediately, and an error is returned to the user so that the request will not be processed. You can enable the admission controllers by using the --enable-admission-plugins flag. Important admission controllers include:

  • AlwaysAdmit
  • AlwaysPullImages
  • EventRateLimit
  • LimitRanger
  • NodeRestriction
  • PersistentVolumeClaimResize
  • PodSecurityPolicy
  • SecurityContextDeny
  • ServiceAccount

Learn more about Kubernetes admission controllers.

Securing your container images

You should schedule scans of your container images at regular intervals. Container image scanning tools, such as Portieris and Grafeas, inspect the packages included in an image and help report on any known vulnerabilities included in those packages. When you identify that a container image includes a package with a vulnerability, you should update the container so it uses a fixed version of the package.

A best practice is to not SSH into your running containers. If you factor in the self-healing nature of Kubernetes, which ensures that a failed container will be replaced with a new one, and autoscaling, which can create and destroy containers automatically, it’s not possible to manually keep up with the patching process.

CI/CD best practices

Image scans can be integrated into your continuous integration and continuous delivery (CI/CD) pipeline. Follow some of these best practices:

  • A failed scan can result in a failed build.
  • A failed scan before deployment can prevent the image from being deployed.
  • A failed scan on an image that is already in production can result in an alert so that operators can take remedial action.

More about RBAC

Role-based access control (RBAC) is a security approach to grant specific resources access to users. Following are the broad steps for RBAC:

  1. Create a client certificate.
  2. Create a user.
  3. Grant access to the user.
    • Create a Role.
    • Create a RoleBinding, where the Role is bound to a subject (or user, in this case).
  4. Test the access.

Role and RoleBinding are scoped to a namespace. If you want to assign the Role to more than a namespace, then use ClusterRole and ClusterRoleBinding. Following are a few commands that can be referred to for RBAC.

Create a client certificate

  1. Generate a key by using OpenSSL:

    openssl genrsa -out <user.key> 2048
    

  2. Generate a certificate signing request (CSR):

    openssl req -new -key <user.key> -out <user.csr> -subj <subject>
    

  3. Generate the certificate:

    openssl x509 -req -in <user.csr> -CA <ca.crt> -CAkey <ca.key> -CAcreateserial -out <user.crt> -days <number of days>
    

Create a user

Set a user entry in kubeconfig:

  kubectl config set-credentials <user> --client-certificate=<user.crt> --client-key=<user.key>
  kubectl config set-context user-context --cluster=<cluster name> --user=user
  kubectl config view
  kubectl config use-context <user context>

Grant access to the user

Create a Role and RoleBinding YAML file to assign the action of read-pods to <user>:

  kubectl apply -f role.yaml
  kubectl apply -f role-binding.yaml

Basically, the command kubectl get pods should fetch the results.

Test the access

Switch the context to user context:

  kubectl config use-context <user context>

This should produce output:

Note: The aforementioned commands are just for your reference.

Summary

This post described some of the important security components for Kubernetes that you should always consider. You should prioritize security while modernizing applications. Learn more about Kubernetes security concepts by watching the Securing multi-tenant Kubernetes with RBAC, IAM, NetworkPolicy, and PSP video session.

Credit: IBM

Previous Post

KDD in data mining assists data prep for machine learning

Next Post

Top TensorFlow Certifications | Unite.AI

Related Posts

Six courses to build your technology skills in 2021 – IBM Developer
Technology Companies

How AI helps Overwatch League process 410M data points to build power rankings – IBM Developer

April 15, 2021
Six courses to build your technology skills in 2021 – IBM Developer
Technology Companies

A brief intro to Red Hat OpenShift for Node.js developers – IBM Developer

April 15, 2021
Six courses to build your technology skills in 2021 – IBM Developer
Technology Companies

IBM joins Eclipse Adoptium and offers free certified JDKs with Eclipse OpenJ9 – IBM Developer

April 14, 2021
Six courses to build your technology skills in 2021 – IBM Developer
Technology Companies

Every stroke matters – IBM Developer

April 14, 2021
Six courses to build your technology skills in 2021 – IBM Developer
Technology Companies

Day 1 inside the digital ops center – IBM Developer

April 10, 2021
Next Post
Top TensorFlow Certifications | Unite.AI

Top TensorFlow Certifications | Unite.AI

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recommended

Plasticity in Deep Learning: Dynamic Adaptations for AI Self-Driving Cars

Plasticity in Deep Learning: Dynamic Adaptations for AI Self-Driving Cars

January 6, 2019
Microsoft, Google Use Artificial Intelligence to Fight Hackers

Microsoft, Google Use Artificial Intelligence to Fight Hackers

January 6, 2019

Categories

  • Artificial Intelligence
  • Big Data
  • Blockchain
  • Crypto News
  • Data Science
  • Digital Marketing
  • Internet Privacy
  • Internet Security
  • Learn to Code
  • Machine Learning
  • Marketing Technology
  • Neural Networks
  • Technology Companies

Don't miss it

Make Machine Learning Interpretable with Shapash
Machine Learning

Make Machine Learning Interpretable with Shapash

April 18, 2021
Why the Patent Classification System Needs an Update
Machine Learning

Why the Patent Classification System Needs an Update

April 18, 2021
What are the different roles within cybersecurity?
Internet Privacy

What are the different roles within cybersecurity?

April 18, 2021
Machine Learning Technology May Help Decipher Biological Language of Cancer, Parkinson Disease
Machine Learning

Machine Learning Technology May Help Decipher Biological Language of Cancer, Parkinson Disease

April 17, 2021
SysAdmin of Billion-Dollar Hacking Group Gets 10-Year Sentence
Internet Privacy

SysAdmin of Billion-Dollar Hacking Group Gets 10-Year Sentence

April 17, 2021
10 Popular Must-Read Free eBooks on Machine Learning
Machine Learning

10 Popular Must-Read Free eBooks on Machine Learning

April 17, 2021
NikolaNews

NikolaNews.com is an online News Portal which aims to share news about blockchain, AI, Big Data, and Data Privacy and more!

What’s New Here?

  • Make Machine Learning Interpretable with Shapash April 18, 2021
  • Why the Patent Classification System Needs an Update April 18, 2021
  • What are the different roles within cybersecurity? April 18, 2021
  • Machine Learning Technology May Help Decipher Biological Language of Cancer, Parkinson Disease April 17, 2021

Subscribe to get more!

© 2019 NikolaNews.com - Global Tech Updates

No Result
View All Result
  • AI Development
    • Artificial Intelligence
    • Machine Learning
    • Neural Networks
    • Learn to Code
  • Data
    • Blockchain
    • Big Data
    • Data Science
  • IT Security
    • Internet Privacy
    • Internet Security
  • Marketing
    • Digital Marketing
    • Marketing Technology
  • Technology Companies
  • Crypto News

© 2019 NikolaNews.com - Global Tech Updates