Revert "Merge pull request #566 from mozilla/fix_camelcase_alert"

This reverts commit 78fcd5b632, reversing
changes made to 761f16423d.
This commit is contained in:
Brandon Myers 2017-12-08 16:09:13 -06:00
Родитель 1d08e2dc3b
Коммит 20813b7835
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 8AA79AD83045BBC7
4 изменённых файлов: 8 добавлений и 13 удалений

Просмотреть файл

@ -18,10 +18,10 @@ class AlertCloudtrailLoggingDisabled(AlertTask):
search_query.add_must([
TermMatch('_type', 'cloudtrail'),
TermMatch('details.eventname', 'StopLogging'),
TermMatch('details.eventName', 'StopLogging'),
])
search_query.add_must_not(TermMatch('details.errorcode', 'AccessDenied'))
search_query.add_must_not(TermMatch('details.errorCode', 'AccessDenied'))
self.filtersManual(search_query)
self.searchEventsSimple()
@ -32,6 +32,6 @@ class AlertCloudtrailLoggingDisabled(AlertTask):
tags = ['cloudtrail', 'aws', 'cloudtrailpagerduty']
severity = 'CRITICAL'
summary = 'Cloudtrail Logging Disabled: ' + event['_source']['details']['requestparameters']['name']
summary = 'Cloudtrail Logging Disabled: ' + event['_source']['details']['requestParameters']['name']
return self.createAlertDict(summary, category, tags, [event], severity)

Просмотреть файл

@ -14,7 +14,7 @@ class TestAlertCloudtrailDeadman(AlertTestSuite):
"_type": "cloudtrail",
"_source": {
"details": {
"eventname": "somename"
"eventName": "somename"
}
}
}

Просмотреть файл

@ -13,8 +13,8 @@ class TestAlertCloudtrailLoggingDisabled(AlertTestSuite):
"_type": "cloudtrail",
"_source": {
"details": {
"eventname": "StopLogging",
"requestparameters": {
"eventName": "StopLogging",
"requestParameters": {
"name": "cloudtrail_example_name"
}
}
@ -61,7 +61,7 @@ class TestAlertCloudtrailLoggingDisabled(AlertTestSuite):
)
event = AlertTestSuite.create_event(default_event)
event['_source']['details']['eventname'] = 'Badeventname'
event['_source']['details']['eventName'] = 'Badeventname'
test_cases.append(
NegativeAlertTestCase(
description="Negative test case with bad eventName",
@ -80,7 +80,7 @@ class TestAlertCloudtrailLoggingDisabled(AlertTestSuite):
)
event = AlertTestSuite.create_event(default_event)
event['_source']['details']['errorcode'] = 'AccessDenied'
event['_source']['details']['errorCode'] = 'AccessDenied'
test_cases.append(
NegativeAlertTestCase(
description="Negative test case with excluding errorCode",

Просмотреть файл

@ -94,10 +94,5 @@ class TestTermMatchNegativeTestSuite(NegativeTestSuite):
TermMatch('somekey', 'tag'): [
{'somekey': ['atag', 'tagging']},
],
TermMatch('CamelCaseKey', 'test'): [
{'camelcasekey': 'test'},
{'camelCaseKey': 'test'},
{'camelcaseKey': 'test'},
],
}
return tests