Definitions for @turbot/aws-wafregional

metricName

{
"type": "string",
"pattern": "^[a-zA-Z0-9._-]*$",
"tests": [
{
"input": "Foo"
},
{
"description": "invalid - special characters at, exclamation, dollar sign, hash not accepted",
"input": "test@123@Fail#!#$4",
"expected": false
},
{
"description": "invalid - array type",
"input": [
"test12357487"
],
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/aws-wafregional#/definitions/metricName",
"modUri": "tmod:@turbot/aws-wafregional"
}
}

negated

{
"type": "boolean",
"enum": [
true,
false
],
"tests": [
{
"input": true
},
{
"input": false
},
{
"description": "invalid - incorrect value provided",
"input": "Active",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/aws-wafregional#/definitions/negated",
"modUri": "tmod:@turbot/aws-wafregional"
}
}

predicates

{
"type": "object",
"properties": {
"Negated": {
"$ref": "#/definitions/negated"
},
"Type": {
"$ref": "#/definitions/predicateType"
},
"DataId": {
"type": "string"
}
},
"tests": [
{
"description": "base case",
"input": {
"Negated": true,
"Type": "ByteMatch",
"DataId": "5ec1f2c8-f14c-4ad9-97bd-2c9afe724eb6"
}
},
{
"description": "invalid - array provided for data id",
"input": {
"Negated": true,
"Type": "ByteMatch",
"DataId": [
"MatchID0093782"
]
},
"expected": false
},
{
"description": "invalid - incorrect value provided for negated",
"input": {
"Negated": "ACTIVE",
"Type": "ByteMatch",
"DataId": "MatchID0093782"
},
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/aws-wafregional#/definitions/predicates",
"modUri": "tmod:@turbot/aws-wafregional"
}
}

predicateType

{
"type": "string",
"enum": [
"IPMatch",
"ByteMatch",
"SqlInjectionMatch",
"GeoMatch",
"SizeConstraint",
"XssMatch",
"RegexMatch"
],
"tests": [
{
"input": "IPMatch"
},
{
"description": "invald - incorrect value",
"input": "NoMatch",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/aws-wafregional#/definitions/predicateType",
"modUri": "tmod:@turbot/aws-wafregional"
}
}

reginalRuleAka

{
"type": "string",
"pattern": "^arn:aws(-us-gov|-cn)?:waf-regional:[a-z]{2}(-gov)?-[a-z]+-[0-9]:[0-9]{12}:rule/[0-9a-f-]+(?:[0-9a-f]{1,128})?$",
"tests": [
{
"description": "Valid - Base case",
"input": "arn:aws:waf-regional:us-east-1:123456789012:rule/5ec1f2c8-f14c-4ad9-97bd-2c9afe724eb6"
},
{
"description": "Invalid - Malformed resource collection",
"input": "arn:aws:waf::123456789012:rateBasfedRule/Admins",
"expected": false
},
{
"description": "Invalid - Malformed account ID",
"input": "arn:aws:waf::123456789012234:rateBasedRule/Admins",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/aws-wafregional#/definitions/reginalRuleAka",
"modUri": "tmod:@turbot/aws-wafregional"
}
}

regionName

{
"type": "string",
"enum": [
"ap-northeast-1",
"ap-southeast-2",
"ca-central-1",
"eu-central-1",
"eu-west-1",
"eu-west-2",
"us-east-1",
"us-east-2",
"us-west-1",
"us-west-2"
],
"tests": [
{
"input": "us-east-1"
},
{
"description": "invalid - usea1",
"input": "usea1",
"expected": false
},
{
"description": "invalid - au-north-1",
"input": "au-north-1",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/aws-wafregional#/definitions/regionName",
"modUri": "tmod:@turbot/aws-wafregional"
}
}

rule

{
"type": "object",
"properties": {
"RuleId": {
"$ref": "#/definitions/ruleId"
},
"Name": {
"$ref": "#/definitions/ruleName"
},
"MetricName": {
"$ref": "#/definitions/metricName"
},
"Predicates": {
"$ref": "#/definitions/predicates"
},
"turbot": {
"type": "object",
"properties": {
"akas": {
"type": "array",
"items": {
"$ref": "#/definitions/reginalRuleAka"
}
},
"title": {
"$ref": "#/definitions/ruleName"
},
"custom": {
"type": "object",
"properties": {
"aws": {
"$ref": "aws#/definitions/awsMetadata"
},
"createTimestamp": {
"$ref": "turbot#/definitions/isoTimestamp"
}
}
}
}
}
},
"additionalProperties": true,
"tests": [
{
"description": "base case",
"input": {
"RuleId": "5ec1f2c8-f14c-4ad9-97bd-2c9afe724eb6",
"Name": "test001",
"MetricName": "Metric123",
"Predicates": {
"DataId": "5ec1f2c8-f14c-4ad9-97bd-2c9afe724eb6",
"Negated": false,
"Type": "IPMatch"
},
"turbot": {
"akas": [
"arn:aws:waf-regional:us-east-1:123456789012:rule/5ec1f2c8-f14c-4ad9-97bd-2c9afe724eb6"
],
"title": "test001",
"custom": {
"aws": {
"accountId": 123456789012
}
}
}
}
}
],
".turbot": {
"uri": "tmod:@turbot/aws-wafregional#/definitions/rule",
"modUri": "tmod:@turbot/aws-wafregional"
}
}

ruleId

{
"type": "string",
"pattern": "^[0-9a-f-]+(?:[0-9a-f]{1,128})?$",
"tests": [
{
"description": "base",
"input": "5ec1f2c8-f14c-4ad9-97bd-2c9afe724eb6"
},
{
"description": "invalid - cannot contain white spaces",
"input": "test ID Rule",
"expected": false
},
{
"description": "invalid - array type provided",
"input": [
"test"
],
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/aws-wafregional#/definitions/ruleId",
"modUri": "tmod:@turbot/aws-wafregional"
}
}

ruleName

{
"type": "string",
"pattern": "^[a-zA-Z0-9_-]{1,128}$",
"tests": [
{
"input": "RuleName_Jacks-999"
},
{
"description": "invalid - too long",
"input": "CuLCs7jK5257sEXJ6tVH8cKcn7w2AsFe35jPXgqUEPLxvqyTQhK3EVJdTCF6faaW6WN767269QTkUUSfaebvjaRd65hRvBKD4HAJrPtCqh2GMBxGVcR8Bfd2cLtfvusp1",
"expected": false
},
{
"description": "invalid - empty string passed",
"input": "",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/aws-wafregional#/definitions/ruleName",
"modUri": "tmod:@turbot/aws-wafregional"
}
}

wafRegional

{
"allOf": [
{
"$ref": "turbot#/definitions/service"
},
{
"type": "object",
"properties": {
"name": {
"const": "WAF Regional"
},
"turbot": {
"type": "object",
"properties": {
"akas": {
"type": "array",
"items": {
"$ref": "#/definitions/wafRegionalAka"
}
},
"title": {
"const": "WAF Regional"
},
"custom": {
"type": "object",
"properties": {
"aws": {
"$ref": "aws#/definitions/awsMetadata"
}
}
}
}
}
},
"additionalProperties": true,
"tests": [
{
"description": "WAF Regional",
"input": {
"name": "WAF Regional",
"turbot": {
"akas": [
"arn:aws:ec2:us-east-1:123456789012"
],
"title": "WAF Regional",
"custom": {
"aws": {
"accountId": 123456789012,
"regionName": "us-east-1"
}
}
}
}
}
]
}
],
".turbot": {
"uri": "tmod:@turbot/aws-wafregional#/definitions/wafRegional",
"modUri": "tmod:@turbot/aws-wafregional"
}
}

wafRegionalAka

{
"type": "string",
"pattern": "^arn:aws(-us-gov|-cn)?:waf-regional:[a-z]{2}(-gov)?-[a-z]+-[0-9]{1}:[0-9]{12}$",
"tests": [
{
"description": "base",
"input": "arn:aws:waf-regional:us-east-1:123123123123"
},
{
"description": "invalid service name",
"input": "arn:aws:xyz:us-east-1:123123123123",
"expected": false
},
{
"description": "invalid account id",
"input": "arn:aws:ec2:us-east-1:123382743123123123",
"expected": false
},
{
"description": "invalid region name",
"input": "arn:aws:ec2:us-eastdk-74381:123123123123",
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/aws-wafregional#/definitions/wafRegionalAka",
"modUri": "tmod:@turbot/aws-wafregional"
}
}

wafRegionalSupportedRegions

{
"type": "array",
"items": {
"$ref": "#/definitions/regionName"
},
"minItems": 1,
"example": [
[
"eu-west-1",
"eu-west-2"
]
],
"default": [
"ap-northeast-1",
"ap-southeast-2",
"ca-central-1",
"eu-central-1",
"eu-west-1",
"eu-west-2",
"us-east-1",
"us-east-2",
"us-west-1",
"us-west-2"
],
"tests": [
{
"description": "one region",
"input": [
"us-east-1"
]
},
{
"description": "all supported regions",
"input": [
"ap-northeast-1",
"ap-southeast-2",
"ca-central-1",
"eu-central-1",
"eu-west-1",
"eu-west-2",
"us-east-1",
"us-east-2",
"us-west-1",
"us-west-2"
]
},
{
"description": "invalid - no regions",
"input": [],
"expected": false
}
],
".turbot": {
"uri": "tmod:@turbot/aws-wafregional#/definitions/wafRegionalSupportedRegions",
"modUri": "tmod:@turbot/aws-wafregional"
}
}