diff --git a/README.md b/README.md index 5587c4b..7928814 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ grafana_host="http://localhost:3000" grafana_cred="admin:admin" # Keep grafana_folder empty for adding the dashboards in "General" folder grafana_folder="AWS CloudWatch" -ds=(1516 677 139 674 590 659 758 623 617 551 653 969 650 644 607 593 707 575 1519 581 584 2969 8050 11099 11154 11155 12979 13018 13040 13104 13892 14189 14391 14392 14954 14955 15016 16899 17741 17978 20007 20008); +ds=(1516 677 139 674 590 659 758 623 617 551 653 969 650 644 607 593 707 575 1519 581 584 2969 8050 11099 11154 11155 12979 13018 13040 13104 13892 14189 14391 14392 14954 14955 15016 16899 17741 17978 20007 20008 20009); folderId=$(curl -s -k -u "$grafana_cred" $grafana_host/api/folders | jq -r --arg grafana_folder "$grafana_folder" '.[] | select(.title==$grafana_folder).id') if [ -z "$folderId" ] ; then echo "Didn't get folderId" ; else echo "Got folderId $folderId" ; fi for d in "${ds[@]}"; do @@ -212,6 +212,9 @@ Single click provisioning [![Gitpod ready-to-test](https://img.shields.io/badge/ ### [AWS VPN](https://github.com/monitoringartist/grafana-aws-cloudwatch-dashboards/tree/master/aws-vpn) +### [AWS WAF](https://github.com/monitoringartist/grafana-aws-cloudwatch-dashboards/tree/master/aws-waf) +[![AWS WAF](aws-waf/aws-waf.png)](https://github.com/monitoringartist/grafana-aws-cloudwatch-dashboards/tree/master/aws-waf) + ### [AWS X-Ray](https://github.com/monitoringartist/grafana-aws-cloudwatch-dashboards/tree/master/aws-x-ray) [![AWS X-Ray](aws-x-ray/aws-x-ray.png)](https://github.com/monitoringartist/grafana-aws-cloudwatch-dashboards/tree/master/aws-x-ray) diff --git a/aws-waf/aws-waf.json b/aws-waf/aws-waf.json new file mode 100644 index 0000000..73c07be --- /dev/null +++ b/aws-waf/aws-waf.json @@ -0,0 +1,938 @@ +{ + "__inputs": [], + "__elements": {}, + "__requires": [ + { + "type": "datasource", + "id": "cloudwatch", + "name": "CloudWatch", + "version": "1.0.0" + }, + { + "type": "grafana", + "id": "grafana", + "name": "Grafana", + "version": "10.2.0" + }, + { + "type": "panel", + "id": "text", + "name": "Text", + "version": "" + }, + { + "type": "panel", + "id": "timeseries", + "name": "Time series", + "version": "" + } + ], + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Visualize AWS WAF metrics", + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": null, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "cloudwatch", + "uid": "$datasource" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 3, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.2.0", + "targets": [ + { + "alias": "{{ metric }} {{ Region }} {{ WebACL }} {{ Rule }}", + "datasource": { + "uid": "$datasource" + }, + "dimensions": { + "Region": "$Region", + "Rule": "$Rule", + "WebACL": "$WebACL" + }, + "expression": "", + "id": "", + "label": "${PROP('MetricName')} ${PROP('Dim.Region')} ${PROP('Dim.WebACL')} ${PROP('Dim.Rule')}", + "matchExact": true, + "metricEditorMode": 0, + "metricName": "AllowedRequests", + "metricQueryType": 0, + "namespace": "AWS/WAFV2", + "period": "", + "refId": "A", + "region": "$Region", + "statistic": "Sum" + }, + { + "alias": "{{ metric }} {{ Region }} {{ WebACL }} {{ Rule }}", + "datasource": { + "uid": "$datasource" + }, + "dimensions": { + "Region": "$Region", + "Rule": "$Rule", + "WebACL": "$WebACL" + }, + "expression": "", + "hide": false, + "id": "", + "label": "${PROP('MetricName')} ${PROP('Dim.Region')} ${PROP('Dim.WebACL')} ${PROP('Dim.Rule')}", + "matchExact": true, + "metricEditorMode": 0, + "metricName": "BlockedRequests", + "metricQueryType": 0, + "namespace": "AWS/WAFV2", + "period": "", + "refId": "B", + "region": "$Region", + "statistic": "Sum" + } + ], + "title": "AllowedRequests / BlockedRequests", + "type": "timeseries" + }, + { + "datasource": { + "type": "cloudwatch", + "uid": "$datasource" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 9 + }, + "id": 6, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.2.0", + "targets": [ + { + "alias": "{{ metric }} {{ Region }} {{ WebACL }} {{ Rule }}", + "datasource": { + "uid": "$datasource" + }, + "dimensions": { + "Region": "$Region", + "Rule": "$Rule", + "WebACL": "$WebACL" + }, + "expression": "", + "id": "", + "label": "${PROP('MetricName')} ${PROP('Dim.Region')} ${PROP('Dim.WebACL')} ${PROP('Dim.Rule')}", + "matchExact": true, + "metricEditorMode": 0, + "metricName": "CountedRequests", + "metricQueryType": 0, + "namespace": "AWS/WAFV2", + "period": "", + "refId": "A", + "region": "$Region", + "statistic": "Sum" + }, + { + "alias": "{{ metric }} {{ Region }} {{ WebACL }} {{ Rule }}", + "datasource": { + "uid": "$datasource" + }, + "dimensions": { + "Region": "$Region", + "Rule": "$Rule", + "WebACL": "$WebACL" + }, + "expression": "", + "hide": false, + "id": "", + "label": "${PROP('MetricName')} ${PROP('Dim.Region')} ${PROP('Dim.WebACL')} ${PROP('Dim.Rule')}", + "matchExact": true, + "metricEditorMode": 0, + "metricName": "PassedRequests", + "metricQueryType": 0, + "namespace": "AWS/WAFV2", + "period": "", + "refId": "B", + "region": "$Region", + "statistic": "Sum" + } + ], + "title": "CountedRequests / PassedRequests", + "type": "timeseries" + }, + { + "datasource": { + "type": "cloudwatch", + "uid": "$datasource" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 18 + }, + "id": 7, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.2.0", + "targets": [ + { + "alias": "{{ metric }} {{ Region }} {{ WebACL }} {{ Rule }}", + "datasource": { + "uid": "$datasource" + }, + "dimensions": { + "Region": "$Region", + "Rule": "$Rule", + "WebACL": "$WebACL" + }, + "expression": "", + "id": "", + "label": "${PROP('MetricName')} ${PROP('Dim.Region')} ${PROP('Dim.WebACL')} ${PROP('Dim.Rule')}", + "matchExact": true, + "metricEditorMode": 0, + "metricName": "CaptchaRequests", + "metricQueryType": 0, + "namespace": "AWS/WAFV2", + "period": "", + "refId": "A", + "region": "$Region", + "statistic": "Sum" + }, + { + "alias": "{{ metric }} {{ Region }} {{ WebACL }} {{ Rule }}", + "datasource": { + "uid": "$datasource" + }, + "dimensions": { + "Region": "$Region", + "Rule": "$Rule", + "WebACL": "$WebACL" + }, + "expression": "", + "hide": false, + "id": "", + "label": "${PROP('MetricName')} ${PROP('Dim.Region')} ${PROP('Dim.WebACL')} ${PROP('Dim.Rule')}", + "matchExact": true, + "metricEditorMode": 0, + "metricName": "RequestsWithValidCaptchaToken", + "metricQueryType": 0, + "namespace": "AWS/WAFV2", + "period": "", + "refId": "B", + "region": "$Region", + "statistic": "Sum" + } + ], + "title": "CaptchaRequests / RequestsWithValidCaptchaToken", + "type": "timeseries" + }, + { + "datasource": { + "type": "cloudwatch", + "uid": "$datasource" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 27 + }, + "id": 8, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.2.0", + "targets": [ + { + "alias": "{{ metric }} {{ Region }} {{ WebACL }} {{ Rule }}", + "datasource": { + "uid": "$datasource" + }, + "dimensions": { + "Region": "$Region", + "Rule": "$Rule", + "WebACL": "$WebACL" + }, + "expression": "", + "id": "", + "label": "${PROP('MetricName')} ${PROP('Dim.Region')} ${PROP('Dim.WebACL')} ${PROP('Dim.Rule')}", + "matchExact": true, + "metricEditorMode": 0, + "metricName": "CaptchasAttempted", + "metricQueryType": 0, + "namespace": "AWS/WAFV2", + "period": "", + "refId": "A", + "region": "$Region", + "statistic": "Sum" + }, + { + "alias": "{{ metric }} {{ Region }} {{ WebACL }} {{ Rule }}", + "datasource": { + "uid": "$datasource" + }, + "dimensions": { + "Region": "$Region", + "Rule": "$Rule", + "WebACL": "$WebACL" + }, + "expression": "", + "hide": false, + "id": "", + "label": "${PROP('MetricName')} ${PROP('Dim.Region')} ${PROP('Dim.WebACL')} ${PROP('Dim.Rule')}", + "matchExact": true, + "metricEditorMode": 0, + "metricName": "CaptchasSolved", + "metricQueryType": 0, + "namespace": "AWS/WAFV2", + "period": "", + "refId": "B", + "region": "$Region", + "statistic": "Sum" + } + ], + "title": "CaptchasAttempted / CaptchasSolved", + "type": "timeseries" + }, + { + "datasource": { + "type": "cloudwatch", + "uid": "$datasource" + }, + "description": "", + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisBorderShow": false, + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 10, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "insertNulls": false, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "none" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 36 + }, + "id": 9, + "options": { + "legend": { + "calcs": [ + "mean", + "lastNotNull", + "max", + "min" + ], + "displayMode": "table", + "placement": "bottom", + "showLegend": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.2.0", + "targets": [ + { + "alias": "{{ metric }} {{ Region }} {{ WebACL }} {{ Rule }}", + "datasource": { + "uid": "$datasource" + }, + "dimensions": { + "Region": "$Region", + "Rule": "$Rule", + "WebACL": "$WebACL" + }, + "expression": "", + "id": "", + "label": "${PROP('MetricName')} ${PROP('Dim.Region')} ${PROP('Dim.WebACL')} ${PROP('Dim.Rule')}", + "matchExact": true, + "metricEditorMode": 0, + "metricName": "ChallengeRequests", + "metricQueryType": 0, + "namespace": "AWS/WAFV2", + "period": "", + "refId": "A", + "region": "$Region", + "statistic": "Sum" + }, + { + "alias": "{{ metric }} {{ Region }} {{ WebACL }} {{ Rule }}", + "datasource": { + "uid": "$datasource" + }, + "dimensions": { + "Region": "$Region", + "Rule": "$Rule", + "WebACL": "$WebACL" + }, + "expression": "", + "hide": false, + "id": "", + "label": "${PROP('MetricName')} ${PROP('Dim.Region')} ${PROP('Dim.WebACL')} ${PROP('Dim.Rule')}", + "matchExact": true, + "metricEditorMode": 0, + "metricName": "RequestsWithValidChallengeToken", + "metricQueryType": 0, + "namespace": "AWS/WAFV2", + "period": "", + "refId": "B", + "region": "$Region", + "statistic": "Sum" + } + ], + "title": "ChallengeRequests / RequestsWithValidChallengeToken", + "type": "timeseries" + }, + { + "datasource": { + "uid": "$datasource" + }, + "editable": false, + "error": false, + "gridPos": { + "h": 3, + "w": 24, + "x": 0, + "y": 45 + }, + "id": 5, + "links": [], + "options": { + "code": { + "language": "plaintext", + "showLineNumbers": false, + "showMiniMap": false + }, + "content": "<a href=\"http://www.monitoringartist.com\" target=\"_blank\" title=\"Dashboard maintained by Monitoring Artist - DevOps / Docker / Kubernetes / AWS ECS / Google GCP / Zabbix / Zenoss / Terraform / Monitoring\"><img src=\"https://monitoringartist.github.io/monitoring-artist-logo-grafana.png\" height=\"30px\" /></a> | \n<a target=\"_blank\" href=\"https://docs.aws.amazon.com/waf/latest/developerguide/monitoring-cloudwatch.html\">AWS CloudWatch WAF documentation</a> | \n<a target=\"_blank\" href=\"https://grafana.com/dashboards/20009\">Installed from Grafana.com dashboards</a>\n", + "mode": "html" + }, + "pluginVersion": "10.2.0", + "targets": [ + { + "datasource": { + "uid": "$datasource" + }, + "refId": "A" + } + ], + "title": "Documentation", + "type": "text" + } + ], + "refresh": "", + "schemaVersion": 38, + "tags": [ + "monitoringartist", + "cloudwatch" + ], + "templating": { + "list": [ + { + "current": {}, + "hide": 0, + "includeAll": false, + "label": "Datasource", + "multi": false, + "name": "datasource", + "options": [], + "query": "cloudwatch", + "queryValue": "", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "type": "datasource" + }, + { + "current": {}, + "datasource": { + "uid": "$datasource" + }, + "definition": "regions()", + "hide": 0, + "includeAll": false, + "label": "Region", + "multi": false, + "name": "region", + "options": [], + "query": "regions()", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": "*", + "current": {}, + "datasource": { + "uid": "$datasource" + }, + "definition": "dimension_values($region,AWS/WAFV2,AllowedRequests,Region)", + "description": "", + "hide": 0, + "includeAll": false, + "label": "WAF Region", + "multi": false, + "name": "Region", + "options": [], + "query": "dimension_values($region,AWS/WAFV2,AllowedRequests,Region)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": "*", + "current": {}, + "datasource": { + "uid": "$datasource" + }, + "definition": "dimension_values($region,AWS/WAFV2,AllowedRequests,WebACL)", + "description": "", + "hide": 0, + "includeAll": false, + "label": "WebACL", + "multi": false, + "name": "WebACL", + "options": [], + "query": "dimension_values($region,AWS/WAFV2,AllowedRequests,WebACL)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": "*", + "current": {}, + "datasource": { + "uid": "$datasource" + }, + "definition": "dimension_values($region,AWS/WAFV2,AllowedRequests,Rule)", + "description": "", + "hide": 0, + "includeAll": false, + "label": "Rule", + "multi": false, + "name": "Rule", + "options": [], + "query": "dimension_values($region,AWS/WAFV2,AllowedRequests,Rule)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "allValue": "*", + "current": {}, + "datasource": { + "uid": "$datasource" + }, + "definition": "dimension_values($region,AWS/WAFV2,AllowedRequests,RuleGroup)", + "description": "", + "hide": 0, + "includeAll": false, + "label": "RuleGroup", + "multi": false, + "name": "RuleGroup", + "options": [], + "query": "dimension_values($region,AWS/WAFV2,AllowedRequests,RuleGroup)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-1d", + "to": "now" + }, + "timepicker": {}, + "timezone": "browser", + "title": "AWS WAF", + "uid": "AWSWAFaaa", + "version": 1, + "weekStart": "" +} \ No newline at end of file diff --git a/aws-waf/aws-waf.png b/aws-waf/aws-waf.png new file mode 100644 index 0000000..b3fd023 Binary files /dev/null and b/aws-waf/aws-waf.png differ diff --git a/dashboards.libsonnet b/dashboards.libsonnet index 9b3628d..167e043 100644 --- a/dashboards.libsonnet +++ b/dashboards.libsonnet @@ -41,6 +41,7 @@ 'aws-transfer-family.json': (import 'aws-transfer-family/aws-transfer-family.json'), 'aws-transit-gateway.json': (import 'aws-transit-gateway/aws-transit-gateway.json'), 'aws-vpn.json': (import 'aws-vpn/aws-vpn.json'), + 'aws-waf.json': (import 'aws-waf/aws-waf.json'), 'aws-x-ray.json': (import 'aws-x-ray/aws-x-ray.json'), }, }