For outbound rules for instances that need access to external APIs

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

For outbound rules for instances that need access to external APIs

L0 Member

We use the cloud service AWS.

 

The following issue has been detected in Prisma Cloud.

 

> This policy detects security groups where network 0.0.0.0/0 and ::0/0 are used. This policy detects security groups where network 0.0.0.0/0 and ::0/0 are used.
> Select "outbound rules" and click "edit outbound rules"
> Locate rules containing 0.0.0.0/0 or ::/0 and delete them by selecting "x" icon

 

The ECS assigned to this security group must have access to the Twitter API.

 

The problem is that the IP of the Twitter API can change.

If the IP of the Twitter API is assigned to a security group outbound, it will be inaccessible when the IP changes.

 

We have come up with the following solution to this problem.

 

If ECS tries to access the Twitter API and cannot
The DNS server is queried for the Twitter IP and the outbound security group is updated.

However, this method may not be updated in time and may cause errors in high traffic situations.

 

Is there another better solution ?

 

How do you all respond to such alerts ?

1 REPLY 1

L3 Networker

@iwata2023 

Given twitter's API endpoint IPs are changing and that twitter is assigned a class A, B or C address range,

Then why don't you use CIDR notation for the AWS Scecrity Group's outbound rule?

See https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing

 

As an example, if you enter 199.167.52.5/32, only one IP address is allowed. If you enter 199.167.52.0/24, it allows all IP addresses within the range of 199.167.52.0 to 199.167.52.255.

 

In that way, you won't have to detect and remediate twitter API endpoint address(es) in your security group(s).  Rather, you trust the range of IP addresses that twitter's API endpoints may occupy.

Tommy Hunt AWS-CSA, Java-CEA, PMP, SAFe Program Consultant
thunt@citrusoft.org
https://www.citrusoft.org
  • 1507 Views
  • 1 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!