<?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: Splunk query to check for S3 Buckets in AWS using PutBucketPolicy in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571115#M199017</link>
    <description>&lt;P&gt;Never mind.&amp;nbsp; It was my oversight that i didn't see the option of "Exclude from Search" if you click on that field in the Splunk UI itself.&amp;nbsp; I used that and below filter worked.&amp;nbsp; Any idea as in why isnull() didnt work here&amp;nbsp; but this one did.&amp;nbsp; &amp;nbsp;Thank you for your help as always&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| search NOT Condition&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Oct 2021 14:11:22 GMT</pubDate>
    <dc:creator>neerajs_81</dc:creator>
    <dc:date>2021-10-15T14:11:22Z</dc:date>
    <item>
      <title>Splunk query to check for S3 Buckets in AWS using PutBucketPolicy</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571089#M199003</link>
      <description>&lt;P&gt;Can someone help me to build a search query for the below use case ?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;My use case is to detect if any S3 buckets have been set for Public access via PutBucketPolicy event. So far thanks to help from Folks (&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/214410"&gt;@isoutamo&lt;/a&gt;&amp;nbsp; on this Community,&amp;nbsp; &amp;nbsp;i have got my search to check for fields&amp;nbsp;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Effect&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;Principal&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;both should have values&amp;nbsp; "Allow"&amp;nbsp; and "&lt;STRONG&gt;&amp;nbsp;*&lt;/STRONG&gt;&amp;nbsp; or&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;{AWS:*} "&amp;nbsp;&amp;nbsp;&lt;/STRONG&gt;respectively&amp;nbsp;for the same SID.&amp;nbsp; &amp;nbsp;Basically the following 2 conditions must be met for a particular SID.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;Effect&lt;/STRONG&gt;: Allow&lt;BR /&gt;&lt;STRONG&gt;Principal&lt;/STRONG&gt;:&amp;nbsp;&lt;STRONG&gt;&amp;nbsp;*&lt;/STRONG&gt;&amp;nbsp; OR&amp;nbsp;{AWS:*}&lt;BR /&gt;-----------------------&lt;BR /&gt;&amp;nbsp;Next i want to further filter based on the field "&lt;STRONG&gt;Condition&lt;/STRONG&gt;" .&amp;nbsp; &amp;nbsp;How to just filter if "Condition" exists or not ?&lt;BR /&gt;&lt;BR /&gt;Below is a snippet of raw event data&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;"eventName": "PutBucketPolicy"
 "awsRegion": "us-east-1"
 "sourceIPAddress": "N.N.N.N"
 "userAgent": "[S3Console/0.4
 aws-internal/3 aws-sdk-java/1.11.1002 Linux/5.4.129-72.229.amzn2int.x86_64]"
 "requestParameters": {"bucketPolicy": {"Version": "2012-10-17"
 "Statement": [{"Sid": "Access-to-specific-VPCE-only"
 "Effect": "Allow"
 "Principal": "*"
 "Action": "s3:*"
 "Resource": "arn:aws:s3:::abc-logs/*"
 "Condition": {"StringEquals": {"aws:sourceVpce": "XXX"}}}]
 "Id": "Policy14151152"}
 "bucketName": "Bucket-name"
 "Host": "host.xyz.com"
 "policy": ""}

=============

"eventName": "PutBucketPolicy"
 "awsRegion": "us-east-1"
 "sourceIPAddress": "N.N.N.N"
 "userAgent": "[S3Console/0.4
 aws-internal/3 aws-sdk-java/1.11.1002 Linux/5.4.116-64.217.amzn2int.x86_64 OpenJDK_64-Bit_Server_VM/Oracle_Corporation cfg/retry-mode/legacy]"
 "requestParameters": {"bucketPolicy": {"Version": "2012-10-17"
 "Statement": [{"Effect": "Allow"
 "Principal": "*"
 "Action": ["s3:List*"
 "s3:Get*"]
 "Resource": "arn:aws:s3::/*"
 "Condition": {"IpAddress": {"aws:SourceIp": ["N.N.N.N"
 "N.N.N.N"]}}}]}
 "bucketName": "bucket-name"
 "Host": "abc.xyz.com"
 "policy": ""}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have tried the below 3 options to check for the presence of the field &lt;STRONG&gt;Condition&lt;/STRONG&gt;&amp;nbsp; , but none are working.&amp;nbsp; These end up showing Events where the raw data contains a &lt;STRONG&gt;Condition&lt;/STRONG&gt; defined.&amp;nbsp; I want my search to not exclude those events which contain &lt;STRONG&gt;Condition&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| spath requestParameters.bucketPolicy.Statement{} output=Statement
| mvexpand Statement
| spath input=Statement
| where Effect="Allow"
| where Principal="*" OR Principal.AWS="*
| where isnull(Condition) 

OR
| where Condition=""

OR
|search Condition=""&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 13:26:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571089#M199003</guid>
      <dc:creator>neerajs_81</dc:creator>
      <dc:date>2021-10-15T13:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query to check for S3 Buckets in AWS using PutBucketPolicy</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571094#M199006</link>
      <description>&lt;P&gt;Please can you check the raw data you have share as it seems to have mismatched brackets, curly brackets and missing commas.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 12:25:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571094#M199006</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-15T12:25:34Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query to check for S3 Buckets in AWS using PutBucketPolicy</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571096#M199007</link>
      <description>&lt;P&gt;Kindly ignore the brackets or syntax errors if possible.&amp;nbsp; I have manually copy pasted different values of Conditions from multiple events , into this one common snippet here.&lt;BR /&gt;&lt;BR /&gt;Can you help me how to exclude events which have &lt;STRONG&gt;Condition&lt;/STRONG&gt; defined?&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 12:30:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571096#M199007</guid>
      <dc:creator>neerajs_81</dc:creator>
      <dc:date>2021-10-15T12:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query to check for S3 Buckets in AWS using PutBucketPolicy</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571097#M199008</link>
      <description>&lt;P&gt;Without the correct JSON, it is more difficult to determine what the correct spath etc. should be&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 12:34:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571097#M199008</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-15T12:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query to check for S3 Buckets in AWS using PutBucketPolicy</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571105#M199012</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; &amp;nbsp;i have now fixed the syntax of the raw events in my original question. Have provided 2 samples of such events where Condition exists. Pls let me know.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 13:25:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571105#M199012</guid>
      <dc:creator>neerajs_81</dc:creator>
      <dc:date>2021-10-15T13:25:27Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query to check for S3 Buckets in AWS using PutBucketPolicy</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571106#M199013</link>
      <description>&lt;LI-CODE lang="markup"&gt;| spath requestParameters.bucketPolicy.Statement{} output=Statement
| mvexpand Statement
| spath input=Statement
| spath input=Statement Condition output=Condition
| where Effect="Allow"
| where Principal="*" OR Principal.AWS="*"
| where isnull(Condition)&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 15 Oct 2021 13:38:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571106#M199013</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-15T13:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query to check for S3 Buckets in AWS using PutBucketPolicy</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571112#M199016</link>
      <description>&lt;P&gt;I have already tried that "where isnull(Condition)" and "where isnull('Condition') in single quotes" as i mentioned in my post, surprisingly it still shows events have Condition in them.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 14:05:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571112#M199016</guid>
      <dc:creator>neerajs_81</dc:creator>
      <dc:date>2021-10-15T14:05:43Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query to check for S3 Buckets in AWS using PutBucketPolicy</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571115#M199017</link>
      <description>&lt;P&gt;Never mind.&amp;nbsp; It was my oversight that i didn't see the option of "Exclude from Search" if you click on that field in the Splunk UI itself.&amp;nbsp; I used that and below filter worked.&amp;nbsp; Any idea as in why isnull() didnt work here&amp;nbsp; but this one did.&amp;nbsp; &amp;nbsp;Thank you for your help as always&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| search NOT Condition&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 14:11:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571115#M199017</guid>
      <dc:creator>neerajs_81</dc:creator>
      <dc:date>2021-10-15T14:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query to check for S3 Buckets in AWS using PutBucketPolicy</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571117#M199018</link>
      <description>&lt;P&gt;It is hard to say without access to the real data - it works in my test environment based on the doctored events that you posted.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 14:15:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571117#M199018</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-15T14:15:04Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query to check for S3 Buckets in AWS using PutBucketPolicy</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571125#M199024</link>
      <description>&lt;P&gt;Can i send you the full raw event offline via DM ?&amp;nbsp; Apparently came across one event that had multiple conditions within it and confusing the hell.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 15:05:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571125#M199024</guid>
      <dc:creator>neerajs_81</dc:creator>
      <dc:date>2021-10-15T15:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk query to check for S3 Buckets in AWS using PutBucketPolicy</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571126#M199025</link>
      <description>&lt;P&gt;OK - I will delete it as soon as we are finished with it&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 15:09:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-query-to-check-for-S3-Buckets-in-AWS-using/m-p/571126#M199025</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-15T15:09:36Z</dc:date>
    </item>
  </channel>
</rss>

