devHọc Dev

Week 1 - Day 5: Week 1 Review Quiz

Week 1 – Day 5

30 questions0s
See the answer and explanation right after each question
1
ACME Cloud ships devcli via npm. An engineer proposes embedding a client_secret in the binary so that "the CLI is authenticated like a BFF". Which statement is most correct?
2
A team wants the CLI to ask for username/password in the terminal and send them straight to the IdP to "avoid opening a browser". According to RFC 9700, which conclusion is correct?
3
A developer runs gcloud auth login --no-browser on a server without a browser. Which description of this mechanism is correct according to the gcloud documentation?
4
The device authorization response comes back as follows, with no interval field: {"device_code":"...","user_code":"WDJB-MJHT","verification_uri":"https://example.com/device","expires_in":600} How long must the CLI wait between polls?
5
The CLI is polling every 5 seconds and receives {"error":"slow_down"}. What is the correct behavior?
6
The token endpoint returns {"error":"invalid_client"} while the CLI is polling. What should the CLI do?
7
Why does RFC 8628 allow a short user_code (about 34.5 bits) while requiring the device_code to have very high entropy?
8
A user types wdjb mjht into the DevCLI verification page. The server stores the code as WDJB-MJHT for display. What is the correct handling?
9
According to RFC 8628, why does supporting verification_uri_complete require the verification page to be more careful?
10
DevCLI uses the loopback flow and wants to pick a redirect URI according to RFC 8252. Which choice is correct?
11
A malicious application on the same laptop intercepts the authorization code sent to the loopback. Which mechanism prevents it from exchanging the code for tokens?
12
A developer SSHes from a laptop into a server and runs devcli login. The loopback flow fails to open a browser. What is the most reasonable approach?
13
A developer runs devcli logout, and the CLI deletes the auth file. A few minutes later, commands still work with the old permissions. What is the most likely cause?
14
A victim receives an email "Teams meeting invite, enter code ABCD-EFGH on the Microsoft sign-in page", opens the real page, passes MFA, and enters the code. The attacker receives a token. Why didn't MFA help?
15
An organization uses Microsoft Entra ID and has no need for device code flow. According to Microsoft's recommendation, what should it do?
16
ACME's device flow server has just marked a session as approved. Because of a flaky network, devcli sends two POST /token requests almost simultaneously with the same device_code. Which design guarantees that only one set of tokens is issued?
17
The user forgets the confirmation step; after 15 minutes the devcli polling loop receives {"error":"expired_token"}. According to RFC 8628, how should the client handle it?
18
While polling, a request to /token hits a connection timeout. According to RFC 8628, how should the client handle it?
19
devcli uses a polling loop written for Okta and is now moving to Microsoft Entra ID. The user clicks deny on the Microsoft sign-in page. What difference needs handling?
20
A team uses an Amazon Cognito user pool and wants the CLI to log in when developers SSH into a server without a browser. Which statement is correct?
21
Since AWS CLI v2.22.0, aws sso login uses Authorization Code + PKCE by default. What is the main security reason for this change?
22
The server enables refresh token rotation with reuse detection. A developer runs devcli logs -f and devcli deploy in two terminals; occasionally both get logged out at the same time. What is the cause and the most correct fix?
23
The devcli access token has expired; the CLI sends the refresh token and the server returns 400 {"error":"invalid_grant"}. How should the CLI handle it?
24
A GitHub Actions job needs to run devcli deploy. Which approach is most appropriate?
25
devcli whoami reports forbidden when run in the project directory but prints the right username when run in the home directory. What is the most reasonable next diagnostic step?
26
The operations team sees many device flow sessions created from a few unusual IPs and then approved by dozens of different users within an hour. What is the most reasonable interpretation?
27
When debugging a CLI login error on a developer machine, what is a safe way to check whether the DEVCLI_TOKEN variable is set?
28
In DevCLI's STRIDE threat model, how is the threat "an attacker edits .devcli/project.json to redirect requests to another team" correctly mitigated?
29
Which CLI error message helps the user self-diagnose the "login succeeded but every command is denied" incident fastest?
30
Which server-side storage design is most appropriate for the device_code and refresh token?