diff --git a/AWS-WAF-CFT b/AWS-WAF-CFT new file mode 100644 index 0000000..8a8a629 --- /dev/null +++ b/AWS-WAF-CFT @@ -0,0 +1,242 @@ +{ + "AWSTemplateFormatVersion": "2010-09-09", + "Description": "Creates an AWS WAF configuration that protects against common attacks", + "Metadata": { + "AWS::CloudFormation::Interface": { + "ParameterGroups": [ + { + "Label": { + "default": "Web ACL Name for Common Attack Protection" + }, + "Parameters": [ + "WebACLName" + ] + } + ], + "ParameterLabels": { + "WebACLName": { + "default": "Name" + } + } + } + }, + "Parameters": { + "WebACLName": { + "Type": "String", + "Default": "CommonAttackProtection", + "Description": "Enter the name you want to use for the WebACL. This value is also added as a prefix for the names of the rules, conditions, and CloudWatch metrics created by this template." + } + }, + "Resources": { + "MyWebACL": { + "Properties": { + "Name": { "Ref" : "WebACLName" }, + "DefaultAction": { + "Type": "ALLOW" + }, + "MetricName": { "Ref" : "WebACLName" }, + "Rules": [ + { + "Action": { + "Type": "BLOCK" + }, + "Priority": 1, + "RuleId": { + "Ref": "ManualIPBlockRule" + } + }, + { + "Action": { + "Type": "COUNT" + }, + "Priority": 2, + "RuleId": { + "Ref": "SizeMatchRule" + } + }, + { + "Action": { + "Type": "BLOCK" + }, + "Priority": 3, + "RuleId": { + "Ref": "SqliRule" + } + }, + { + "Action": { + "Type": "BLOCK" + }, + "Priority": 4, + "RuleId": { + "Ref": "XssRule" + } + } + ] + }, + "Type": "AWS::WAF::WebACL" + }, + "SqliRule": { + "Properties": { + "Name": { "Fn::Join" : [ "", [{ "Ref" : "WebACLName" }, "SqliRule"]] }, + "MetricName": { "Fn::Join" : [ "", [{"Ref" : "WebACLName"}, "SqliRule"]] }, + "Predicates": [ + { + "DataId": { + "Ref": "SqliMatchSet" + }, + "Negated": false, + "Type": "SqlInjectionMatch" + } + ] + }, + "Type": "AWS::WAF::Rule" + }, + "XssRule": { + "Properties": { + "Name": { "Fn::Join" : [ "", [{"Ref" : "WebACLName"}, "XssRule"]] }, + "MetricName": { "Fn::Join" : [ "", [{"Ref" : "WebACLName"}, "XssRule"]]}, + "Predicates": [ + { + "DataId": { + "Ref": "XssMatchSet" + }, + "Negated": false, + "Type": "XssMatch" + } + ] + }, + "Type": "AWS::WAF::Rule" + }, + "SizeMatchRule": { + "Properties": { + "Name": { "Fn::Join" : [ "", [{"Ref" : "WebACLName"}, "LargeBodyMatchRule"]] }, + "MetricName": { "Fn::Join" : [ "", [{"Ref" : "WebACLName"}, "DetectLargeBody"]]}, + "Predicates": [ + { + "DataId": { + "Ref": "SizeMatchSet" + }, + "Negated": false, + "Type": "SizeConstraint" + } + ] + }, + "Type": "AWS::WAF::Rule" + }, + "ManualIPBlockRule": { + "Properties": { + "Name": { "Fn::Join" : [ "", [{"Ref" : "WebACLName"}, "ManualIPBlockRule"]] }, + "MetricName": { "Fn::Join" : [ "", [{"Ref" : "WebACLName"}, "ManualIPBlockRule"]]}, + "Predicates": [ + { + "DataId": { + "Ref": "WAFManualIPBlockSet" + }, + "Negated": false, + "Type": "IPMatch" + } + ] + }, + "Type": "AWS::WAF::Rule" + }, + "WAFManualIPBlockSet": { + "Properties": { + "Name": "Manual IP Block Set" + }, + "Type": "AWS::WAF::IPSet" + }, + "SizeMatchSet": { + "Properties": { + "Name": {"Fn::Join" : [ "", [{"Ref" : "WebACLName"}, "LargeBodyMatch"]]}, + "SizeConstraints": [ + { + "FieldToMatch": { + "Type": "BODY" + }, + "ComparisonOperator": "GT", + "Size": "8192", + "TextTransformation": "NONE" + } + ] + }, + "Type": "AWS::WAF::SizeConstraintSet" + }, + "SqliMatchSet": { + "Properties": { + "Name": {"Fn::Join" : [ "", [{"Ref" : "WebACLName"}, "SqliMatch"]]}, + "SqlInjectionMatchTuples": [ + { + "FieldToMatch": { + "Type": "QUERY_STRING" + }, + "TextTransformation": "URL_DECODE" + }, + { + "FieldToMatch": { + "Type": "QUERY_STRING" + }, + "TextTransformation": "HTML_ENTITY_DECODE" + }, + { + "FieldToMatch": { + "Type": "BODY" + }, + "TextTransformation": "URL_DECODE" + }, + { + "FieldToMatch": { + "Type": "BODY" + }, + "TextTransformation": "HTML_ENTITY_DECODE" + }, + { + "FieldToMatch": { + "Type": "URI" + }, + "TextTransformation": "URL_DECODE" + } + ] + }, + "Type": "AWS::WAF::SqlInjectionMatchSet" + }, + "XssMatchSet": { + "Properties": { + "Name": {"Fn::Join" : [ "", [{"Ref" : "WebACLName"}, "XssMatch"]]}, + "XssMatchTuples": [ + { + "FieldToMatch": { + "Type": "QUERY_STRING" + }, + "TextTransformation": "URL_DECODE" + }, + { + "FieldToMatch": { + "Type": "QUERY_STRING" + }, + "TextTransformation": "HTML_ENTITY_DECODE" + }, + { + "FieldToMatch": { + "Type": "BODY" + }, + "TextTransformation": "URL_DECODE" + }, + { + "FieldToMatch": { + "Type": "BODY" + }, + "TextTransformation": "HTML_ENTITY_DECODE" + }, + { + "FieldToMatch": { + "Type": "URI" + }, + "TextTransformation": "URL_DECODE" + } + ] + }, + "Type": "AWS::WAF::XssMatchSet" + } + } +} diff --git a/demo1 - Copy (2).txt b/demo1 - Copy (2).txt deleted file mode 100644 index 9846202..0000000 --- a/demo1 - Copy (2).txt +++ /dev/null @@ -1 +0,0 @@ -This is the right time to learn Git and GitHub \ No newline at end of file diff --git a/demo1 - Copy (3).txt b/demo1 - Copy (3).txt deleted file mode 100644 index 9846202..0000000 --- a/demo1 - Copy (3).txt +++ /dev/null @@ -1 +0,0 @@ -This is the right time to learn Git and GitHub \ No newline at end of file diff --git a/demo1 - Copy.txt b/demo1 - Copy.txt deleted file mode 100644 index 51b3dea..0000000 --- a/demo1 - Copy.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is the right time to learn Git and GitHub -This time lets do this ......... \ No newline at end of file diff --git a/demo1.txt b/demo1.txt deleted file mode 100644 index b8a2bfa..0000000 --- a/demo1.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is the right time to learn Git and GitHub -This time lets do this \ No newline at end of file diff --git a/jenkinspipeline.txt b/jenkinspipeline.txt new file mode 100644 index 0000000..34d92c0 --- /dev/null +++ b/jenkinspipeline.txt @@ -0,0 +1,34 @@ +pipeline{ + + agent any + + stages{ + + stage('Checkout'){ + steps{ + + git "https://github.com/devops-trainer/DevOpsClassCodes.git" + } + } + stage('Compile'){ + steps{ + + sh 'mvn compile' + + } + } + stage('Test'){ + steps{ + sh 'mvn test' + } + } + stage('Package'){ + steps{ + sh 'mvn package' + } + } + } + + } + + diff --git a/sam.txt b/sam.txt deleted file mode 100644 index ba44ad0..0000000 --- a/sam.txt +++ /dev/null @@ -1,3 +0,0 @@ -Baby Sam was born on January 05 2019. -He is almost 9 months today. He is growing very well and steady. -He eats a lot and wants real food; not baby foo. Lol diff --git a/sone1.txt b/sone1.txt deleted file mode 100644 index 286cadd..0000000 --- a/sone1.txt +++ /dev/null @@ -1 +0,0 @@ -i want to practice git rebasing diff --git a/sone2.txt b/sone2.txt deleted file mode 100644 index c27c0e5..0000000 --- a/sone2.txt +++ /dev/null @@ -1 +0,0 @@ -I really want to get a very high paying job after this courses