IAM Key Rotation Automation

Поделиться
HTML-код
  • Опубликовано: 22 окт 2024

Комментарии • 56

  • @pscapigliati6916
    @pscapigliati6916 11 месяцев назад

    for every user on IAM must create a secret in Secret Manager before run the lambda ? it is an essential requirement. or the secret is automatically created by the function for new iam users found ?

  • @RamkrishnaJana-o1f
    @RamkrishnaJana-o1f Год назад

    If any user having only one access key and we rotate the same using lambda, how will they fetch the key details from aws secret manager?

  • @adinathwaikar7511
    @adinathwaikar7511 Год назад

    the video was helpfull thanks bro

  • @dmitryportnoy1474
    @dmitryportnoy1474 2 года назад

    Thank you it worked. Just in case, do you have lambda function for notification users via email about new access and secret keys? I mean as soon as access key changed user will get an email with new keys. Thank you!

    • @BorrowedCloud
      @BorrowedCloud  2 года назад

      Check out this video - ruclips.net/video/8_ZGJKsBtvw/видео.html&ab_channel=BorrowedCloud

  • @thedavidfield1
    @thedavidfield1 Год назад

    Sir. I am confused. What if I don't have any of my users keys existing in Secrets Manager yet? I would have to add all their keys to secrets manager before I run this?

    • @BorrowedCloud
      @BorrowedCloud  Год назад +1

      Yes, this implementation is driven from the AWS Secret Manager service, hence you must have secret created before it is implemented.

  • @ramkiization
    @ramkiization 2 года назад

    Looks great..adding to this my requirement is to update this newly created keys in gitlab variable ,can you please help on this..thank you

    • @BorrowedCloud
      @BorrowedCloud  Год назад

      You can try using APIs for updating new keys in GitHub.

  • @nikhilpawar2381
    @nikhilpawar2381 2 года назад

    Great it works as explained .. thanks

  • @chuksjedidiah7051
    @chuksjedidiah7051 2 года назад

    Hi @Borrowed Cloud, can you make this process to create new access key on 90 days, then on 100 days, it can make the old access keys "INACTIVE", then on 110 days it can "DELETE" the inactive keys?

    • @BorrowedCloud
      @BorrowedCloud  Год назад

      Try using Amazon EventBridge to implement it.

    • @chuksjedidiah7051
      @chuksjedidiah7051 Год назад

      @@BorrowedCloud once it create new access key, it will automatically deactivate the old ones.

  • @owncare1176
    @owncare1176 2 года назад

    thank you

  • @ranjitk009
    @ranjitk009 Год назад

    This really good

  • @maheshkumarnaik754
    @maheshkumarnaik754 2 года назад

    It is very nice sir

    • @maheshkumarnaik754
      @maheshkumarnaik754 2 года назад

      can i get your contact details sir

    • @BorrowedCloud
      @BorrowedCloud  2 года назад

      You can submit your query on the channel email address.

  • @WilsonMar1
    @WilsonMar1 2 года назад

    Thank you for this. But this still has the concern of having credentials laying around to be stolen. So a safer solution used by enterprises is to dynamically create credentials that are only good for a few hours.

    • @BorrowedCloud
      @BorrowedCloud  2 года назад

      Please elaborate on your statement "But this still has the concern of having credentials laying around to be stolen.", when we are storing these keys in AWS Secrets Manager and access to the secret is controlled via IAM policies assigned to IAM users.

  • @tejam8791
    @tejam8791 2 года назад

    Thanks ..working fine for me ..

    • @tejam8791
      @tejam8791 2 года назад

      For Access denied Issue .. in Roles page u can see lambda function which u created then u need to add SecretsManagerReadWrite and IAMKeyRotation_Policy.then issue will be resolved.

    • @BorrowedCloud
      @BorrowedCloud  2 года назад

      Check out this vodeo which has template for implementing this feature - ruclips.net/video/8_ZGJKsBtvw/видео.html&ab_channel=BorrowedCloud

  • @jedidiahenergysystem9121
    @jedidiahenergysystem9121 2 года назад

    Thank you, it worked

  • @itspragyaSwordland
    @itspragyaSwordland Год назад

    How this can be achieved for multiple users in an AWS account

    • @BorrowedCloud
      @BorrowedCloud  Год назад

      Create one secret for every user you want to rotate keys for.

  • @BuhlzI
    @BuhlzI Год назад

    The only question I have is: How are the new keys or secrets disseminated to users? i.e. AWS CLI users

    • @BorrowedCloud
      @BorrowedCloud  Год назад

      What do you mean by CLI users? SNS topic will send a notification to the subscribed users.

    • @BuhlzI
      @BuhlzI Год назад +1

      @@BorrowedCloud CLI users are Command Line users.
      The question is: One key renewal occurs how to the access and secret access keys get passed to the end user or app. If AWS CLI tools are used, does the config or credentials file(s) need to point to Secrets Manager as a repository for their secret and access keys?

  • @manoharguri9351
    @manoharguri9351 2 года назад

    How to do it with S3 bucket for multiple users?

    • @BorrowedCloud
      @BorrowedCloud  2 года назад

      Add all secret names (one secret for one IAM user) in a file and upload it to the S3 bucket. In Lambda, open the file in a for loop and implement the logic I've explained in the video.

    • @manoharguri9351
      @manoharguri9351 2 года назад

      @@BorrowedCloud I'm looking for the syntax and where to insert it.

    • @BorrowedCloud
      @BorrowedCloud  2 года назад

      @@manoharguri9351 it is not covered in my code. I gave you a direction to modify it for your requirement.

  • @maheshkumarnaik754
    @maheshkumarnaik754 2 года назад

    Getting below error
    {
    "errorMessage": "Handler 'lambda_handler' missing on module 'lambda_function'",
    "errorType": "Runtime.HandlerNotFound",
    "stackTrace": [ ]
    }

    • @BorrowedCloud
      @BorrowedCloud  2 года назад

      Check out this video which has templates for implementation of this feature - ruclips.net/video/8_ZGJKsBtvw/видео.html&ab_channel=BorrowedCloud

    • @maheshkumarnaik754
      @maheshkumarnaik754 2 года назад

      @@BorrowedCloud I am new to AWS can you help me with implemetation on live .can you shared your number so can call you

  • @shankarnaveen2865
    @shankarnaveen2865 2 года назад

    I am getting access denied exception when calling get secret value operation

    • @BorrowedCloud
      @BorrowedCloud  2 года назад

      Check the permissions you have given in the policy attached to your IAM role.

    • @BorrowedCloud
      @BorrowedCloud  2 года назад

      Go thorugh this video - ruclips.net/video/8_ZGJKsBtvw/видео.html&ab_channel=BorrowedCloud. I've provided a CloudFormation template which you can readily use in your environment.

  • @tyrunkumar
    @tyrunkumar Год назад

    { "statusCode": 200, "body": "\"Hello from Lambda!\"" }

  • @m4u979
    @m4u979 2 года назад

    Logic is wrong, if you make inactive first, what if the keys are using in external application like any on-prem servers, Dc servers

    • @BorrowedCloud
      @BorrowedCloud  2 года назад +2

      As I said in the video, many customers have strict requirements to inactivate the keys after a period. For security reason, they have to inactivate the keys even if those are being used by few external apps.
      What you can do is create an EventBridge to run 5 days prior to key inactivation to send email to those teams to be ready to change the keys 5 days after. You can have multiple EventBridge rules to send reminders until the key inactivation day is reached.

    • @m4u979
      @m4u979 2 года назад

      @@BorrowedCloud yep

    • @mdharshath4959
      @mdharshath4959 Год назад

      @@BorrowedCloud What you have explained is good. But could you pls breif enough to create an Event Bridge and SNS

  • @sohandogra8263
    @sohandogra8263 2 года назад

    Hye Dear,

    • @sohandogra8263
      @sohandogra8263 2 года назад

      I got this error while executing the script. Can you please have a look and provide me with solution
      {
      "errorMessage": "An error occurred (ValidationException) when calling the GetSecretValue operation: Invalid name. Must be a valid name containing alphanumeric characters, or any of the following: -/_+=.@!",
      "errorType": "ClientError",
      "requestId": "e2d3e06d-2b69-40ba-b1f7-c6fcc049c0a5",
      "stackTrace": [
      " File \"/var/task/lambda_function.py\", line 14, in lambda_handler
      get_secret = secretsmanager.get_secret_value(SecretId=secret)
      ",
      " File \"/var/runtime/botocore/client.py\", line 391, in _api_call
      return self._make_api_call(operation_name, kwargs)
      ",
      " File \"/var/runtime/botocore/client.py\", line 719, in _make_api_call
      raise error_class(parsed_response, operation_name)
      "
      ]
      }

  • @maheshkumarnaik754
    @maheshkumarnaik754 2 года назад

    Response
    {
    "errorMessage": "'NoneType' object has no attribute 'split'",
    "errorType": "AttributeError",
    "stackTrace": [
    " File \"/var/task/lambda_function.py\", line 11, in lambda_handler
    secret_list = vsecret.split(';')
    "
    ]
    }

    • @BorrowedCloud
      @BorrowedCloud  2 года назад

      You must be missing a step... Go through ruclips.net/video/8_ZGJKsBtvw/видео.html&lc=UgyBVC5XxyEGoPkXELN4AaABAg&ab_channel=BorrowedCloud where I've given the CloudFormation stack for implementing this feature.

  • @sohandogra8263
    @sohandogra8263 2 года назад

    {
    "errorMessage": "'action'",
    "errorType": "KeyError",
    "requestId": "056c4613-a7e9-4f62-b016-502200fc777f",
    "stackTrace": [
    " File \"/var/task/lambda_function.py\", line 108, in lambda_handler
    faction=event [\"action\"]
    "
    ]
    }
    Got this error after attaching the role

    • @BorrowedCloud
      @BorrowedCloud  2 года назад

      Follow all steps in the given order.

    • @BorrowedCloud
      @BorrowedCloud  2 года назад

      Go thorugh this video - ruclips.net/video/8_ZGJKsBtvw/видео.html&ab_channel=BorrowedCloud. I've provided a CloudFormation template which you can readily use in your environment.