Limiting access to resources for specific IPs

0

Hi! Suppose I have a scenario with IAM credentials instead of roles. Before I move to a better scenario with IAM roles, I want a quick fix limiting access to resources, to prevent some risks from credential leaking. I'm trying to limit access to productive resources only to requests coming from a known origin, for example a VPN, without breaking communication between these resources. For example, if I have a Lambda consuming am SQS queue, I want to keep it working. What is the best way to achieve that?

AWS
질문됨 5달 전131회 조회
1개 답변
0
수락된 답변

The use of credentials is not a recommended approach by AWS; the action that is always recommended is the use of IAM Roles because they are an identity that can be created in AWS IAM and have permissions assigned to them directly or via IAM policies. However, unlike users, an IAM Role does not have a password, as it is assumed at runtime. In this way, I have outlined some steps for you to follow that will greatly enhance your security posture:

  1. Replace all long-term credentials with IAM Roles using the principle of Least Privilege.
  2. Require human users to use federation with an identity provider to access AWS using temporary credentials.
  3. Require multi-factor authentication (MFA).
  4. Use IAM Access Analyzer. You can get more details and delve into the steps I mentioned above through these links: https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#bp-users-federation-idp https://aws.amazon.com/pt/iam/resources/best-practices/

However, I understand that this will be a time-consuming activity, and you may need a quicker solution. Therefore, a temporary solution you can use while implementing the above steps is to add an additional condition, using the OR logic, in your policies allowing access to the aws:ViaAWSService key, allowing access either via your VPN’s IPs OR via AWS services (you can check about this key in this link: https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-viaawsservice). But again, I emphasize that this is only a temporary solution that, while functional, is not as secure as the one I initially mentioned.

profile pictureAWS
답변함 5달 전
profile picture
전문가
검토됨 5달 전
profile picture
전문가
검토됨 5달 전
profile picture
전문가
검토됨 5달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠