RQL Query - Trying to Link Security Groups that are not linked to a particular Transit Gateway ID. but getting Bad Request Error

cancel
Showing results for 
Search instead for 
Did you mean: 

RQL Query - Trying to Link Security Groups that are not linked to a particular Transit Gateway ID. but getting Bad Request Error

L0 Member

Trying to Join 2 API: aws-ec2-describe-security-groups & aws-vpc-transit-gateway-attachment

 

1. List of Security Groups that allow everything:

 

config from cloud.resource where cloud.type = 'aws' AND api.name= 'aws-ec2-describe-security-groups' AND json.rule = isShared is false and (ipPermissions[?any((ipProtocol equals tcp or ipProtocol equals icmp or ipProtocol equals icmpv6 or ipProtocol equals udp) and (ipRanges[*] contains 0.0.0.0/0 or ipv6Ranges[*].cidrIpv6 contains ::/0))] exists) as X;

 

2. Extracting List of VPCs that dont have a particular Gateway AttachmentID:

config from cloud.resource where cloud.type = 'aws' AND api.name= 'aws-vpc-transit-gateway-attachment' AND json.rule = transitGatewayId does not contain "XXXXXXXXX" as Y;

 

final Join:

 

config from cloud.resource where cloud.type = 'aws' AND api.name= 'aws-ec2-describe-security-groups' AND json.rule = isShared is false and (ipPermissions[?any((ipProtocol equals tcp or ipProtocol equals icmp or ipProtocol equals icmpv6 or ipProtocol equals udp) and (ipRanges[*] contains 0.0.0.0/0 or ipv6Ranges[*].cidrIpv6 contains ::/0))] exists) as X; config from cloud.resource where cloud.type = 'aws' AND api.name= 'aws-vpc-transit-gateway-attachment' AND json.rule = transitGatewayId equals "XXXX" as Y; filter ' $.X.vpcId == $.Y.resourceId'; show X;

0 REPLIES 0
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!