Skip to content

Instantly share code, notes, and snippets.

@vikrum
Created October 6, 2020 18:46
Show Gist options
  • Save vikrum/7658ed849f7fc56981f0f79765aed3f1 to your computer and use it in GitHub Desktop.
Save vikrum/7658ed849f7fc56981f0f79765aed3f1 to your computer and use it in GitHub Desktop.
From Detecting Manual AWS Console Actions - https://arkadiyt.com/2019/11/12/detecting-manual-aws-console-actions/
"query": {
"bool": {
"must": [
{
"range": {
"@timestamp": {
"gte": "now/m-1m",
"lt": "now/m"
}
}
},
{
"bool": {
"should": [
{
"term": {
"userAgent": "console.amazonaws.com"
}
},
{
"term": {
"userAgent": "Coral/Jakarta"
}
},
{
"term": {
"userAgent": "Coral/Netty4"
}
},
{
"term": {
"userAgent": "AWS CloudWatch Console"
}
},
{
"prefix": {
"userAgent": "S3Console/"
}
},
{
"prefix": {
"userAgent": "[S3Console/"
}
},
{
"prefix": {
"userAgent": "Mozilla/"
}
},
{
"wildcard": {
"userAgent": "console.*.amazonaws.com"
}
},
{
"wildcard": {
"userAgent": "aws-internal*AWSLambdaConsole/*"
}
}
]
}
}
],
"must_not": [
{
"prefix": {
"eventName": "Get"
}
},
{
"prefix": {
"eventName": "Describe"
}
},
{
"prefix": {
"eventName": "List"
}
},
{
"prefix": {
"eventName": "Head"
}
},
{
"term": {
"eventName": "DownloadDBLogFilePortion"
}
},
{
"term": {
"eventName": "TestScheduleExpression"
}
},
{
"term": {
"eventName": "TestEventPattern"
}
},
{
"term": {
"eventName": "LookupEvents"
}
},
{
"term": {
"eventName": "listDnssec"
}
},
{
"term": {
"eventName": "Decrypt"
}
},
{
"term": {
"eventName": "REST.GET.OBJECT_LOCK_CONFIGURATION"
}
},
{
"term": {
"eventName": "ConsoleLogin"
}
},
{
"term": {
"userIdentity.invokedBy.keyword": "AWS Internal"
}
},
{
"bool": {
"must": [
{
"term": {
"eventName": "AssumeRole"
}
},
{
"term": {
"userAgent": "Coral/Netty4"
}
},
{
"bool": {
"should": [
{
"term": {
"userIdentity.invokedBy.keyword": "ecs-tasks.amazonaws.com"
}
},
{
"term": {
"userIdentity.invokedBy.keyword": "ec2.amazonaws.com"
}
},
{
"term": {
"userIdentity.invokedBy.keyword": "monitoring.rds.amazonaws.com"
}
},
{
"term": {
"userIdentity.invokedBy.keyword": "lambda.amazonaws.com"
}
}
]
}
}
]
}
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment