All Apps and Add-ons

Splunk App for AWS: How to create an alert to trigger every time the amount of security group rules changes?

r1tual
New Member

I am trying to get Splunk Enterprise to alert on changes to a security group with information that is being fed in from an AWS account using the Splunk App for AWS. I have the information being presented into Splunk with the following search:

aws-description-resource((aws_account_id="*"),  (region="**") , "ec2_security_groups")` | spath path=rules{} output=ingress  | spath path=rules_egress{} output=egress  | stats count(ingress) as ingress, count(egress) as egress   | eval count=ingress+egress   | nadefault count

This results in a data set that looks like this:

ingress     egress      count
302         302         604

Now the problem with this is I am trying to get an alert generated every time the amount of security group rules changes. This information is then being fed into the Slack Notification App in order to produce a Splunk Bot post in a particular Channel. So far I have not been able to do this with any combination of custom alerts and searches. Any help with this would be greatly appreciated as this is a necessary integration for our organization.

0 Karma
1 Solution

czhang_splunk
Splunk Employee
Splunk Employee

hi r1tual, could you please double check whether you have configured AWS Config in App? If so, there should be some events with sourcetype="aws:config:notification". Every time you create/delete/modify the resource in AWS, there will be a aws:config:notification event logged the diff of your modification.

View solution in original post

czhang_splunk
Splunk Employee
Splunk Employee

hi r1tual, could you please double check whether you have configured AWS Config in App? If so, there should be some events with sourcetype="aws:config:notification". Every time you create/delete/modify the resource in AWS, there will be a aws:config:notification event logged the diff of your modification.

czhang_splunk
Splunk Employee
Splunk Employee

Is that OK to use AWS Config Notification to monitor the SG changes? Basically you can use sourcetype="aws:config:notification" "configurationItem.resourceType"="AWS::EC2::SecurityGroup" to detect whether there is any update of SGs.

0 Karma

r1tual
New Member

I tried doing this by using aws config like you said but that does not return any data with the search query that you gave. Still not sure how to do this.

0 Karma

czhang_splunk
Splunk Employee
Splunk Employee

hi r1tual, could you please double check whether you have configured AWS Config in App? If so, there should be some events with sourcetype="aws:config:notification". Every time you create/delete/modify the resource in AWS, there will be a aws:config:notification event logged the diff of your modification.

0 Karma

r1tual
New Member

Thank you very much this is exactly what I was looking for. Now I am just working on outputting the results to slack channel with an alert and I will be good to go.

0 Karma

czhang_splunk
Splunk Employee
Splunk Employee

Would you please mark this as the answer? Thanks!

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...