<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: RQL query for evaluating AWS security groups rule by rule in Prisma Cloud Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/rql-query-for-evaluating-aws-security-groups-rule-by-rule/m-p/310838#M222</link>
    <description>&lt;P&gt;Solve my issue, here is the query that did it with a little extra:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;config where api.name = 'aws-ec2-describe-instances' as X; config where api.name = 'aws-ec2-describe-security-groups' as Y; filter '$.X.state.name equals running and $.X.publicIpAddress exists and $.X.securityGroups[*].groupId contains $.Y.groupId and (($.Y.ipPermissions[?(@.ipProtocol==-1)].ipRanges[*] contains 0.0.0.0/0 or $.Y.ipPermissions[?(@.ipProtocol==-1)].ipv6Ranges[*].cidrIpv6 contains ::/0))' ; show X; addcolumn publicDnsName publicIpAddress&lt;/P&gt;</description>
    <pubDate>Wed, 12 Feb 2020 16:15:56 GMT</pubDate>
    <dc:creator>AHershey</dc:creator>
    <dc:date>2020-02-12T16:15:56Z</dc:date>
    <item>
      <title>RQL query for evaluating AWS security groups rule by rule</title>
      <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/rql-query-for-evaluating-aws-security-groups-rule-by-rule/m-p/310616#M221</link>
      <description>&lt;P&gt;I am sure someone has had this issue.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We want to get an alert if we allow access to all IP's on all ports.&amp;nbsp; The policy is based on this example:&lt;/P&gt;&lt;P&gt;filter '$.X.state.name equals running and $.X.publicIpAddress exists and $.X.securityGroups[*].groupId contains $.Y.groupId and ((&lt;FONT color="#0000FF"&gt;$.Y.ipPermissions[*].ipRanges[*] contains 0.0.0.0/0 or $.Y.ipPermissions[*].ipv6Ranges[*].cidrIpv6 contains ::/0&lt;/FONT&gt;) and &lt;FONT color="#FF0000"&gt;$.Y.ipPermissions[*].ipProtocol equals -1&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem we have is with false positives.&amp;nbsp; We have some EC2's with security groups that allow all external IP's to reach 443, and some rules allow only some other security groups to access all ports in another security group.&amp;nbsp; So what we are looking for is a way for the blue and red criteria to be used to evaluate each security group rule individually, as opposed to firing if any ingress rule has "0.0.0.0" on the allowed IP's and another ingress rule has "-1"&amp;nbsp; on the allowed protocols side.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;We are having the discussions to dissuade people from using "-1" ever, which is really the best way to go, but for now we are just trying to focus on stopping the worst of behavior.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 18:02:19 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/rql-query-for-evaluating-aws-security-groups-rule-by-rule/m-p/310616#M221</guid>
      <dc:creator>AHershey</dc:creator>
      <dc:date>2020-09-02T18:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: RQL query for evaluating AWS security groups rule by rule</title>
      <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/rql-query-for-evaluating-aws-security-groups-rule-by-rule/m-p/310838#M222</link>
      <description>&lt;P&gt;Solve my issue, here is the query that did it with a little extra:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;config where api.name = 'aws-ec2-describe-instances' as X; config where api.name = 'aws-ec2-describe-security-groups' as Y; filter '$.X.state.name equals running and $.X.publicIpAddress exists and $.X.securityGroups[*].groupId contains $.Y.groupId and (($.Y.ipPermissions[?(@.ipProtocol==-1)].ipRanges[*] contains 0.0.0.0/0 or $.Y.ipPermissions[?(@.ipProtocol==-1)].ipv6Ranges[*].cidrIpv6 contains ::/0))' ; show X; addcolumn publicDnsName publicIpAddress&lt;/P&gt;</description>
      <pubDate>Wed, 12 Feb 2020 16:15:56 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/rql-query-for-evaluating-aws-security-groups-rule-by-rule/m-p/310838#M222</guid>
      <dc:creator>AHershey</dc:creator>
      <dc:date>2020-02-12T16:15:56Z</dc:date>
    </item>
  </channel>
</rss>

