Section 20: AWS Monitoring & Audit, CloudWatch, X-Ray and CloudTrail: OpenTelemetry, CloudTrail and Quiz Flashcards

1
Q

What is OpenTelemetry?

A

With OpenTelemetry, you can collect telemetry data from different sources and send it to multiple platforms without significant configuration changes.

https://www.datadoghq.com/knowledge-center/opentelemetry/#:~:text=With%20OpenTelemetry%2C%20you%20can%20collect,that%20work%20best%20for%20them.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does AWS Distro for OpenTelemetry provide? (one of these answers is very general, the other is specific)

A
  • Secure, production ready AWS-supported distribution of the open-source project OpenTelemetry project.
  • a single set of apis, libraries, agents and collector services.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What does aws distro for OpenTelemetry collect?

A
  • It collects distributed traces and metrics from your apps
  • it collects metadata from your aws resources and services
  • traces without changing your code (via auto instrumention agents)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

who can aws distro for OpenTelemetry send traces and metrics to?

A

multiple aws services and partner solutions including xray, cloudwatch, and prometheus

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

aws distro for OpenTelemetry can be used to instrument apps running on which aws services? Can it be used to instrument apps running on-premesis?

A
  1. ec2, ecs, eks, fargate, lambda. Maybe more, but at least those.
  2. yes, it can be used to instrument apps running on-premesis.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

When might you want to migrate from aws xray to aws distro for Telemetry (I assume he means OpenTelemetry)

A

when you want to standardize with open-source APIs from Telemetry (again, I assume he means OpenTelemetry but I should check) or send traces to multiple destinations simultaneously.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q
  1. What does aws distro for OpenTelemetry collect?
  2. To what services/solutions can aws distro for OpenTelemetry send data?
A
  1. everything the flowchart says it collects to
  2. all the places the flowcharts says you can send data to.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What does AWS CloudTrail provide? (super general)

A

CloudTrail provides governance, compliance and audit (i assume he means audit prep) for your aws account.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Is aws CloudTrail enabled by default for your aws account?

A

yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
  1. What does aws CloudTrail get you (more specific)
A

A history of events/api calls made within your aws account by console, sdk, cli, and aws services

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Where does it seem like people store logs CloudTrail (think other aws services)?

A

CloudWatch Logs or S3

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

about CloudTrail: Can you setup a trail so it’s applied to either all regions or a single region? Which is the default?

A

Yes, you can have a trail apply to all regions or a single region. The default is all regions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

If a resource in deleted in AWS, what should you check first to see what happened?

A

CloudTrail!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What’s the cloudtrail diagram? (like, from where can you setup/access/probably configure, at least to some degree cloudtrail behavior, and to where can logs be sent?)

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Do you need to consider/configure IAM permissions when you want to adjust a CloudTrail configuration?

A

yes. add some more details about that or read more about it or something.
https://docs.aws.amazon.com/awscloudtrail/latest/userguide/security_iam_service-with-iam.html
https://docs.aws.amazon.com/awscloudtrail/latest/userguide/security_iam_id-based-policy-examples.html

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the three different types of CloudTrail events? (just names)

A

Management events, data events, cloudtrail insights events

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q
  1. What are CloudTrail Management events?
  2. What are some examples?
A
  1. When an operation is performed on resourced in your aws account, that’s considered a management event.
    • Configuring security (IAM AttachRolePolicy)
    • Configuring rules for routing data (EC2 CreateSubnet)
    • setting up logging (aws CloudTrail CreateTrail)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Are CloudTrail trails configured to log management events by default?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

Regarding CloudTrail Management Events events, can you separate read events (events that don’t modify resources) from write events (events that may modify resources)

A

yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

1What are CloudTrail Data events? (This is probably going to be easiest by just giving a general example.)

A
  1. GetObject, PutObject, DeleteObject api requests, things like that
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

by default, are data events logged in CloudTrail?

A

No. By default, trails and event data stores do not log data events, because of the high volume of operations (like all the api requests that might get used to update a table that’s frequently used). Additional charges apply for data events.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

About CloudTrail Data Events: Does logging data events with CloudTrail cost money?

A

Yes, i think so. I did skim that pretty lightly though, you might want to double check.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q
  1. Can CloudTrail Data Events be used to log object-level activity? What are some example apis
  2. Can you separate the logging of Read events and Write events?
A
  1. Yes. GetObject, DeleteOBject, PutObject.
  2. yes
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

Can CloudTrail Data Events be used to log aws lambda function execution activity? Through what api?

A

yes. the Invoke API.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

you want to detect unusual activity in your account. How might you do this using CloudTrail?

A

Enable CloudTrail Insights.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
26
Q

What kind of unusual activity can CloudTrail Insights be enabled to detect?

A
  • inaccurate resource provisioning
  • hitting service limits
  • bursts of aws iam actions
  • gaps in periodic maintenance activity
27
Q

Does CloudTrail Insights create a baseline by which to detect unusual activity by analyzing normal management events? Thereafter, does CloudTrail continuously analyze write events to detect unusual patterns? (That is, does it seem to work by identifying a pattern and then detecting pattern anomolies?)

A

Yes

28
Q

Regarding CloudTrail Insights, where do anomolies appear (by which I think they mean “where do you go to see whether any anomolies have been detected”). hint: this is like, whether you can use the cli or an sdk or the console to view results.

A

CloudTrail console.

29
Q

When CloudTrail Insights detects an unusual pattern it displays the anomoly in the CloudTrail console. Where else does CloudTrail Insights send / generate events?

A
  • an event is sent to S3
  • An EventBridge event is generated (for automation needs)
30
Q
  1. I already asked most of these other questions, so how about you just tell me what the important parts of the following flowchart are. You can ask more questions about this later if you want.
A

answer the question

31
Q

I kind of alluded to this in other questions, but what kind of events does CloudTrail insights analyze? (not the read/write kind, that’s in another question. I mean like Management Events vs Data Events.)

A

Management Events.

32
Q

Regarding CloudTrail events retention, how long are events stored for in CloudTrail?

A

90 days, though you can keep them for longer using S3 (this is strange thing to say cuz I thought they were automatically going to S3, but maybe what goes to s3 automatically isn’t the log itself, just a notification about the existance of the new cloudTrail event?) and Athena. Not sure how much longer.

33
Q

How could you keep CloudTrail events for longer than 90 events

A

log them to S3 and use athena. look more into this because, as mentioned in a previous card, there’s something consuing about this. ( (this is strange thing to say cuz I thought they were automatically going to S3, but maybe what goes to s3 automatically isn’t the log itself, just a notification about the existance of the new cloudTrail event?) )

34
Q

What’s the flow for longer term CloudTrail event storage (longer than the default)

A
35
Q

Say you want to get an email any time a user makes a DeleteTable api call on your dynamoDB table. What’s the flow?

A

If you’re really strugging, add a hint in the question footnote.

36
Q

Say you want to get an email every time someone makes a new IAM role (or perhaps just an adjustment to an existing one). What’s the flow? (perhaps using AssumeRole? Look into that.)

A
37
Q

Say you want to get an email every time someone makes a new ec2 security group (or perhaps just an adjustment to an existing one). What’s the flow? (perhaps using AuthorizeSecurityGroupIngress? look into that)

A
38
Q

CloudTrail vs CloudWatch vs Xray:
What is CloudTrail used for?

A
  • audit api calls made by users/services/aws console
  • useful to detect unauthorized calls or root cause of changes
39
Q

CloudTrail vs CloudWatch vs Xray, what is CloudWatch used for?

A
  • CLoudWatch Metrics over time for monitiring
  • CloudWatch Logs for storing app log
  • CloudWatch Alarms to send notifications in case of unexpected metrics
40
Q

CloudTrail vs CloudWatch vs Xray, what is XRay used for?

A
  • Automated trace analysis and central service map visualization
  • latency, errors and fault analysis
  • request tracking across distributed systems
41
Q
A

D is correct. success alert
Good job!
This is a paid offering and is disabled by default. When enabled, the EC2 instance’s metrics are available in 1-minute periods.

  • A is incorrect because: CloudWatch Custom Metrics are not needed for getting the Standard CloudWatch Metrics offered for EC2 instances.
  • B is incorrect because: High Resolution is only relevant for Custom Metrics. When you publish a Custom Metric, you can define it as either standard resolution or high resolution. You can read and retrieve High-Resolution Custom Metrics at 1 second, 5 seconds, 10 seconds, 30 seconds, or any multiple of 60 seconds.
  • C is incorrect because: Basic Monitoring is enabled by default and EC2 instance’s Metrics are available automatically in 5-minute periods.
42
Q
A

B. 1 second

No notes.

43
Q
A

A is the correct answer. Create a CloudWatch Logs Metric Filter that filters the logs for keyword “Error”, then create a CloudWatch Alarm based on that Metric Filter.

44
Q
A

C. The CloudWatch Alarm will remain in ALARM state but never decrease the number of EC2 instances in the ASG.

Note: The number of EC2 instances in an ASG can not go below the minimum capacity, even in the CloudWatch alarm would in theory trigger an EC2 instance termination. No other answers had notes.

45
Q
A

C. Use Unified CloudWatch Agent to push memory usage as a custom metric to CloudWatch

No note for that one. didn’t check the other one.

46
Q
A

B. 10 seconds.
Note: If you set an alarm on a high-resolution metric, you can specify a high-resolution alarm with a period of 10 seconds or 30 seconds, or you can set a regular alarm with a period of any multiple of 60 seconds.

47
Q
A

A. CloudWatch
Note: Amazon CloudWatch is a monitoring service that allows you to monitor your applications, respond to system-wide performance changes, optimize resource utilization, and get a unified view of operational health. It is used to monitor your applications’ performance and metrics.

Incorrect Note: AWS CloudTrail allows yuo to log, continously monitor, and retain account activity related to actions across your aws infastructure. it proveds the event history of your aws account activity, audit api calls made through the AWS Management Console, aws sdks, aws cli. you can use CloudTrail to detect unusual activity in your aws accounts.

48
Q
A

D. CloudTrail
Notes: AWS CloudTrail allows you to log, continuously monitor, and retain account activity related to actions across your AWS infrastructure. It provides the event history of your AWS account activity, audit API calls made through the AWS Management Console, AWS SDKs, AWS CLI. So, the EC2 instance termination API call will appear here. You can use CloudTrail to detect unusual activity in your AWS accounts.

A. CloudWatch Metrics are data about the performance of your systems, it won’t indicate “who” did what.
B. CloudWatch Alarms allow you to trigger notiiactions/actions based on any CloudWatch Metrics or other CloudWatch Alarms, it won’t indicate “who” did what.
C. CloudWatch Events delivers a stream of system events that describe chagnes in your aws resources, it won’t idicate “who” did what.

49
Q
A

B. CloudTrail Insights. No notes.

no notes

50
Q
A

B. Analyze CloudTrail logs in S3 bucket using Amazon Athena.
Note: success alert
Good job!
You can use the CloudTrail Console to view the last 90 days of recorded API activity. For events older than 90 days, use Athena to analyze CloudTrail logs stored in the S3 bucket.

no notes.

51
Q
A

B. CloudTrail
no notes.

52
Q
A

C. use the set-alarm-state cli command

no notes for correct or incorrect answers.

53
Q
A

C. PutMetricData

no notes for any answers

54
Q
A

A. False.
Note: By default, they never expire!

55
Q
A

B. Log Groups.
No notes.

56
Q
A

A. A config file .ebextensions/xray-daemon.config is missing in your code.
no notes.

no other notes.

57
Q
A

B. The X-Ray daemon is not running on the EC2 instance.

no notes for any answers.

58
Q
A

A. The IAM role attached to your EC2 instance doesn’t have the required permissions to send data to X-Ray

no answers have notes

59
Q
A

C. Check CloudTrail for a Delte event in Elastic Beanstalk.

No notes for any answers.

60
Q
A

B. Create the IAM role in the central account, then create IAM roles in the other accounts to assume this IAM role.

Note is: This is a best practice.

Note for A. This is not secure and is not recommended.

61
Q
A

C. Annotations.

No answers have notes.

62
Q
A

B. AWS X-Ray.

No answers have notes.

63
Q
A

A. BatchGetTraces

No answers have notes.

64
Q
A

D. Each second, 5%

No answers have notes.