Repository navigation
Add concept quizzes and silence MDX build warnings #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| { | ||
| "title": "Boundary checks", | ||
| "track": "bscp", | ||
| "summary": "Three distinctions from the BSCP notes: who may read a response, what a session proves, and which control stops injected script.", | ||
| "lesson": { "track": "bscp", "slug": "access-control" }, | ||
| "questions": [ | ||
| { | ||
| "prompt": "A script on another site can read an authenticated response from yours. What went wrong?", | ||
| "choices": [ | ||
| "The browser refused to send the request", | ||
| "The server told the browser that the other origin may read the response", | ||
| "The user followed a link", | ||
| "The session cookie was marked Secure" | ||
| ], | ||
| "answer": 1, | ||
| "explain": "Cross-origin resource sharing decides whether foreign script may read the response. The request can still be sent. Cross-site request forgery is about an action caused by a request the browser attaches cookies to, not about reading the body." | ||
| }, | ||
| { | ||
| "prompt": "Someone is signed in and can open another person's record by changing an identifier. Where is the gap?", | ||
| "choices": [ | ||
| "Authentication, because the session exists", | ||
| "Access control on that specific object", | ||
| "Transport encryption", | ||
| "The absence of a login page" | ||
| ], | ||
| "answer": 1, | ||
| "explain": "Authentication already established who they are. The missing check is whether that identity may use that object. That check is access control." | ||
| }, | ||
| { | ||
| "prompt": "Untrusted data is written into a page and the browser treats it as script. Which statement matches the notes?", | ||
| "choices": [ | ||
| "A content security policy is the fix, and encoding is optional", | ||
| "Encode for the context the data is written into. A tight content security policy is a second layer", | ||
| "Hiding the element with CSS contains it", | ||
| "Turning off cookies removes the issue" | ||
| ], | ||
| "answer": 1, | ||
| "explain": "Output encoding stops the browser from treating data as script. A content security policy can limit what still runs if encoding fails. A policy that allows inline script does not contain the issue." | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| { | ||
| "title": "Control distinctions", | ||
| "track": "security-plus", | ||
| "summary": "Three Security+ style distinctions: disclosure versus change, what a camera is for, and what insurance does to a risk.", | ||
| "lesson": { "track": "security-plus", "slug": "security-controls" }, | ||
| "questions": [ | ||
| { | ||
| "prompt": "A record is shown to someone who should not have it, and the bits themselves are unchanged. Which goal failed?", | ||
| "choices": [ | ||
| "Confidentiality", | ||
| "Integrity", | ||
| "Availability", | ||
| "Authentication" | ||
| ], | ||
| "answer": 0, | ||
| "explain": "Confidentiality is about unauthorized disclosure. Integrity is unauthorized or accidental change. Availability is being able to use the system when you should. Confirm the wording against CompTIA's glossary before the exam. This is a study distinction, not an official item." | ||
| }, | ||
| { | ||
| "prompt": "A camera records who comes through a door. Which control shape is that?", | ||
| "choices": [ | ||
| "Technical preventive", | ||
| "Physical detective", | ||
| "Managerial corrective", | ||
| "Technical compensating" | ||
| ], | ||
| "answer": 1, | ||
| "explain": "A camera records what happened, so it is detective, and it is a physical device. A lock on the same door would be physical preventive. The camera does not stop the entry by itself." | ||
| }, | ||
| { | ||
| "prompt": "The team buys insurance for flood damage in the server room. What did they do with the risk?", | ||
| "choices": [ | ||
| "Mitigate it by lowering the chance", | ||
| "Transfer the financial impact", | ||
| "Avoid it by leaving the room unused", | ||
| "Accept it with no further action" | ||
| ], | ||
| "answer": 1, | ||
| "explain": "Insurance shifts the financial impact to another party. Mitigation would be raising the equipment or adding a barrier. Avoidance would be not operating in that room. Acceptance is keeping the risk without extra action." | ||
| } | ||
| ] | ||
| } |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import { useEffect, useState } from "react"; | ||
|
|
||
| import { readCustomQuiz } from "@/lib/browser-quizzes"; | ||
| import type { StoredQuiz } from "@/lib/quiz-schema"; | ||
|
|
||
| import QuizPlayer from "./QuizPlayer"; | ||
|
|
||
| export default function LocalQuizPlayer() { | ||
| const [quiz, setQuiz] = useState<StoredQuiz | null | undefined>(undefined); | ||
|
|
||
| useEffect(() => { | ||
| function load() { | ||
| const id = location.hash.replace(/^#/, ""); | ||
| setQuiz(id ? readCustomQuiz(decodeURIComponent(id)) : null); | ||
| } | ||
| load(); | ||
| window.addEventListener("hashchange", load); | ||
| return () => window.removeEventListener("hashchange", load); | ||
| }, []); | ||
|
|
||
| if (quiz === undefined) { | ||
| return <p className="text-sm text-muted">Loading the quiz saved in this browser.</p>; | ||
| } | ||
|
|
||
| if (!quiz) { | ||
| return ( | ||
| <p className="text-sm leading-6"> | ||
| This browser does not have a quiz for that link.{" "} | ||
| <a className="underline decoration-line underline-offset-4" href="/quizzes"> | ||
| Back to quizzes | ||
| </a> | ||
| . | ||
| </p> | ||
| ); | ||
| } | ||
|
|
||
| return <QuizPlayer quiz={quiz} />; | ||
|
pullfrog[bot] marked this conversation as resolved.
Resolved
|
||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.