exam questions

Exam AWS Certified Security - Specialty SCS-C02 All Questions

View all questions & answers for the AWS Certified Security - Specialty SCS-C02 exam

Exam AWS Certified Security - Specialty SCS-C02 topic 1 question 59 discussion

A security engineer logs in to the AWS Lambda console with administrator permissions. The security engineer is trying to view logs in Amazon CloudWatch for a Lambda function that is named myFunction. When the security engineer chooses the option in the Lambda console to view logs in CloudWatch, an "error loading Log Streams" message appears.
The IAM policy for the Lambda function's execution role contains the following:

How should the security engineer correct the error?

  • A. Move the logs:CreateLogGroup action to the second Allow statement.
  • B. Add the logs:PutDestination action to the second Allow statement.
  • C. Add the logs:GetLogEvents action to the second Allow statement.
  • D. Add the logs:CreateLogStream action to the second Allow statement.
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
100fold
Highly Voted 1 year, 6 months ago
Selected Answer: D
Answer D https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-identity-based-access-control-cwl.html
upvoted 6 times
...
mnsait
Most Recent 1 month ago
Selected Answer: D
I tend to agree with those saying D. Rationale: The engineer gets "error loading Log Streams" message, which is when there is NO stream to load in the first place. Hence D is the answer. Had it been that the stream is available and the engineer could not retrieve the logs, then option C (adding GetLogEvents) could help.
upvoted 1 times
...
Malluchan
1 month ago
Selected Answer: D
To enable Lambda functions to properly log to Cloud-Watch, their execution role needs the permissions to create log groups, Create log streams, (Missing) and put log events, which are typically granted by attaching the AWSLambdaBasicExecutionRole managed policy.
upvoted 1 times
...
sunsetalder
1 month, 3 weeks ago
Selected Answer: D
For Lambda functions to properly log to CloudWatch, they need three key permissions: logs:CreateLogGroup (already present) logs:CreateLogStream (missing) logs:PutLogEvents (already present)
upvoted 1 times
...
icecool36
12 months ago
Not C: It is about the function role policy, not the engineer role policy
upvoted 1 times
...
icecool36
12 months ago
Selected Answer: D
Needs to be able to create a logstream
upvoted 3 times
...
minTwin
1 year ago
Selected Answer: C
While logs:CreateLogStream might be needed by the Lambda function itself to write logs initially, the prompt emphasizes viewing logs, which requires logs:GetLogEvents.
upvoted 1 times
helloworldabc
7 months, 2 weeks ago
just D
upvoted 1 times
...
...
Sodev
1 year ago
D. View Lambda logs on Lambda console, not same mean with: Lambda need to fetch logs from CW. That's only a AWS UI feature, a CW log frame in Lambda UI.
upvoted 1 times
...
Raphaello
1 year, 2 months ago
Selected Answer: D
Action "logs:GetLogEvents" gets log events from log stream (https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetLogEvents.html), but there no log stream on first place! Correct answer is allowing the function to create log stream (through logs:CreateLogStream). D.
upvoted 3 times
...
mynickc
1 year, 3 months ago
Selected Answer: D
putlogevent require logstream. so it is createlogstream. https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/permissions-reference-cwl.html
upvoted 1 times
...
Gafa255
1 year, 3 months ago
Selected Answer: C
C is correct options because Security Engineer wants to see LOG. logs:GetLogEvents https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/iam-identity-based-access-control-cwl.html
upvoted 2 times
Gafa255
1 year, 3 months ago
Sorry the correct options is D because the issue is when the Lambda function want to create the streams.
upvoted 1 times
...
...
marlonchin
1 year, 5 months ago
D I don't think adding logs is not the responsibility of the Lamda function here
upvoted 1 times
...
[Removed]
1 year, 5 months ago
Seems poorly written to me.. The engineer is trying to view the logs. So they'll need "logs:GetLogEvents " permission. However the policy is also missing "logs:CreateLogStream" so they will also need that in order for the Lambda to "create a new log stream". Doubt something this bad will be on the exam
upvoted 1 times
...
YR4591
1 year, 5 months ago
Selected Answer: D
When creating log group, there should be a permission to put log streams in the log group
upvoted 2 times
...
kejam
1 year, 5 months ago
Selected Answer: C
Answer C. The security engineer wants to view logs in CloudWatch. A. logs:CreateLogGroup - Required to create a new log group B. logs:PutDestination - Required to create or update a destination log stream C. Add the logs:GetLogEvents - Required to retrieve log events from a log stream D. Add the logs:CreateLogStream - Required to create a new log stream in a log group https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/permissions-reference-cwl.html
upvoted 1 times
Aamee
1 year, 5 months ago
But w/o creating the LogStream, how can the PutLogStream going to work from option C?.. that looks missing to me though..
upvoted 1 times
...
...
kk2000
1 year, 6 months ago
Correct Answer is D
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago