diff --git a/README.md b/README.md index 82c07f0..06b1490 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ :information_source:  This repo contains questions and exercises on various technical topics, sometimes related to DevOps and SRE -:bar_chart:  There are currently **2112** exercises and questions +:bar_chart:  There are currently **2138** exercises and questions :books:  To learn more about DevOps and SRE, check the resources in [devops-resources](https://github.com/bregman-arie/devops-resources) repository @@ -1884,9 +1884,11 @@ Using the `last` command. #### Linux Hardware
-Where can you find information on the processor?
+Where can you find information on the processor (like number of CPUs)?
/proc/cpuinfo + +You can also use `nproc` for number of processors
diff --git a/exercises/aws/README.md b/exercises/aws/README.md index 1863517..c133084 100644 --- a/exercises/aws/README.md +++ b/exercises/aws/README.md @@ -39,6 +39,12 @@ Note: Provided solutions are using the AWS console. It's recommended you'll use | Multiple Target Groups | ELB, ALB | [Exercise](alb_multiple_target_groups.md) | [Solution](solutions/alb_multiple_target_groups.md) | Easy | | Network Load Balancer | ELB, NLB | [Exercise](network_load_balancer.md) | [Solution](solutions/network_load_balancer.md) | Easy | +#### AWS - Auto Scaling Groups + +|Name|Topic|Objective & Instructions|Solution|Comments| +|--------|--------|------|----|----| +| Auto Scaling Groups Basics | ASG | [Exercise](auto_scaling_groups_basics.md) | [Solution](solutions/auto_scaling_groups_basics.md) | Easy | + #### AWS - Lambda |Name|Topic|Objective & Instructions|Solution|Comments| @@ -1254,7 +1260,41 @@ False. It charges fir inter AZ data in network load balancer, but not in applica True
-#### AWS Security +
+Explain Deregistration Delay (or Connection Draining) in regards to ELB
+ +The period of time or process of "draining" instances from requests/traffic (basically let it complete all active connections but don't start new ones) so it can be de-registered eventually and ELB won't send requests/traffic to it anymore. +
+ +#### AWS - Auto Scaling Group + +
+Explain Auto Scaling Group
+ +[Amazon Docs](https://docs.aws.amazon.com/autoscaling/ec2/userguide/AutoScalingGroup.html): "An Auto Scaling group contains a collection of Amazon EC2 instances that are treated as a logical grouping for the purposes of automatic scaling and management. An Auto Scaling group also enables you to use Amazon EC2 Auto Scaling features such as health check replacements and scaling policies" +
+ +
+You have two instance running as part of ASG. You change the desired capacity to 1. What will be the outcome of this change?
+ +One of the instances will be terminated. +
+ +
+How can you customize the trigger for the scaling in/out of an auto scaling group?
+ +One way is to use CloudWatch alarms where an alarm will monitor a metric and based on a certain value (or range) you can choose to scale-in or scale-out the ASG. +
+ +
+Provide examples to metrics/rules used for auto scaling
+ +* Network In/Out +* Number of requests on ELB per instance +* Average CPU, RAM usage +
+ +#### AWS - Security
What is the shared responsibility model? What AWS is responsible for and what the user is responsible for based on the shared responsibility model?
diff --git a/exercises/aws/auto_scaling_groups_basics.md b/exercises/aws/auto_scaling_groups_basics.md new file mode 100644 index 0000000..a3bd9d0 --- /dev/null +++ b/exercises/aws/auto_scaling_groups_basics.md @@ -0,0 +1,21 @@ +## AWS Auto Scaling Groups - Basics + +### Requirements + +Zero EC2 instances running + +### Objectives + +A. Create a scaling group for web servers with the following properties: + * Amazon Linux 2 AMI + * t2.micro as the instance type + * user data: +``` +yum install -y httpd +systemctl start httpd +systemctl enable httpd +``` + +B. Were new instances created since you created the auto scaling group? How many? Why? +C. Change desired capacity to 2. Did it launch more instances? +D. Change back the desired capacity to 1. What is the result of this action? diff --git a/exercises/aws/solutions/auto_scaling_groups_basics.md b/exercises/aws/solutions/auto_scaling_groups_basics.md new file mode 100644 index 0000000..765cff2 --- /dev/null +++ b/exercises/aws/solutions/auto_scaling_groups_basics.md @@ -0,0 +1,48 @@ +## AWS Auto Scaling Groups - Basics + +### Requirements + +Zero EC2 instances running + +### Objectives + +A. Create a scaling group for web servers with the following properties: + * Amazon Linux 2 AMI + * t2.micro as the instance type + * user data: +``` +yum install -y httpd +systemctl start httpd +systemctl enable httpd +``` + +B. Were new instances created since you created the auto scaling group? How many? Why? +C. Change desired capacity to 2. Did it launch more instances? +D. Change back the desired capacity to 1. What is the result of this action? + +### Solution + +#### Console + +A. +1. Go to EC2 service +2. Click on "Auto Scaling Groups" under "Auto Scaling" +3. Click on "Create Auto Scaling Group" +4. Insert a name +5. Click on "Create a launch template" + 1. Insert a name and a version for the template + 2. Select an AMI to use (Amazon Linux 2) + 3. Select t2.micro instance type + 4. Select a key pair + 5. Attach a security group + 6. Under "Advanced" insert the user data + 7. Click on "Create" +6. Choose the launch template you've just created and click on "Next" +7. Choose "Adhere to launch template" +8. Choose in which AZs to launch and click on "Next" +9. Link it to ALB (if you don't have one, create it) +10. Mark ELB health check in addition to EC2. Click on "Next" until you reach the review page and click on "Create auto scaling group" + +B. One instance was launched to met the criteria of the auto scaling group we've created. The reason it launched only one is due to "Desired capacity" set to 1. +C. Change it by going to your auto scaling group -> Details -> Edit -> "2 desired capacity". This should create another instance if only one is running +D. Reducing desired capacity back to 1 will terminate one of the instances (assuming 2 are running). diff --git a/exercises/security/README.md b/exercises/security/README.md index d401b72..813a4bb 100644 --- a/exercises/security/README.md +++ b/exercises/security/README.md @@ -408,6 +408,12 @@ SNI allows a single server to serve multiple certificates using the same IP and Practically this means that a single IP can server multiple web services/pages, each using a different certificate.
+
+Explain "Web Cache Deception Attach"
+ +[This blog post](https://omergil.blogspot.com/2017/02/web-cache-deception-attack.html) explains it in detail. +
+ #### Security - Threats