<?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: Prisma Public Cloud Query - Exclude AWS security group that is not associated with any resources in Prisma Cloud Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/prisma-public-cloud-query-exclude-aws-security-group-that-is-not/m-p/257860#M120</link>
    <description>&lt;P&gt;There isn't a way to exclude SGs attached to any kind of resources, but you can at least put in a few more restrictions.&amp;nbsp; For example, the below query will return all security groups that are open to the public on port 22 that are on a VPC which contains an IGW with an EC2 instance attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;config where&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://api.name/" target="_blank" rel="nofollow noopener"&gt;api.name&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;= 'aws-ec2-describe-security-groups' as X; config where&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://api.name/" target="_blank" rel="nofollow noopener"&gt;api.name&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;= 'aws-ec2-describe-internet-gateways' as Y; config where&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://api.name/" target="_blank" rel="nofollow noopener"&gt;api.name&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;= 'aws-ec2-describe-instances' as Z; filter '$.Z.securityGroups[*].groupId contains $.X.groupId and $.Y.attachments[*].vpcId contains $.X.vpcId and ($.X.ipPermissions[?(@.toPort==22||@.fromPort==22)].ipv6Ranges[*].cidrIpv6 contains ::/0 or $.X.ipPermissions[?(@.toPort==22||@.fromPort==22)].ipRanges[*] contains 0.0.0.0/0 or $.X.ipPermissions[?(@.toPort&amp;gt;22&amp;amp;&amp;amp;@.fromPort&amp;lt;22)].ipv6Ranges[*].cidrIpv6 contains ::/0 or $.X.ipPermissions[?(@.toPort&amp;gt;22&amp;amp;&amp;amp;@.fromPort&amp;lt;22)].ipRanges[*] contains 0.0.0.0/0)'; show X;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
    <pubDate>Thu, 13 Jun 2019 00:49:56 GMT</pubDate>
    <dc:creator>kchen</dc:creator>
    <dc:date>2019-06-13T00:49:56Z</dc:date>
    <item>
      <title>Prisma Public Cloud Query - Exclude AWS security group that is not associated with any resources</title>
      <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/prisma-public-cloud-query-exclude-aws-security-group-that-is-not/m-p/257806#M119</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some policies are producing alerts against SGs that are not associated with any resources.&lt;/P&gt;&lt;P&gt;Can you please advise how to customize the query and exclude those SGs?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, policy "AWS Security Groups allow internet traffic from internet to MYSQL port (3306)"&amp;nbsp; is defined as follows:&lt;/P&gt;&lt;P&gt;config where cloud.type = 'aws' AND api.name='aws-ec2-describe-security-groups' AND json.rule = (((ipPermissions[?(@.toPort &amp;gt; 3306 &amp;amp;&amp;amp; @.fromPort &amp;lt; 3306)].ipRanges[*] contains 0.0.0.0/0) or (ipPermissions[?(@.toPort == 3306 || @.fromPort == 3306)].ipRanges[*] contains 0.0.0.0/0)) or ((ipPermissions[?(@.toPort &amp;gt; 3306 &amp;amp;&amp;amp; @.fromPort &amp;lt; 3306)].ipv6Ranges[*].cidrIpv6 contains ::/0) or (ipPermissions[?(@.toPort == 3306 || @.fromPort == 3306)].ipv6Ranges[*].cidrIpv6 contains ::/0)))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2020 17:13:40 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/prisma-public-cloud-query-exclude-aws-security-group-that-is-not/m-p/257806#M119</guid>
      <dc:creator>DXiao</dc:creator>
      <dc:date>2020-09-02T17:13:40Z</dc:date>
    </item>
    <item>
      <title>Re: Prisma Public Cloud Query - Exclude AWS security group that is not associated with any resources</title>
      <link>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/prisma-public-cloud-query-exclude-aws-security-group-that-is-not/m-p/257860#M120</link>
      <description>&lt;P&gt;There isn't a way to exclude SGs attached to any kind of resources, but you can at least put in a few more restrictions.&amp;nbsp; For example, the below query will return all security groups that are open to the public on port 22 that are on a VPC which contains an IGW with an EC2 instance attached.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;config where&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://api.name/" target="_blank" rel="nofollow noopener"&gt;api.name&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;= 'aws-ec2-describe-security-groups' as X; config where&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://api.name/" target="_blank" rel="nofollow noopener"&gt;api.name&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;= 'aws-ec2-describe-internet-gateways' as Y; config where&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="http://api.name/" target="_blank" rel="nofollow noopener"&gt;api.name&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;= 'aws-ec2-describe-instances' as Z; filter '$.Z.securityGroups[*].groupId contains $.X.groupId and $.Y.attachments[*].vpcId contains $.X.vpcId and ($.X.ipPermissions[?(@.toPort==22||@.fromPort==22)].ipv6Ranges[*].cidrIpv6 contains ::/0 or $.X.ipPermissions[?(@.toPort==22||@.fromPort==22)].ipRanges[*] contains 0.0.0.0/0 or $.X.ipPermissions[?(@.toPort&amp;gt;22&amp;amp;&amp;amp;@.fromPort&amp;lt;22)].ipv6Ranges[*].cidrIpv6 contains ::/0 or $.X.ipPermissions[?(@.toPort&amp;gt;22&amp;amp;&amp;amp;@.fromPort&amp;lt;22)].ipRanges[*] contains 0.0.0.0/0)'; show X;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Jun 2019 00:49:56 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/prisma-cloud-discussions/prisma-public-cloud-query-exclude-aws-security-group-that-is-not/m-p/257860#M120</guid>
      <dc:creator>kchen</dc:creator>
      <dc:date>2019-06-13T00:49:56Z</dc:date>
    </item>
  </channel>
</rss>

