Ask Dr. Mohammad locally, or prepare an experiment-aware prompt for ChatGPT, Gemini or Claude. The external providers open in their own tabs; nothing is automatically submitted.
Public course objective, displayed commands, source excerpts and procedure. Private assessment content is not collected.
Prepare a contextual AI prompt
0 characters
Common secret and email patterns are redacted on preparation; this is not a comprehensive privacy filter. Review the entire editable prompt, including student work and unpublished research, before sharing. The providers apply their own accounts, privacy settings and limits.
Inspect POSIX permission bits and derive new-file defaults from umask.
The focus of this experiment is to distinguish secrets, credentials and public configuration. Students then evaluate storage permissions and key-distribution boundaries, and verify least-privilege handling without exposing actual secrets. The Concepts view explains the operation before the practical work; the Simulation view is used to examine reference and changed inputs, not to substitute for actual measurements.
Learning objectives
Distinguish secrets, credentials and public configuration.
Evaluate storage permissions and key-distribution boundaries.
Verify least-privilege handling without exposing actual secrets.
Identify the configured inputs (Object; Octal permission; Creation umask) and record the corresponding observed outputs with units where applicable.
Compare the reference calculation or decision with an independent implementation or authorized observation; state any discrepancy and the applicable model boundary.
Expected learning outcomes
On completion, students can distinguish secrets, credentials and public configuration, evaluate storage permissions and key-distribution boundaries, and verify least-privilege handling without exposing actual secrets.
Required deliverables
Submit the derivation or state trace for the named operation, the exact reference and changed configurations, the associated simulator or practical evidence, and a short validation statement addressing verify least-privilege handling without exposing actual secrets. Separate predicted values from observations.
Prerequisite knowledge and related learning
Review the following catalogue prerequisites before starting. After completion, continue to K11 · Threat modeling & integrated security review.
The specified isolated laboratory environment, with local synthetic inputs and authorized services only. Use the experiment-specific setup and verification instructions.
Begin with a manual prediction, record the baseline, change one independent condition at a time, and compare the resulting trace or measurements with the original prediction. Record observations and uncertainty separately from reference values. Follow the experiment’s specific procedure, safety limits, and acceptance checks.
Unix mode bits express owner/group/other read, write and execute permissions; umask removes bits from requested creation mode.
Before operating the equipment or executing the program, derive the expected outcome using the required theoretical work in Experiment. Use the diagram to identify the variables and system boundaries.
Scientific theory · Permissions and credential handling
Unix permissions separate owner, group and other access. Each octal digit encodes read=4, write=2 and execute=1. Directory execute means traversal, not executable file content. A creation umask clears requested permission bits; it does not retroactively change existing files.
Worked example and engineering interpretation
Mode 600 grants the owner read and write with no group or other permissions. For requested file mode 666 and umask 077, the resulting mode is 600. Inspect file ownership and permissions rather than treating an octal value as the only protection.
Engineering principles · additional worked teaching example
Unix permissions are three rwx triples. Octal 600 is rw-------; 640 permits group read. Directory traversal also requires execute permission. A restrictive umask affects newly created file permissions, not existing files.
From theory to experiment
Predict the reference result before operating the workbench; check the actual intermediate state, units and constraints. The existing simulation, implementation and procedure below are distinct sources of evidence.
How to investigate K10 · Credential & key protection
Inspect credential permissions without printing secrets.
Analytical investigation means collecting an observation, identifying the mechanism, using a calculation or state trace to explain it, and checking your conclusion against evidence. Controlled comparison means changing one independent variable, holding the remaining relevant conditions constant, and measuring a dependent variable against a baseline. Experimental validation means comparing a predicted result to a reproducible observation or assertion; agreement inside a model does not certify hardware. Evidence-based reasoning connects a specific observation to a theoretical rule and states uncertainty, not merely an opinion. Performance characterization records a named metric and its units across conditions; sensitivity analysis changes one parameter across several values. A threat assessment links an asset, threat, consequence and evidence to a mitigation.
Experiment-specific guided practice
Objective: Inspect credential permissions without printing secrets.
Choose credentials.json mode 600. Inspect owner rw-, group ---, other --- and the private-file policy.
Change mode to 640 then 644. Identify precisely which subjects gain read access.
Choose private directory 700 and compare directory traversal permission with 755.
Set umask 022, then 077. Compute 0666 & ~umask and compare the default file modes.
Reference check:
Model boundary:
Independent task and submission evidence
2. Change mode to 640 then 644. Identify precisely which subjects gain read access. Record the named input, prediction, actual output and one limitation; restore the original condition and repeat.
Before execution write the independent variable and its levels, dependent observation with units where applicable, baseline, controlled variables, measurement method and expected result. For a state machine use state/event/output rather than inventing a numeric metric. Record failures and repeat the baseline. A weak conclusion is “it works”; a supported conclusion names the changed setting, observed value/state, corresponding rule and one limitation.
Trial
Changed setting
Fixed settings
Predicted result
Actual observation / units
Evidence / uncertainty
A: baseline
Reference
Record
Predict
Record
Record
B: one change
Record
Same as A
Predict
Record
Record
A: repeat
Restore
Same as A
Predict
Record
Record
Completion: submit the filled table, relevant simulator screenshot or terminal/notebook output, reasoning with units/assumptions, and one limitation. Preserve the independent assessment questions; this guide does not fill their answers.
Worked engineering reasoning and boundary conditions
Engineering reference configuration: Object = credentials.json; Octal permission = 600; Creation umask = 077. In the classroom model, Private policy = Pass; New file mode = 600; Group/other readable = No. The policy requires no group/other bits; directory owners also need traversal. It is not a complete ACL or system-hardening assessment. Bit-level policy model, not operating-system inspection.
Use the diagram to follow the calculation or state progression. Keep the teaching configuration separate from the independent exercise values; compare observations with the actual model and implementation.
Concept animation · matrix and row processing
Explore the teaching example independently of the simulator. Each step reveals an operation, data relationship or calculated state. The Simulation view has separate editable inputs.
Step 1 of 3 · Row 1
Row 1
Owner
["1", "1", "0"]
Row 2
Owner
["1", "1", "0"]
Group
["0", "0", "0"]
Row 3
Owner
["1", "1", "0"]
Group
["0", "0", "0"]
Other
["0", "0", "0"]
Teaching example only; inspect live calculations or real practical evidence separately.
Recall the concept before revealing its explanation.
Restrict access to the owner on Linux directories/files.
K10 · 02 / 08What does stat prove?Reveal explanation
Engineering explanation
The mode bits, not protection against the same user, administrator or compromised host.
K10 · 03 / 08Which owner and permission conditions must be checked?Reveal explanation
Engineering explanation
Keep the toolkit private directory in Linux home, not a Windows-mounted folder. Inspect mode without printing contents; correct only your own lab files.
Only authorized users or services should read secret material; broad filesystem access undermines key protection.
K10 · 05 / 08Why inspect metadata rather than print secret contents?Reveal explanation
Engineering reasoning
Permissions and ownership can be audited without exposing the credential itself in logs or screenshots.
K10 · 06 / 08A local credential file is inspected. Select every technically valid statement.
A. Check file permissions without printing secrets.
B. Rotate a credential if exposure is confirmed.
C. A secret embedded in public JavaScript remains private.
D. Logging passwords is a safe way to prove configuration.Reveal explanation
Applied scenario
Correct: A. Check file permissions without printing secrets.; B. Rotate a credential if exposure is confirmed.
K10 · 07 / 08In K10 · Credential & key protection, which command or code executes the final documented practical action?Reveal explanation
Implementation recall
stat -c "%a %n" "$HOME/.psut-kali-security-v14" "$HOME/.psut-kali-security-v14/server.key" "$HOME/.psut-kali-security-v14/credentials.json"
K10 · 08 / 08For K10 · Credential & key protection, which actual output or state confirms the prescribed practical run succeeded, and what does it not establish?Reveal explanation
Evidence & acceptance
Initialize K02 first. Normal user runs lab.py permissions and stat. Directory should be 700; private files should have no group/other bits (typically 600). Negative control uses disposable dummy file, not a real key. Never chmod a real private key to world-readable.
Loading experiment-specific apparatus…Previous model / additional reference tools
Simulation task
Inspect credential permissions without printing secrets.
Explore the model using its own controls. Record a prediction before changing a condition. Compare the reference with a changed condition, then use the Experiment tab for the procedure, acceptance criteria and notebook. Model outputs and physical observations must remain separate.
Predict the outcome, change either condition, then compare the modeled decision. This illustrates the selected control criteria, not a full implementation or measurement.
01 · InputCredential protection
→
02 · Evaluate2 of 2 checks
→
03 · OutcomeConditions met
CONTROL PATH · VIRTUAL INSTRUMENTCONDITIONS MET
Signal path illustrates a decision rule. The indicator is not actual network traffic, cryptographic verification or device measurement.
Credential handling checks satisfied
Reference conditions selected.
Reference conditions selected.
Complete the actual local Kali procedure below. The workbench does not send packets, perform cryptography, inspect a device or establish that real controls are effective.
Closed two-condition teaching fixture; actual security validation requires the practical procedure.
Loading instrument…
Awaiting model display.
Experimental instrumentation · A/B
Compare two model conditions
Capture a baseline, change one experimental condition, run the model if required and capture the comparison. Snapshots contain visible controls and display text, not physical sensor readings. Review before exporting.
Keep the toolkit private directory in Linux home, not a Windows-mounted folder. Inspect mode without printing contents; correct only your own lab files.
Experimental protocol
Prerequisites
K02; private directory created
Procedure
Audit credential/key modes; change permissions only on an empty temporary dummy file.
Acceptance
No group/world permissions on sensitive files; dummy 0644 detected and 0600 accepted.
Evidence
K10-PERMISSIONS.json and stat mode output, never contents.
Standards link
Device configuration; secure storage
Discussion
Why do local modes not protect secrets from the owner, root or backups?
Run & verify — acceptance checklist
Build verification: Actual positive/negative permission logic tested with disposable files; actual initialized toolkit pending.
Initialize K02 first. Normal user runs lab.py permissions and stat. Directory should be 700; private files should have no group/other bits (typically 600). Negative control uses disposable dummy file, not a real key. Never chmod a real private key to world-readable.
Record the actual output, source (mock/model or physical), and any error. A missing tool, timeout or untested external service is not a pass.
Before the simulation or practical, solve both experiment-specific tasks. List the given inputs, show the intermediate calculation or state trace, identify the expected observation, and state a limitation. Show formulas and intermediate calculations where relevant, or draw the requested state/sequence diagram. These are independent classroom fixtures; where they differ from the reference configuration below, do not treat them as measured values. Compare your predictions with the corresponding experiment afterwards.
01 · Predict and derive using the given inputs
Expand octal 600, 640 and 644 into three rwx triplets. Identify which expose read access beyond the owner.
Engineering method — Unix permissions are three rwx triples. Octal 600 is rw-------; 640 permits group read. Directory traversal also requires execute permission. A restrictive umask affects newly created file permissions, not existing files. Apply this method to the assigned values independently; compare your reasoning with the relevant simulator or practical implementation.
02 · Compare or justify using evidence
Calculate file creation mode 0666 & ~0077 and directory mode 0777 & ~0077. Explain why permission inspection should not print key contents.
Engineering method — Unix permissions are three rwx triples. Octal 600 is rw-------; 640 permits group read. Directory traversal also requires execute permission. A restrictive umask affects newly created file permissions, not existing files. Apply this method to the assigned values independently; compare your reasoning with the relevant simulator or practical implementation.
03 · Configuration analysis
Configuration analysis · Independent work
A new file is requested with mode666 under umask027. Derive resulting permissions and explain whether it is appropriate for a device private key.
Configuration analysis — Unix permissions are three rwx triples. Octal 600 is rw-------; 640 permits group read. Directory traversal also requires execute permission. A restrictive umask affects newly created file permissions, not existing files. Apply this method to the assigned values independently; compare your reasoning with the relevant simulator or practical implementation.
Work is saved locally when browser storage is available. Export it for submission; no remote upload or automatic grade is assigned.
Expanded independent theoretical exercise bank
Progress from calculation and interpretation to diagnosis and controlled engineering design. Complete the questions without opening the simulation first; show intermediate steps.
Intermediate · Explain a changed-input result
Independent theoretical exercise · K10-01
Use the reference configuration (Object = credentials.json; Octal permission = 600; Creation umask = 077), but change Object = private directory. The model reports Private policy = Fail. Explain the governing rule and assumptions that make this output plausible; identify an independent verification method.
Intermediate · Interpret a state transition
Independent theoretical exercise · K10-02
The reference model reports Private policy: Pass. Under Object = private directory it reports Fail. Explain which configured condition changed and what the two outputs establish, and what they do not establish.
Intermediate · Interpret a technical trace
Independent theoretical exercise · K10-03
For Octal permission = 666, the model supplies this excerpt from Permission bit decomposition:
Subject · Octal · Read · Write · Execute · Symbolic
Owner · 6 · Yes · Yes · No · rw-
Group · 6 · Yes · Yes · No · rw-
Other · 6 · Yes · Yes · No · rw-
Compute the range (maximum minus minimum) of the Octal column in these rows. Identify the maximum observation. Do not extrapolate beyond these rows.
Advanced · Reverse reasoning
Independent theoretical exercise · K10-04
An observation is Private policy = Fail. Candidate A uses Object = credentials.json; Octal permission = 600; Creation umask = 077. Candidate B changes the listed settings (Octal permission = 666) and keeps the remaining settings fixed. Which is consistent with the observation? If both can explain it, say what additional evidence is required.
Advanced · Diagnose a reported mismatch
Independent theoretical exercise · K10-05
A student configures Creation umask = 027 while preserving all other reference settings, but copies the reference report of New file mode = 600. Evaluate whether the report is justified. Identify the first configuration/output check to perform.
Challenging · Design a controlled verification
Independent theoretical exercise · K10-06
Design a controlled comparison for K10 · Credential & key protection using reference Object = credentials.json; Octal permission = 600; Creation umask = 077 and test Object = private directory. Specify the changed setting(s), measured metric Private policy, controls, repetitions, an acceptance check and what evidence can distinguish an actual implementation from the model.
Step-by-step experimental procedure
Inspect POSIX permission bits and derive new-file defaults from umask.
1 · Reference workbench configuration
Use the named reference workbench and its reference inputs. Additional live instruments may have different controls; use the matching instrument. Record virtual and practical results separately.
Objectcredentials.json
Octal permission600
Creation umask077
2 · Perform the investigation in order
Choose credentials.json mode 600. Inspect owner rw-, group ---, other --- and the private-file policy.
Change mode to 640 then 644. Identify precisely which subjects gain read access.
Choose private directory 700 and compare directory traversal permission with 755.
Set umask 022, then 077. Compute 0666 & ~umask and compare the default file modes.
In Kali, run lab.py permissions and the supplied stat command. Do not change real key permissions to create a negative case; use the toolkit disposable empty fixture.
Distinguish the group/other confidentiality check from owner read/write and directory traversal.
Required evidence: Permission matrix, creation-mode calculations and local stat evidence.
Model boundary: Bit-level policy model, not operating-system inspection.
Controlled investigation · reproducible evidence
Method. Use the existing reference workbench configuration and the named controlled changes below. A controlled variable stays fixed while the independent variable is intentionally changed; the dependent variable is the resulting observed output. First predict each trial from the Concepts page. Run the baseline, then change only the specified setting and record the outcome. For deterministic traces one execution per case and a repeated verification are sufficient; for timing or stochastic measurements repeat at least five times, recording each run, median and range. Reset to the reference state between independent comparisons.
Evidence: attach the completed comparison table, one trace or screenshot per condition, and actual practical terminal/hardware evidence where applicable. Explain any prediction mismatch and distinguish modeled behavior from measured results.
Loading laboratory-specific procedure…
Python / Google Colab notebook
Bounded notebook reference exercise; original device/service commands are reference-only. Validated locally in a fresh Jupyter kernel. Download, then upload to Google Colab.
✓ Expected: Toolkit directory is selected and all dependency checks pass. Do not proceed if any check fails.
Objective: Audit private lab credential and key file permissions.
Verify files are not group/world readable, and avoid exporting sensitive contents.
ACTION 01 / 02
Kali terminal C
python3 lab.py permissions
✓ Expected: The JSON report records restrictive file-permission checks and the deliberate negative test.
ACTION 02 / 02
Kali terminal C
stat -c"%a %n""$HOME/.psut-kali-security-v14""$HOME/.psut-kali-security-v14/server.key""$HOME/.psut-kali-security-v14/credentials.json"
✓ Expected: Permissions and paths are printed. The private directory should be 700 and private key/credential files 600.
Experimental notebook
Record your own results. Values are not prefilled or independently verified.
Method and implementation
Review the implementation after attempting the practical steps.
Local permissions · method and source
The 0700 directory prevents other ordinary users traversing it. Private files require no group or world permission. Root and the owner can still access them; permissions do not prevent disclosure via process arguments or backups.
Inspect the actual implementation below. Full file: lab.py.
PYTHON · Source code
defpermissions():tests=[check('Private directory permissions',HOME.stat().st_mode&0o077==0,oct(HOME.stat().st_mode&0o777))]fornamein['credentials.json','server.key','ca.key','passwd']:p=HOME/name;mode=p.stat().st_mode&0o777;tests.append(check(name+' permissions',mode&0o077==0,oct(mode)))# Negative control uses an empty disposable file, never a real credential.importtempfilewithtempfile.TemporaryDirectory(dir=HOME)astmp:dummy=Path(tmp)/'dummy';dummy.touch();dummy.chmod(0o644)tests.append(check('Detect overly broad dummy mode',dummy.stat().st_mode&0o077!=0,'0644 rejected by local policy'))dummy.chmod(0o600);tests.append(check('Correct dummy mode',dummy.stat().st_mode&0o077==0,'0600 accepted'))returnsave('K10-PERMISSIONS',tests)
Verification and notebook
Expected observation / verification
Expected directory 700 and private files 600 or more restrictive. Do not print their contents.
Engineering discussion
Why is filesystem access control important even if transport encryption is enabled?
Download this notebook and open Google Colab. Select File → Upload notebook and choose the downloaded .ipynb.
Read the Markdown instructions before each executable cell. Use a Python runtime, run cells from top to bottom, and resolve imports if necessary.
Perform the baseline and controlled changes. Save the notebook with actual outputs and your written interpretation.
Execution scope: Default computational cells passed isolated local Python execution; physical equipment and live services require separate verification.
01Instructions · Markdown
# K10 · K10 · Credential & key protection
**PSUT IoT Engineering Studio — Dr. Mohammad Alja’afreh**
## Introduction
Inspect credential permissions without printing secrets.
## How to run
1. Download this notebook from the laboratory page. Open Google Colab → File → Upload notebook.
2. Select a Python CPU runtime. Run cells from top to bottom using Shift+Enter, or Runtime → Run all.
3. Read the printed observations and assertions. Change one parameter at a time and rerun the relevant cell.
4. Save your own outputs and compare them to the portal Experiment tab.
**Execution boundary:** Bounded notebook reference exercise; original device/service commands are reference-only. Do not run the hardware or service commands in Colab. No real credentials are needed. The notebook is self-contained.
02Instructions · Markdown
## Experiment-specific preparation
Inspect credential permissions without printing secrets.
**Reference procedure (use the matching simulator/WSL tool where named, not an unrelated service):**
1. Choose credentials.json mode 600. Inspect owner rw-, group ---, other --- and the private-file policy.
2. Change mode to 640 then 644. Identify precisely which subjects gain read access.
3. Choose private directory 700 and compare directory traversal permission with 755.
4. Set umask 022, then 077. Compute 0666 & ~umask and compare the default file modes.
5. In Kali, run lab.py permissions and the supplied stat command. Do not change real key permissions to create a negative case; use the toolkit disposable empty fixture.
**Evidence:**
**Boundary:**
03Instructions · Markdown
## 1. Objectives and reference condition
- Reproduce the specific computational mechanism in this laboratory.
- Inspect the output, compare the reference condition with a changed or rejected condition where implemented, and explain any discrepancy.
- Distinguish actual local Python execution from mock, physical and external-service observations.
## 2. Environment check
04Python · executable cell
PYTHON · Code cell
# =====================================================================
# K10 | Code cell 01 | K10 · Credential & key protection
# Purpose: 1. Objectives and reference condition - Reproduce the specific computational mechanism in this laboratory. - Inspect the output, compare the reference condition with a changed or rejected condition where implem
# Inputs: the explicit fixture/settings below and any preceding cell state.
# Output: inspect printed values, returned records or assertions; record evidence.
# =====================================================================
import sys
print("Python",sys.version.split()[0])
# Check the expected invariant so a mismatch fails visibly instead of appearing successful.
assert sys.version_info >= (3,10)
## 3. Implementation
Read the comments and variable definitions before execution. Assertions must pass; inspect values, not just completion.
06Python · executable cell
PYTHON · Code cell
# =====================================================================
# K10 | Code cell 02 | K10 · Credential & key protection
# Purpose: 3. Implementation Read the comments and variable definitions before execution. Assertions must pass; inspect values, not just completion.
# Inputs: the explicit fixture/settings below and any preceding cell state.
# Output: inspect printed values, returned records or assertions; record evidence.
# =====================================================================
import tempfile,os
from pathlib import Path
# Limit resource lifetime to this block so files, sockets or temporary state are cleaned up.
with tempfile.TemporaryDirectory() as d:
f=Path(d)/'dummy';f.touch();f.chmod(0o644);assert f.stat().st_mode&0o077
f.chmod(0o600);assert not f.stat().st_mode&0o077
print('Disposable file permission negative and positive controls passed.')
## Original portal implementation (reference only)
These are the actual laboratory snippets. They are retained for comparison; follow the portal setup for WSL, hardware or services. They are **not** executed by Run all.
```bash
python3 lab.py permissions
```
```python
def permissions():
tests=[check('Private directory permissions',HOME.stat().st_mode&0o077==0,oct(HOME.stat().st_mode&0o777))]
for name in ['credentials.json','server.key','ca.key','passwd']:
p=HOME/name; mode=p.stat().st_mode&0o777;tests.append(check(name+' permissions',mode&0o077==0,oct(mode)))
# Negative control uses an empty disposable file, never a real credential.
import tempfile
with tempfile.TemporaryDirectory(dir=HOME) as tmp:
dummy=Path(tmp)/'dummy';dummy.touch();dummy.chmod(0o644)
tests.append(check('Detect overly broad dummy mode',dummy.stat().st_mode&0o077!=0,'0644 rejected by local policy'))
dummy.chmod(0o600);tests.append(check('Correct dummy mode',dummy.stat().st_mode&0o077==0,'0600 accepted'))
return save('K10-PERMISSIONS',tests)
```
08Instructions · Markdown
## 4. Results and analysis
Record the actual output and whether the assertions pass. Identify a parameter to vary, state your prediction, repeat the reference calculation, then explain the changed result.
| Trial | Configuration | Observation | Interpretation |
|---|---|---|---|
| A | Reference | | |
| B | One controlled change | | |
| C | Reference repeat | | |
**Limitations:** Bounded notebook reference exercise; original device/service commands are reference-only. Notebook success does not certify external equipment or services.
09Instructions · Markdown
## Guided reasoning and evidence
A controlled comparison changes one independent input while keeping the other relevant inputs fixed; the dependent variable is the recorded output. Use this lab’s reference condition above.
**Independent task:** 2. Change mode to 640 then 644. Identify precisely which subjects gain read access. Record the named input, prediction, actual output and one limitation; restore the original condition and repeat.
| Trial | Input/configuration | Prediction | Observation | Evidence / limitation |
|---|---|---|---|---|
| A | Reference | | | |
| B | Changed input | | | |
| A repeat | Reference | | | |
A conclusion is supported only when it cites the recorded values or observed states and explains them with the experiment theory.
Shared research workbenches · network designer & advanced studiesConcurrent-device simulation & Monte Carlo research