Chapter 17; Configuring Access and Cloud Security Flashcards

1
Q

What is the Principle of least privilage”?

A

When it comes to security, managing access is a foundational capability—whether you’re talking about a physical space or your cloud infrastructure. If you were securing an office, you wouldn’t give every employee a master key that can open the front door, the mailbox, and the safe. Likewise, when you’re securing your cloud infrastructure, you should limit employees’ access based on their role and what they require to do their job.

https://cloud.google.com/blog/products/identity-security/dont-get-pwned-practicing-the-principle-of-least-privilege

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

What are the 3 primative roles?

A

Primitive roles include:

Viewer - Permissions for read-only actions that do not affect state, such as viewing (but not modifying) existing resources or data.

Editor - All viewer permissions, plus permissions for actions that modify state, such as changing existing resources.

Owner - All editor permissions and permissions for the following actions:

  • Manage roles and permissions for a project and all resources within the project.
  • Set up billing for a project.

These were developed prior to the release of IAM.

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

Predefined roles are part of IAM role based access management services in GCP. The predefined roles provide granular access to services which cater for a wide variety of scenarios. The RBAC system is made up of three major componants:

Roles

Permissions

Users (which can come in the form of groups of users or even service accounts)

I the format of X is assigned to Y, can you order the three areas above to identify which componant is assigned to which to provide secure access to GCP services?

A

Permissions are assigned to Roleswhich are assigned toUsers.

We start with the permissions, or “What am I allowed to do”. Then we specifiy which roles are allowed to do it. Like “the Admin role can view/edit/create files in a bucket”. Finally, we assign the role to our users and groups. “The user SmithJ21 is assigned the Admin role so that it can view/edit/create files in a bucket.”

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

There are three types of roles:

Primitive/Basic

Predefined

Custom

When should each be used?

A

Primitive/Basic roles - Development uses only. Basic roles include thousands of permissions across all Google Cloud services. In production environments, do not grant basic roles unless there is no alternative. Instead, grant the most limited predefined roles or custom roles that meet your needs.

Predefined Roles - Development, or in some cases Production. These roles are likely not going to exactly fit your needs. You will need to combine them to create configurations which fit your needs. It is likely this will cause you to create configurations which have more permissions than you need, but be more fine-grained than Basic Roles.

Custom Roles - Use these roles whenever possible. With “Principle of least privalage” in mind, you can define exactly what permissions are nessassary for each role to perform it’s duties and no more.

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

What are the methods that can be used to view roles that have been assigned to identies in Google Cloud Platform?

A

You can use the Roles tab in the IAM & Admin section of the console to list the identities assigned particular roles.

You can also use the Command Line Interface (CLI) to access the information. The command - gcloud projects get-iam-policy lists roles assigned to users in a project.

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

What CLI command will allow you to view details of a role, including permissions assigned to a role?

A

gcloud iam roles describe

You can also view users granted roles by drilling down into a role in the Roles page of the IAM & Admin section of the console. When working with IAM, you will be using the gcloud command when working from the command line.

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

What are Scopes and to which services do they apply?

A

Scopes are a form of access control applied to Virtual Machine instances. The VM can only perform operations allowed by scopes and IAM roles assigned to the service account of the instance. You can use IAM roles to constrain scopes and use scopes to constrain IAM roles.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q
  1. What does IAM stand for?
  2. Identity and Authorization Management
  3. Identity and Access Management
  4. Identity and Auditing Management
  5. Individual Access Management
A

Answer = B

IAM stands for Identity and Access Management, so option B is correct.

Option A is incorrect; the A does not stand for authorization, although that is related.

Option C is incorrect; the A does not stand for auditing, although that is related.

Option D is incorrect. IAM also works with groups, not just individuals.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
  1. When you navigate to IAM & Admin in Cloud Console, what appears in the main body of the page?
  2. Members and roles assigned
  3. Roles only
  4. Members only
  5. Roles and permissions assigned
A

Answer = A

Members and their roles are listed, so option A is correct.

Options B and C are incorrect because they are missing the other main piece of information provided in the listing.

Option D is incorrect; permissions are not displayed on that page.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q
  1. Why are primitive roles classified in a category in addition to IAM?
  2. They are part of IAM.
  3. They were created before IAM.
  4. They were created after IAM.
  5. They are not related to access control.
A

Answer = B

Primitive roles were created before IAM and provided coarse-grained access controls, so option B is correct.

Option A is incorrect; they are used for access control.

Option C is incorrect; IAM is the newer form of access control.

Option D is incorrect; they do provide access control functionality.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q
  1. A developer intern is confused about what roles are used for. You describe IAM roles as a collection of what?
  2. Identities
  3. Permissions
  4. Access control lists
  5. Audit logs
A

Answer = B

Roles are used to group permissions that can then be assigned to identities, so option B is correct.

Option A is incorrect; roles do not have identities, but identities can be granted roles.

Option C is incorrect; roles do not use access control lists.

Option D is incorrect; roles do not include audit logs. Logs are collected and managed by Stackdriver Logging.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q
  1. You want to list roles assigned to users in a project called ace-exam-project. What gcloud command would you use?
  2. gcloud iam get-iam-policy ace-exam-project
  3. gcloud projects list ace-exam-project
  4. gcloud projects get-iam-policy ace-exam-project
  5. gcloud iam list ace-exam-project
A

Answer = C

The correct answer is gcloud projects get-iam-policy ace-exam-project, so option C is correct.

Option A is incorrect because the resource should be projects and not iam.

Option B is incorrect; list does not provide detailed descriptions.

Option D is incorrect because iam and list are incorrectly referenced.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
  1. You are working in the form displayed after clicking the Add link in the IAM form of IAM & Admin in Cloud Console. There is a parameter called New Members. What items would you enter in that parameter?
  2. Individual users only
  3. Individual users or groups
  4. Roles or individual users
  5. Roles or groups
A

Answer = B

New members can be users, indicated by their email addresses, or groups, so option B is correct.

Option A is incorrect; it does not include groups.

Options C and D are incorrect because roles are not added there.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q
  1. You have been assigned the App Engine Deployer role. What operations can you perform?
  2. Write new versions of an application only
  3. Read application configuration and settings only
  4. Read application configuration and settings and write new configurations
  5. Read application configuration and settings and write new versions
A

Answer = D

Deployers can read application configurations and settings and write new application versions, so option D is correct.

Option A is incorrect because it is missing the ability to read configurations and settings.

Option B is incorrect because it is missing writing new versions.

Option C is incorrect because it references writing new configurations. (Deployer cannot create a new configuration, but can create a new version from a configuration someone else has created)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q
  1. You want to list permissions in a role using Cloud Console. Where would you go to see that?
  2. IAM & Admin; select Roles. All permissions will be displayed.
  3. IAM & Admin; select Roles. Check the box next to a role to display the permissions in that role.
  4. IAM & Admin; select Audit Logs.
  5. IAM & Admin; select Service Accounts and then Roles.
A

Answer = B

The correct steps are navigating to IAM & Admin, selecting Roles, and then checking the box next to a role, so option B is correct.

Option A is incorrect; all roles are not displayed automatically.

Option C is incorrect; audit logs do not display permissions.

Option D is incorrect; there is no Roles option in Service Accounts.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q
  1. You are meeting with an autidor to discuss security practices in the cloud. The auditor asks how you implement several best practices. You describe how IAM predefined roles help to implement which security best practice(s)?
  2. Least privilege
  3. Separation of duties
  4. Defense in depth
  5. Options A and B
A

Answer = D

Predefined roles help implement both least privilege and separation of duties, so option D is correct. Predefined roles do not implement defense in depth by themselves but could be used with other security controls to implement defense in depth.

17
Q
  1. What launch stages are available when creating custom roles?
  2. Alpha and beta only
  3. General availability only
  4. Disabled only
  5. Alpha, beta, general availability, and disabled
A
18
Q
  1. The gcloud command to create a custom role is what?
  2. gcloud project roles create
  3. gcloud iam roles create
  4. gcloud project create roles
  5. gcloud iam create roles
A

Answer = B

The correct answer, option B, is gcloud iam roles create. (Commands start with the service you wish to make changes to, then end with a verb (or action) you want to perform)

Option A is incorrect because it references project instead of iam.

Option C is incorrect because it references project instead of iam, and the terms create and roles are out of order.

Option D is incorrect because the terms create and roles are out of order.

https://cloud.google.com/sdk/docs/cheatsheet#understanding_commands

19
Q
  1. A DevOps engineer is confused about the purpose of scopes. Scopes are access controls that are applied to what kind of resources?
  2. Storage buckets
  3. VM instances
  4. Persistent disks
  5. Subnets
A

Answer = B

Scopes are permissions granted to VM instances, so option B is correct. Scopes in combination with IAM roles assigned to service accounts assigned to the VM instance determine what operations the VM instance can perform.

Options A and C are incorrect; scopes do not apply to storage resources.

Option D is incorrect; scopes do not apply to subnets.

20
Q
  1. A scope is identified using what kind of identifier?
  2. A randomly generated ID
  3. A URL beginning with https://www.googleserviceaccounts/
  4. A URL beginning with https://www.googleapis.com/auth/
  5. A URL beginning with https://www.googleapis.com/auth/PROJECT_ID]
A

Answer = C

Scope identifiers start with https://www.googleapis.com/auth/ and are followed by a scope-specific name, such as devstorage.read_only or logging.write, so option C is correct.

Option A is incorrect; scope IDs are not randomly generated.

Option B is incorrect; the domain name is not googleserviceaccounts.

Option D is incorrect; scopes are not linked directly to projects.

21
Q
  1. A VM instance is trying to read from a Cloud Storage bucket. Reading the bucket is allowed by IAM roles granted to the service account of the VM. Reading buckets is denied by the scopes assigned to the VM. What will happen if the VM tries to read from the bucket?
  2. The application performing the read will skip over the read operation.
  3. The read will execute because the most permissive permission is allowed.
  4. The read will not execute because both scopes and IAM roles are applied to determine what operations can be performed.
  5. The read operation will succeed, but a message will be logged to Stackdriver Logging.
A

Answer = C

Both scopes and IAM roles assigned to service accounts must allow an operation for it to succeed, so option C is correct.

Option A is incorrect; access controls do not affect the flow of control in applications unless explicitly coded for that.

Option B is incorrect; the most permissive permission is not used.

Option D is incorrect; the operation will not succeed.

22
Q
  1. What are the options for setting scopes in a VM?
  2. Allow Default Access and Allow Full Access only
  3. Allow Default Access, Allow Full Access, and Set Access for Each API
  4. Allow Full Access or Set Access For Each API only
  5. Allow Default Access and Set Access For Each API only
A

Answer = B

The options for setting scopes are: Allow Default Access, Allow Full Access, and Set Access For Each API, so option B is correct.

Option A is incorrect; it is missing Set Access For Each API.

Option C is incorrect; it is missing Allow Default Access.

Option D is incorrect; it is missing Allow Full Access.

23
Q
  1. What gcloud command would you use to set scopes?

A. gcloud compute instances set-scopes

B. gcloud compute instances set-service-account

C. gcloud compute service-accounts set-scopes

D. gcloud compute service-accounts define-scopes

A
24
Q
  1. What gcloud command would you use to assign a service account when creating a VM?
  2. gcloud compute instances create [INSTANCE_NAME] –service-account [SERVICE_ACCOUNT_EMAIL]
  3. gcloud compute instances create-service-account [INSTANCE_NAME][SERVICE_ACCOUNT_EMAIL]
  4. gcloud compute instances define-service-account [INSTANCE_NAME][SERVICE_ACCOUNT_EMAIL]
  5. gcloud compute create instances-service-account [INSTANCE_NAME][SERVICE_ACCOUNT_EMAIL]
A

Answer = A

You can assign a service account when creating a VM using the create command.

Option B is incorrect; there is no create-service-account command verb.

Option C is incorrect; there is no define-service-account command verb.

Option D is incorrect; there is no instances-service-account command; also, create should come at the end of the command.

25
Q
  1. An auditor needs to review audit logs. You assign read-only permission to a custom role you create for auditors. What security best practice are you following?
  2. Defense in depth
  3. Least privilege
  4. Separation of duties
  5. Vulnerability scanning
A

Answer = B

This is an example of assigning the least privilege required to perform a task, so option B is correct.

Option A is incorrect; defense in depth combines multiple security controls.

Option C is incorrect because it is having different people perform sensitive tasks.

Option D is incorrect; vulnerability scanning is a security measure applied to applications that helps reveal potential vulnerabilities in an application that an attacker could exploit.

26
Q
  1. What options are available for filtering log messages when viewing audit logs?
  2. Period time and log level only
  3. Resource, type of log, log level, and period of time only
  4. Resource and period of time only
  5. Type of log only
A

Answer = B

Logs can be filtered by resource, type of logs, log level, and period of time only, so option B is correct.

Options A, C, and D are incorrect because they are missing at least one option.

27
Q
  1. What GCP service is used to view audit logs?
  2. Compute Engine
  3. Cloud Storage
  4. Stackdriver Logging
  5. Custom logging
A

Answer = C

Stackdriver Logging collects, stores, and displays log messages, so option C is correct.

Option A is incorrect; Compute Engine does not manage logs.

Option B is incorrect; Cloud Storage is not used to view logs, although log files can be stored there.

Option D is incorrect; custom logging solutions are not GCP services.