Least Privilege in AWS IAM using Cloudsplaining

Least Privilege in AWS IAM using Cloudsplaining

It's really common to hear about least privilege when we're studying about information security. Unfortunately, it's really common give too much access to an user as well.

"It's just a temporary access, just to realize a test."

Temporary access usually brings a great vulnerability to the systems, often allowing administrative access. Worse than that, we tend to forget these active accesses. In AWS environment it can be much worse and dangerous. When we're talking about AWS it's important to remember that with just an access key, the attacker will be in your environment. Using the AWS panel the attacker can access the administration from anywhere on the globe. It's not like a private system in your private network or behind a WAF or others security tools.

that's why the use of least privilege principle is very important. For helping us with that we can use an amazing tool, called Cloudsplaining. With this tool is possible to analyse in seconds information like:

  • Privilege escalation permission;
  • Exfiltration permission;
  • Infrastructure modification permissions;

But the question is:

"Where should I start?"

Thinking abou that I created a path that worked for me, in other words, find the best way for you use this tool, this is just my recommendation:


1. Reduce the objects:

I put this step first because I think that this is faster and resolve a good part of your problem. For this you can see the "last used" field in the roles, for example. If the role wasn't used in the last 6 months it's really possible that anyone won't use that more. Then with this you can reduce the roles/policies in your environment.

PS: To reduce the time spent, you can with a simple bot in python read the json that was generated by cloudsplaining and scan just object with more than 6 months without access.


2. Filtering Critical Objects:

Now that we've reduced the total of objects, we can look at the critical objects more deeply. In this point we can for example priorize objects with permission for privilege escalation, than data exfiltration and continuous with others like objects with permission to change the infrastructure.

Some people will say that there are objects that in fact needs privilege escalation permission. With this object, you can create a documentation to maintaining the observation and add them in the exclusion yaml file that was gave by cloudsplaining. With this, they won't alert you in the future.



3. Other Recommendations:

Finally you can improve the security, using for example the AWS IAM Access Advisor, that'll show you the services that some object hasn't used for a while. So you can reduce more the privilege that was gave for this object.

Não foi fornecido texto alternativo para esta imagem


To be more effective I recommend that you create all these alerts explained above and create alerts message automatically using for example boto3 to read the cloudsplaing json file and connect with AWS to get information in Access Advisor and send to a e-mail or slack channel. It'll help you to check continuously you environment.


Well, it's all! I hope that with this article I've passed a little about security in AWS IAM. I hope that you've enjoyed.

Please if you have other recommendations, share here! Let's together improve the security in our environments!

To view or add a comment, sign in

More articles by Vinícius Rodrigues da Silva

  • How have you been perceiving certain events? - Como você tem percebido certos eventos?

    EN: How have you been perceiving certain events? Introduction: It's been a while since I've been taking a break…

    1 Comment
  • Protect sensitive information with Mozilla SOPS and AWS KMS

    There is a really not simple question that pops in all application development cycle: where do I keep the…

    2 Comments
  • Impostor Syndrome - By a person who is not a psychologist

    It's been a while since I wrote an article. It happened because I've passed through a difficult moment.

    8 Comments
  • Implementação Básica Snyk SAST

    Após o ultimo post que fiz sobre o SonarQube, tenho recebido algumas perguntas sobre SAST e sobre o Snyk, decidi então…

    1 Comment
  • SAST - SonarQube

    Como sabem, venho estudando sobre esteira de entregas e onde a segurança pode entrar ali. Venho avaliando…

  • Conceitos Básicos de Criptografia

    Continuando posts sobre meus últimos estudos, esse talvez seja o que mais tenha me pego pelo pé! Estudei criptografia…

  • Iniciando em DevSecOps

    Iniciando em DevSecOps Estou iniciando a pouco no mundo de DevSecOps, neste novo mundo me fiz e ainda me faço diversas…

    6 Comments
  • Buffer Overflow para Leigos

    Sempre tive muita dificuldade para enter o Buffer Overflow, não por não saber o conceito mas sim pela execução. Se…

    25 Comments
  • Mail Spoofing aproveitando-se de SPF

    Essa semana criei um cenário para começar a estudar técnicas de Mail Spoofing e descobri a exploração através de má…

    2 Comments
  • NMAP - Bypass de Firewall/IDS/IPS

    Há diversas formas de realizarmos Bypass em sistemas de defesa como Firewalls, IDS e IPS. Esta semana criei um ambiente…

    15 Comments

Others also viewed

Explore content categories