CSE111 · Orientation to Computing

Software Development, Version Control & Cyber Security Complete Exam-Ready Study Notes

Unit II
Course Code: CSE111  ·  Credits: 3 (3-0-0)
Weightage: ATT 30  ·  CA 70  ·  Mid Term / End Term: Not Applicable
Exam Category: XXP  ·  Focus: Skill Development, Employability
Course Outcomes Mapped to This Unit
  1. CO1 — Apply computational thinking and computing environment concepts to solve basic computing problems.
  2. CO2 — Explain software development practices, version control, and fundamental cybersecurity concepts for secure computing.
  3. CO4 — Describe Artificial Intelligence, Machine Learning, Generative AI, Agentic AI, and emerging computing technologies with ethical considerations.

Table of Contents

ISoftware and Software Development Practices3
IISoftware Development Life Cycle (SDLC) Models5
IIIVersion Control Systems — Concepts8
IVGit — Commands, Workflows and Branching10
VCyber Security Fundamentals — CIA, Threats and Malware13
VIFirewalls and Network Defence16
VIIUser Account Types, Privileges and Access Control18
VIIISafe Internet Practices20
IXDigital Footprint22
XCyber Ethics and the Legal Framework24
XISummary Tables & Quick Revision Sheet26
XIITop 10 Exam Tips & Practice Questions27
XIIISolutions to Practice Questions28
XIVReferences, Key Takeaways & CO Mapping31
How to use these notes

Read the theory first, then re-derive every table from memory. Example blocks are written in the exact style expected in CA tests. Section XI is a compressed revision sheet — use it in the last 24 hours. Practice questions carry difficulty badges; attempt them closed-book before checking Section XIII. Git commands should be typed out once by hand — reading them is not enough.

Assessment pattern for this course
ComponentWeightageMapped COs
Test25%CO1, CO2
Design Your Dream CV25%CO1, CO2, CO4, CO5, CO6
EDU-RevolUTION Task25%CO3
Assignment25%CO4, CO5

Unit II primarily feeds the Test and Assignment components through CO2.

I. Software and Software Development Practices

1.1 What is Software?

Definition — Software

Software is a collection of programs, procedures, associated documentation and data that instructs a computer system what to do and how to do it. Unlike hardware, software is intangible and is engineered rather than manufactured.

Software engineering is the systematic application of engineering principles to the design, development, testing, deployment and maintenance of software. It exists because programming is not the same as engineering — a program that works for one user is not the same as a system that works reliably for a million users.

The Software Crisis

The term was coined in 1968 at the NATO Software Engineering Conference to describe the chronic problems of large software projects: schedule overruns, budget overruns, unreliable products and unmaintainable code. The root cause was that projects scaled up in size but not in discipline. Structured processes (the SDLC) were the industry's answer.

1.2 Types of Software

TypeDescriptionExamples
System softwareManages hardware and provides a platform for applicationsOperating systems, device drivers, compilers, loaders
Application softwareSolves specific end-user problemsBrowsers, MS Office, WhatsApp, AutoCAD
Utility softwareMaintains and optimises the systemAntivirus, disk defragmenter, backup tools
MiddlewareConnects disparate applications or servicesWeb servers, message queues, API gateways
FirmwareSoftware embedded in hardwareBIOS/UEFI, router firmware
Embedded softwareDedicated software inside a deviceWashing machine controllers, ABS in cars

1.3 Software Quality Attributes

Software quality is assessed along two axes: functional (does it do what it should?) and non-functional (how well does it do it?).

AttributeMeaningMeasurable Indicator
CorrectnessProduces the specified output for all valid inputsTest pass rate; defect density
ReliabilityOperates without failure over timeMTBF (mean time between failures)
UsabilityEasy to learn and operateTime-to-complete-task; error rate
EfficiencyUses minimal time and resourcesResponse time; CPU/memory footprint
MaintainabilityEasy to modify and extendCyclomatic complexity; code churn
PortabilityRuns on multiple platformsNumber of supported OSes/browsers
SecurityResists unauthorised access and tamperingNumber of open vulnerabilities (CVEs)
ScalabilityHandles growth in load gracefullyThroughput vs concurrent users
TestabilityEasy to verify behaviourCode coverage percentage
ReusabilityComponents can be reused elsewhereLibrary/module reuse ratio
Defect Density and MTBF \[ \text{Defect Density} = \frac{\text{Number of Defects}}{\text{Size of the Product (KLOC)}} \] \[ \text{MTBF} = \frac{\text{Total Operating Time}}{\text{Number of Failures}} \]

1.4 Roles in a Software Development Team

RoleResponsibility
Product Owner / Business AnalystDefines requirements, prioritises the backlog, represents the customer
Project Manager / Scrum MasterPlans schedules, removes blockers, tracks progress and risk
Software ArchitectDefines the high-level structure, technology choices and interfaces
Developer / EngineerImplements features, writes unit tests, reviews peers' code
QA Engineer / TesterDesigns test cases, executes them, reports and tracks defects
DevOps EngineerBuilds CI/CD pipelines, manages infrastructure and monitoring
UI/UX DesignerDesigns user flows, wireframes and visual assets
Technical WriterProduces user manuals, API documentation and release notes
Security EngineerPerforms threat modelling, code review and penetration testing

1.5 Software Development Practices

(a) Coding Standards

Agreed conventions for naming, indentation, comments and file organisation. They reduce the cost of reading code — and reading code costs far more than writing it.

PracticeRuleBenefit
Meaningful namescalculateTax() not calc()Self-documenting code
Consistent styleOne formatter (Prettier, Black) enforced in CIZero diff noise in reviews
Small functionsOne responsibility per functionEasier testing and reuse
Comment the why, not the whatExplain non-obvious decisionsPrevents comment rot
No magic numbersUse named constantsImproved readability

(b) Code Review

A structured peer examination of proposed changes before they are merged. A good review checks correctness, security, readability, test coverage and adherence to standards. Rule of thumb: review pull requests within 24 hours and keep them under ~400 lines — larger reviews get superficial attention.

(c) Testing Levels

LevelScopeWho Writes ItExample
Unit testingA single function or classDeveloperTest that add(2,3) returns 5
Integration testingInteraction between modulesDeveloper / QAOrder service correctly calls payment API
System testingThe complete productQAEnd-to-end purchase flow
Acceptance testingFitness for business useCustomer / POUser acceptance test (UAT) sign-off
Regression testingExisting features after a changeQA (often automated)Re-run the full suite after a bug fix

(d) Testing Approaches

ApproachLogicUsed When
Black-boxTest inputs/outputs without seeing codeFunctional verification
White-boxTest internal paths and branchesUnit testing, coverage analysis
Grey-boxPartial knowledge of internalsIntegration and security testing
ManualHuman executes test casesExploratory and usability testing
AutomatedScripts execute test casesRegression suites in CI
Example 1 — Computing Defect Density

Problem: A module of 8,000 lines of code (8 KLOC) is found to contain 24 defects during system testing.

Solution:

\[ \text{Defect Density} = \frac{24}{8} = 3.0 \text{ defects per KLOC} \]

Interpretation: Industry benchmarks for well-reviewed code are typically 1–5 defects per KLOC during system testing. A density of 3.0 is acceptable but suggests that unit-test coverage could be improved. If the same team consistently exceeds 10 defects/KLOC, the review process or requirements clarity needs attention.

Example 2 — MTBF and Availability

Problem: A server application ran for 1,200 hours in a quarter and crashed 4 times, with a total repair time of 8 hours.

Solution:

\[ \text{MTBF} = \frac{1200}{4} = 300 \text{ hours} \]

\[ \text{MTTR} = \frac{8}{4} = 2 \text{ hours} \]

\[ \text{Availability} = \frac{MTBF}{MTBF + MTTR} = \frac{300}{302} \approx 99.34\% \]

Interpretation: 99.34% availability corresponds to roughly 58 minutes of downtime per month. A "three nines" (99.9%) target would require either fewer failures or a faster repair time.

Exam tip

When asked to "explain software engineering", always contrast it with ad-hoc programming: engineering adds process, measurement and documentation. Name the SDLC phases and cite at least two quality attributes with their measurable indicators.

II. Software Development Life Cycle (SDLC) Models

2.1 The SDLC Phases

Definition — SDLC

The Software Development Life Cycle is the structured sequence of phases through which a software product passes from initial concept to retirement. Each phase has defined inputs, activities, deliverables and exit criteria.

PhaseKey ActivitiesDeliverableExit Criterion
1. Requirement gathering & analysisInterview stakeholders, study existing systems, define scopeSRS (Software Requirements Specification)SRS signed off by client
2. System designArchitecture, database design, UI design, interface definitionDesign document, ER diagram, UML diagramsDesign review approved
3. ImplementationCoding, unit testing, code reviewSource code, unit test suiteCode merged; unit tests pass
4. TestingIntegration, system, acceptance testing; defect loggingTest plan, test cases, defect reportDefect density within threshold
5. DeploymentRelease packaging, installation, user trainingRelease build, user manualProduction sign-off
6. MaintenanceBug fixes, enhancements, adaptation, performance tuningPatches, minor releasesProduct retired

Types of Maintenance

TypePurposeApprox. Share
CorrectiveFix reported defects~20%
AdaptiveAdjust to new environments (OS, browser, hardware)~25%
PerfectiveImprove performance or maintainability without changing behaviour~50%
PreventiveReduce future failure risk (refactoring, documentation)~5%

Maintenance consumes the largest share of total lifetime cost — often 60–70%. This is why maintainability is treated as a first-class quality attribute.

2.2 Waterfall Model

Definition

The Waterfall model is a linear, sequential process in which each phase must be completed and approved before the next begins. There is no overlap and no going back.

Characteristics

AdvantagesDisadvantages
Simple to understand and manageCannot accommodate changing requirements
Clear milestones and deliverablesWorking software appears very late
Good for stable, well-understood requirementsHigh cost of late defect discovery
Easy to document and auditCustomer sees the product only near the end

Best suited for: government contracts, defence systems, regulatory/medical software, and small projects with genuinely frozen specifications.

2.3 V-Model (Verification and Validation Model)

The V-Model is an extension of Waterfall in which each development phase has a corresponding testing phase, drawn as the two arms of a "V".

Development Phase (left arm)Matching Test Phase (right arm)
Requirements analysisAcceptance testing
System designSystem testing
Architecture / high-level designIntegration testing
Detailed designUnit testing
Coding— (bottom of the V) —

Key idea: test cases are written during the corresponding design phase, not after coding. This forces early thinking about verification and catches requirement defects while they are still cheap to fix.

AdvantagesDisadvantages
Early test planningStill rigid; no support for iterative change
High discipline; clear traceabilityExpensive if requirements evolve
Defects caught earlier than in WaterfallNo working software until late in the project

2.4 Incremental Model

The product is divided into increments, each delivering a usable slice of functionality. Increment 1 might deliver login and user management; increment 2 adds the product catalogue; increment 3 adds payments.

Advantage: early return on investment and reduced risk. Disadvantage: requires a stable high-level architecture before increment 1, otherwise integration becomes chaotic.

2.5 Iterative Model

Instead of adding new features each cycle, the iterative model refines the whole system in successive cycles. Cycle 1 is a rough complete system; cycle 2 improves it; cycle 3 polishes it.

AspectIncrementalIterative
What growsFunctionality (breadth)Quality/refinement (depth)
Each cycle deliversNew featuresA better version of existing features
AnalogyPainting a wall section by sectionSculpting a statue through repeated passes

In practice, modern Agile methods combine both: increments add features while iterations refine them.

II. Software Development Life Cycle Models (continued)

2.6 Spiral Model

Definition

The Spiral model, proposed by Barry Boehm (1986), is a risk-driven, iterative model in which each loop of the spiral passes through four quadrants: determine objectives, identify and resolve risks, develop and verify, and plan the next iteration.

QuadrantActivity
1. Determine objectivesDefine goals, alternatives and constraints for this cycle
2. Identify & resolve risksBuild prototypes, run simulations, evaluate alternatives
3. Develop & verifyDesign, code, test the current version
4. Plan next iterationReview with the customer; plan the following spiral

The radius of the spiral represents cumulative cost; the angular position indicates progress within the current cycle.

Risk Exposure \[ RE = P(UO) \times L(UO) \]

where \(P(UO)\) = probability of an unsatisfactory outcome and \(L(UO)\) = loss to the parties if the outcome is unsatisfactory.

AdvantagesDisadvantages
Explicit risk management at every cycleComplex to manage; requires risk expertise
Accommodates changes wellExpensive — prototyping at every loop
Suitable for large, high-risk projectsNot cost-effective for small projects
Early customer involvementNo clear milestone for project completion

Best suited for: large, mission-critical, high-budget projects with significant technical or market uncertainty.

2.7 Prototype Model

A throwaway or evolutionary prototype is built early to clarify requirements that the customer cannot articulate in the abstract. The prototype is not the product — it exists to elicit feedback.

Risk: customers may mistake the prototype for a finished product and expect the same speed, ignoring the fact that it lacks error handling, security and scalability.

2.8 Agile Model and Scrum

Definition — Agile

Agile is an iterative and incremental approach that delivers working software in short cycles, welcomes changing requirements, and relies on close collaboration between the development team and the customer.

The Agile Manifesto — Four Values

  1. Individuals and interactions over processes and tools.
  2. Working software over comprehensive documentation.
  3. Customer collaboration over contract negotiation.
  4. Responding to change over following a plan.

(Items on the right still have value — the manifesto simply prioritises the left.)

Twelve Agile Principles (condensed)

Scrum Framework

ElementDescription
Roles
Product OwnerOwns the product backlog; prioritises features by business value
Scrum MasterFacilitates ceremonies; removes blockers; coaches the team
Development TeamCross-functional, self-organising, typically 5–9 members
Artifacts
Product BacklogPrioritised list of everything the product needs
Sprint BacklogSubset selected for the current sprint, with tasks
IncrementThe potentially shippable product at the end of a sprint
Ceremonies
Sprint PlanningTeam selects backlog items and defines the sprint goal (≈2–4 h for a 2-week sprint)
Daily Stand-up15-minute sync: what I did, what I will do, blockers
Sprint ReviewDemonstrate the increment to stakeholders; gather feedback
Sprint RetrospectiveTeam reflects on process: what went well, what to improve
Velocity and Release Forecasting \[ \text{Velocity} = \frac{\text{Story Points Completed}}{\text{Sprint}} \] \[ \text{Sprints Remaining} = \frac{\text{Remaining Backlog Points}}{\text{Average Velocity}} \]
Example 3 — Release Forecasting from Velocity

Problem: A team's velocity over the last three sprints was 24, 28 and 26 story points. The remaining product backlog totals 195 points. How many sprints are required, and when is the release?

Solution:

\[ \text{Average Velocity} = \frac{24 + 28 + 26}{3} = \frac{78}{3} = 26 \text{ points/sprint} \]

\[ \text{Sprints Remaining} = \frac{195}{26} = 7.5 \rightarrow 8 \text{ sprints} \]

With two-week sprints, the release is approximately \(8 \times 2 = 16\) weeks away.

Engineering note: always round up and add a buffer of one sprint for integration, hardening and documentation. A more honest estimate is 9 sprints (18 weeks).

2.9 DevOps and CI/CD

Definition — DevOps

DevOps is a cultural and technical movement that unifies software development (Dev) and IT operations (Ops) so that software can be built, tested and released rapidly, reliably and repeatedly.

PracticeMeaningBenefit
Continuous Integration (CI)Every commit triggers automated build and testDefects detected within minutes
Continuous Delivery (CD)Every passing build is deployable to productionRelease readiness at any time
Continuous DeploymentEvery passing build is deployed automaticallyVery short lead time to users
Infrastructure as Code (IaC)Servers defined in version-controlled files (Terraform, Ansible)Reproducible environments
Monitoring & ObservabilityMetrics, logs, traces (Prometheus, Grafana, ELK)Fast detection and diagnosis
Blue-Green / Canary DeploymentTwo identical environments; traffic shifted graduallyZero-downtime releases and instant rollback
# Typical CI pipeline (GitHub Actions)
name: ci
on: [push, pull_request]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: '20' }
      - run: npm ci
      - run: npm run lint
      - run: npm test -- --coverage
      - run: npm run build

Any failing step blocks the merge — this is what makes CI a genuine quality gate rather than a formality.

II. SDLC Models — Comparison (continued)

2.10 Comparison of SDLC Models

ModelNatureChange HandlingCustomer InvolvementRisk LevelBest For
WaterfallLinear, sequentialVery poorStart and end onlyHighFrozen, well-understood requirements
V-ModelLinear with parallel test designVery poorStart and endMediumSafety-critical, verifiable systems
IncrementalIterative in breadthModeratePer incrementMediumLarge systems with clear modules
IterativeIterative in depthGoodPer iterationMediumEvolving products
SpiralRisk-driven spiralExcellentEvery cycleLow (managed)Large, high-risk, high-budget projects
PrototypePrototype-firstExcellentContinuousMediumUnclear requirements, UI-heavy products
Agile / ScrumIterative + incrementalExcellentContinuous (PO)LowEvolving requirements, fast delivery
DevOpsContinuous flowExcellentVia product metricsLowCloud-native, high release frequency

2.11 Choosing an SDLC Model

SituationRecommended ModelReason
Requirements are stable and legally frozenWaterfall / V-ModelChange cost is acceptable; documentation is mandatory
Requirements are unclear and customer cannot articulate themPrototypeFeedback is needed before committing
Large project with technical uncertaintySpiralExplicit risk resolution each cycle
Start-up product with a fast-changing marketAgile / ScrumContinuous reprioritisation
Mature product needing many releases per dayDevOps / CI-CDAutomation removes the release bottleneck
Safety-critical embedded software (medical, aerospace)V-Model + formal methodsTraceability and verifiability are mandatory
Example 4 — Selecting a Model for a Hospital Management System

Context: A 400-bed hospital requires a system covering patient registration, appointments, billing, pharmacy, lab reports and insurance claims. The project has a fixed 18-month timeline, a fixed budget, and heavy regulatory (medical-records) requirements. The hospital's process is well documented.

Analysis:

Recommendation: An incremental delivery with V-Model discipline inside each increment. This satisfies the documentation/traceability requirements while allowing the hospital to start using the registration module months before the full system is ready.

Example 5 — Risk Exposure Calculation (Spiral Model)

Problem: A team must decide whether to build a third-party payment integration in-house or to buy a licensed gateway. Two unsatisfactory outcomes are possible: (i) the in-house build fails late — probability 0.25, loss ₹40,00,000; (ii) the licensed gateway is discontinued — probability 0.10, loss ₹15,00,000.

Solution:

\[ RE_{\text{in-house}} = 0.25 \times 40{,}00{,}000 = ₹10{,}00{,}000 \]

\[ RE_{\text{licensed}} = 0.10 \times 15{,}00{,}000 = ₹1{,}50{,}000 \]

Decision: The licensed gateway has substantially lower risk exposure. The spiral model would direct the team to build a prototype of the in-house option only if the strategic value (data ownership, cost at scale) outweighed the additional ₹8,50,000 of expected risk.

Common mistake

Confusing incremental with iterative. Incremental adds new features in each cycle; iterative refines the same features. Agile uses both: each sprint delivers an increment, and successive sprints also refine earlier work through refactoring.

2.12 Requirement Engineering — A Closer Look

ActivityPurposeTechnique
ElicitationDiscover what stakeholders actually needInterviews, questionnaires, observation, brainstorming
AnalysisResolve conflicts and prioritiseMoSCoW (Must/Should/Could/Won't), use cases
SpecificationDocument requirements preciselySRS, user stories, acceptance criteria
ValidationConfirm requirements are correct and completeReviews, prototypes, traceability matrix
ManagementControl changes to requirementsChange control board, versioned backlog

Functional vs Non-Functional Requirements

AspectFunctional RequirementNon-Functional Requirement
DefinesWhat the system doesHow well the system does it
Example"The system shall allow a user to reset the password via email""The password reset email shall arrive within 30 seconds"
VerificationFunctional testingPerformance, load and security testing
Typical categoriesFeatures, workflows, business rulesPerformance, security, usability, reliability, portability
Example 6 — Writing a User Story with Acceptance Criteria

User story format: As a <role>, I want <capability> so that <benefit>.

Story: "As a registered student, I want to reset my password via a one-time link sent to my registered email, so that I can regain access without contacting the administrator."

Acceptance criteria (Given–When–Then):

Each criterion is directly testable — this is what separates a well-written story from a vague wish.

III. Version Control Systems — Concepts

3.1 Definition and Need

Definition — Version Control System

A Version Control System (VCS) is a tool that records changes to a set of files over time, allowing specific versions to be recalled, compared and restored, and enabling multiple people to collaborate on the same codebase without overwriting each other's work.

Why Version Control is Essential

The Antipattern VCS Eliminates

project_final.zip
project_final_v2.zip
project_final_v2_ACTUAL.zip
project_final_v2_ACTUAL_working.zip
project_final_v2_ACTUAL_working_DONT_DELETE.zip

Manual versioning by filename is ambiguous, space-wasting and merge-hostile. A VCS replaces it with a structured, queryable history.

3.2 Types of Version Control Systems

TypeArchitectureHow it WorksAdvantagesDisadvantagesExamples
Local VCSSingle machineA local database stores file versionsSimple; no network neededNo collaboration; a disk failure loses everythingRCS, SCCS
Centralised VCSClient–serverOne central server holds the repository; clients check out filesSingle source of truth; simpler access controlServer is a single point of failure; limited offline work; slow branchingSVN, CVS, Perforce
Distributed VCSPeer-to-peer with remotesEvery clone contains the full history; remotes are used for synchronisationOffline work; fast branching and merging; no single point of failureLarger disk usage; steeper learning curveGit, Mercurial
Key insight — Git stores snapshots, not differences

Most people assume a VCS stores the deltas (differences) between versions. Git actually stores a complete snapshot of the project at each commit, but only for files that changed — unchanged files are referenced rather than duplicated. This is why Git operations like branching and checkout are almost instantaneous.

3.3 Core Vocabulary

TermMeaning
Repository (repo)The project directory tracked by Git, including the hidden .git folder that holds all history
Working directoryThe files currently checked out and being edited
Staging area (index)A holding area where changes are prepared before being committed
CommitAn immutable snapshot of the staged changes, identified by a SHA-1 hash
HEADA pointer to the current commit (usually the tip of the checked-out branch)
BranchA movable pointer to a commit; an independent line of development
TagA fixed, named pointer to a specific commit, used for releases (e.g. v1.0.0)
MergeCombining the changes from one branch into another
RebaseReplaying commits from one branch onto a new base, producing a linear history
RemoteA hosted copy of the repository (GitHub, GitLab, Bitbucket)
CloneA complete local copy of a remote repository, including all history
ForkA server-side copy of another user's repository into your own account
Pull Request (PR) / Merge RequestA request to merge a branch, providing a review and discussion interface
Merge conflictAn overlap Git cannot resolve automatically; requires human decision
.gitignoreA file listing patterns Git should not track (build artefacts, secrets, dependencies)
Detached HEADHEAD points directly to a commit rather than to a branch

3.4 The Three Trees of Git

TreeContentsCommand that Moves Data Here
Working DirectoryFiles you are editinggit checkout / git switch
Staging Area (Index)Changes marked for the next commitgit add
Repository (HEAD)Committed snapshotsgit commit
Working Directory  --git add-->  Staging Area  --git commit-->  Repository
      ^                                                                 |
      |______________________ git checkout / switch ___________________|

Why a staging area? It lets you commit a coherent subset of your changes. If you fixed a bug and simultaneously started a new feature, you can stage and commit only the bug fix, keeping the feature work uncommitted.

3.5 Commit Anatomy

A commit object in Git contains:

Commit Identity \[ \text{commit\_hash} = \text{SHA-1}(\text{tree} \,\|\, \text{parent} \,\|\, \text{author} \,\|\, \text{timestamp} \,\|\, \text{message}) \]

Because the hash depends on the parent hash, the entire history forms a tamper-evident chain: changing any past commit changes every subsequent hash. This is the property that makes Git history cryptographically verifiable.

Example abbreviated hash: a3f9c21

3.6 Branching Strategies

StrategyStructureBest For
Feature BranchOne branch per feature, merged into main via PRSmall-to-medium teams
Git FlowLong-lived main, develop, release, hotfix, feature branchesProducts with scheduled releases and QA gates
GitHub FlowSingle main branch; short-lived feature branches deployed continuouslyWeb apps with continuous deployment
Trunk-BasedEveryone commits to main at least daily; feature flags hide incomplete workHigh-performing DevOps teams
Release BranchingEach version gets a maintained branch for patchesSoftware with multiple supported versions

3.7 Merge vs Rebase

AspectMergeRebase
History shapeNon-linear; preserves the true branch topologyLinear; commits replayed on the new base
Commit hashesOriginal commits preserved; a new merge commit is createdOriginal commits are rewritten with new hashes
Conflict resolutionResolved once in the merge commitMay need resolution for each replayed commit
Use on shared branchesSafeDangerous — rewriting public history breaks other clones
Typical useIntegrating a feature into mainCleaning up local commits before pushing
The golden rule of rebase

Never rebase a branch that others have already pulled. Rebasing rewrites commit hashes; collaborators' histories will diverge and produce duplicated or conflicting work. Rebase only your own unpushed commits.

Example 7 — Choosing Branching Strategy for Two Projects

Project A: A college fest registration website, built by 5 students over 6 weeks, deployed to a shared host weekly.

Recommendation: GitHub Flow. One main branch that is always deployable, short-lived feature branches (feature/registration-form), and a pull request with at least one reviewer before merging. Weekly deploys make release branches unnecessary overhead.

Project B: A desktop accounting package with quarterly versioned releases (v4.1, v4.2) that customers install, and which must be patched for older versions.

Recommendation: Git Flow with release branching. develop accumulates features; a release/4.2 branch is cut for stabilisation and QA; main holds released versions; hotfix/4.1.3 branches patch older supported versions. The multi-version support requirement makes long-lived branches valuable.

IV. Git — Commands, Workflows and Branching

4.1 Configuration and Repository Creation

# One-time global identity setup
git config --global user.name  "Aarav Sharma"
git config --global user.email "aarav@example.com"
git config --global init.defaultBranch main
git config --global core.editor "code --wait"

# Inspect current configuration
git config --list

# Create a new repository in the current directory
git init

# Copy an existing remote repository
git clone https://github.com/user/project.git
git clone https://github.com/user/project.git my-folder   # custom folder name
git clone --depth 1 https://github.com/user/project.git   # shallow clone (latest only)

4.2 The Basic Daily Cycle

git status                     # what has changed?
git diff                       # unstaged line-by-line changes
git diff --staged              # staged changes only

git add index.html             # stage one file
git add src/                   # stage a directory
git add -p                     # stage changes hunk by hunk (interactive)

git commit -m "Add responsive navbar with mobile menu"
git commit                     # opens the editor for a longer message

git log --oneline --graph --decorate --all
git show a3f9c21               # inspect a specific commit
Writing good commit messages

Use the imperative mood in the subject line, keep it under 50 characters, and explain why in the body if the change is non-obvious.

Good: Fix session expiry causing logout on refresh
Bad: update, fixes, asdfgh, final changes

A conventional-commit prefix improves automation: feat:, fix:, docs:, refactor:, test:, chore:.

4.3 Branching and Merging

git branch                          # list local branches
git branch -a                       # list local + remote branches
git branch feature/login            # create a branch
git switch feature/login            # move to it (modern)
git checkout feature/login          # equivalent older command
git switch -c feature/login         # create and switch in one step

# ... make changes, add, commit ...

git switch main
git merge feature/login             # fast-forward if possible
git merge --no-ff feature/login     # force a merge commit (preserves branch history)

git branch -d feature/login         # delete after merge
git branch -D feature/login         # force delete unmerged branch

git push origin --delete feature/login   # delete the remote branch

4.4 Working with Remotes

git remote -v                                  # list remotes
git remote add origin https://github.com/u/p.git
git remote set-url origin git@github.com:u/p.git

git fetch origin                # download changes, do NOT modify working dir
git pull origin main            # fetch + merge
git pull --rebase origin main   # fetch + rebase (linear history)

git push -u origin feature/login   # first push of a new branch
git push                            # subsequent pushes
git push --tags                     # push tags
fetch vs pull — the distinction that matters

git fetch downloads new commits into your local remote-tracking branches but leaves your working directory untouched. git pull is shorthand for fetch followed by merge (or rebase). When you want to inspect incoming changes before integrating them, use fetch followed by git log origin/main and git diff main origin/main.

4.5 Undoing Things

GoalCommandEffect on History
Discard unstaged changes in a filegit restore file.txtNo change — working dir only
Unstage a file (keep the edits)git restore --staged file.txtNo change
Amend the last commit messagegit commit --amend -m "new msg"Rewrites the last commit
Undo the last commit, keep changes stagedgit reset --soft HEAD~1Rewrites local history
Undo the last commit, keep changes unstagedgit reset HEAD~1Rewrites local history
Undo the last commit and discard changesgit reset --hard HEAD~1Destroys work
Undo a pushed commit safelygit revert a3f9c21Adds a new inverse commit — safe on shared branches
Save work temporarilygit stash / git stash popNo change to history
Never use reset --hard on a shared branch

git reset --hard rewrites history and discards uncommitted work permanently. On a shared branch, use git revert instead — it creates a new commit that undoes the change while preserving the record that the original commit existed.

Example 8 — Complete Feature Branch Workflow
# 1. Start from an up-to-date main branch
git switch main
git pull origin main

# 2. Create the feature branch
git switch -c feature/password-reset

# 3. Implement the feature
#    ... edit auth/reset.js, tests/reset.test.js ...

# 4. Review what changed before staging
git status
git diff

# 5. Stage and commit in logical units
git add auth/reset.js
git commit -m "feat: add password reset token generation"

git add tests/reset.test.js
git commit -m "test: cover reset token expiry and reuse"

# 6. Sync with main before opening a PR
git fetch origin
git rebase origin/main          # resolve conflicts now, not at merge time

# 7. Push the branch
git push -u origin feature/password-reset

# 8. Open a Pull Request on GitHub, request one reviewer,
#    wait for CI to pass, then merge (squash or rebase-and-merge)

# 9. Clean up locally
git switch main
git pull origin main
git branch -d feature/password-reset

Why this order matters: rebasing onto the latest main before opening the PR means reviewers see a clean, conflict-free diff, and CI runs against the code as it will actually be merged.

Example 9 — Resolving a Merge Conflict Step by Step

Situation: Two developers modify the same configuration line. On merge, Git cannot decide and inserts conflict markers.

$ git merge feature/timeout
Auto-merging config/settings.py
CONFLICT (content): Merge conflict in config/settings.py
Automatic merge failed; fix conflicts and then commit the result.

Content of the conflicted file:

<<<<<<< HEAD
SESSION_TIMEOUT_SECONDS = 1800
=======
SESSION_TIMEOUT_SECONDS = 3600
>>>>>>> feature/timeout

Resolution steps:

  1. Open the file and understand both intentions: the main branch wanted 30 minutes; the feature branch wanted 60 minutes for a security-hardened session policy.
  2. Decide the correct value. Suppose the security review concluded 45 minutes is the agreed policy.
  3. Replace the entire conflict block with the decided line: SESSION_TIMEOUT_SECONDS = 2700.
  4. Remove all marker lines (<<<<<<<, =======, >>>>>>>).
  5. Verify nothing else broke: git diff, then run the test suite.
  6. Stage and commit: git add config/settings.py then git commit (Git pre-fills the merge message).

Key insight: a merge conflict is not an error. It is Git correctly refusing to guess at a semantic decision that only a human can make.

IV. Git — Advanced Concepts (continued)

4.6 .gitignore — What Not to Track

# Dependencies
node_modules/
venv/
__pycache__/

# Build output
dist/
build/
*.class
*.pyc

# Environment and secrets
.env
.env.local
*.pem
config/secrets.yml

# Editor and OS files
.vscode/
.idea/
.DS_Store
Thumbs.db

# Logs
*.log
logs/
Critical security rule

Never commit secrets. API keys, database passwords, private keys and tokens must never enter version control. Once a secret is committed, it remains in the repository history forever — even if you delete the file in a later commit. If a secret is exposed: (1) rotate it immediately, (2) purge it from history with git filter-repo or the BFG tool, (3) force-push and inform collaborators.

4.7 Tags and Releases

git tag v1.0.0                              # lightweight tag on HEAD
git tag -a v1.0.0 -m "First stable release" # annotated tag (recommended)
git tag                                     # list all tags
git show v1.0.0                             # inspect a tag
git push origin v1.0.0                      # push a single tag
git push --tags                             # push all tags
git tag -d v1.0.0                           # delete a local tag
git push origin --delete v1.0.0             # delete a remote tag

Semantic versioning convention: MAJOR.MINOR.PATCH — increment MAJOR for breaking changes, MINOR for backwards-compatible features, PATCH for backwards-compatible bug fixes.

4.8 Stashing

git stash                     # save current changes and clean the working dir
git stash push -m "WIP navbar"  # named stash
git stash list                # list stashes
git stash apply               # reapply the latest stash (keep it in the list)
git stash pop                 # reapply and remove from the list
git stash drop                # delete the latest stash
git stash branch fix-branch   # create a branch from a stash

Use case: You are mid-feature when an urgent production bug arrives. You stash the unfinished work, switch to main, fix the bug, push, then return and git stash pop to resume exactly where you left off.

4.9 Interactive Rebase — Cleaning Local History

git rebase -i HEAD~4

This opens an editor listing the last four commits with an action keyword in front of each:

KeywordAction
pickKeep the commit as is
rewordKeep the changes but edit the commit message
editPause to amend the commit content
squashCombine into the previous commit, merging messages
fixupCombine into the previous commit, discarding this message
dropDelete the commit entirely

Typical use: turning five messy local commits ("wip", "fix typo", "oops", "more changes", "final") into one clean, reviewable commit before pushing.

4.10 Git Internals — The Object Model

Object TypeStoresAnalogy
blobFile contents (no name, no metadata)A file's data
treeA directory listing: names, modes, and hashes of blobs and subtreesA folder
commitA pointer to one tree plus parent commit(s), author, messageA snapshot with a label
tag (annotated)A pointer to a commit with a message and taggerA named bookmark
git cat-file -t a3f9c21    # show object type
git cat-file -p a3f9c21    # pretty-print object contents
git rev-parse HEAD         # resolve HEAD to a full SHA
git reflog                 # every position HEAD has been in (a safety net!)

git reflog is the recovery tool of last resort: even after a reset --hard, the previous commits are still in the reflog for around 90 days and can be restored with git reset --hard HEAD@{2}.

Example 10 — Recovering from an Accidental Hard Reset

Situation: A developer runs git reset --hard HEAD~3 intending to undo three local commits, then realises that the second of those commits contained two days of work that was never pushed.

Recovery procedure:

# 1. Inspect where HEAD has been
git reflog
#    a3f9c21 HEAD@{0}: reset: moving to HEAD~3
#    7b2e110 HEAD@{1}: commit: feat: add payment retry logic   <-- the lost work
#    91acd44 HEAD@{2}: commit: feat: integrate Razorpay SDK
#    55f1b02 HEAD@{3}: commit: chore: update dependencies

# 2. Restore the lost commit
git reset --hard 7b2e110

# 3. Verify
git log --oneline -5
git status

Lesson: Git rarely loses committed work. Only uncommitted changes are truly unrecoverable. The reflog is your safety net — and this is precisely why committing frequently in small increments is a defensive practice, not merely a stylistic preference.

4.11 Collaboration Workflow Summary

StageCommandPurpose
Startgit switch main && git pullBegin from the latest integration state
Branchgit switch -c feature/xIsolate work
Developgit addgit commitSmall, logical commits
Syncgit fetchgit rebase origin/mainIntegrate upstream changes early
Publishgit push -u origin feature/xShare for review
ReviewOpen a Pull RequestPeer review + automated CI
IntegrateSquash/rebase merge into mainKeep the main history readable
Clean upDelete the branch locally and remotelyAvoid branch sprawl

V. Cyber Security Fundamentals — CIA, Threats and Malware

5.1 Definition and Scope

Definition — Cyber Security

Cyber security is the practice of protecting systems, networks, programs, devices and data from digital attack, damage or unauthorised access. Its purpose is to preserve the confidentiality, integrity and availability of information assets.

5.2 The CIA Triad

PillarMeaningControl MechanismsViolation Examples
ConfidentialityInformation is accessible only to authorised partiesEncryption (AES-256), access control lists, data classification, tokenisation, TLSData breach, credential theft, eavesdropping, insider leak
IntegrityData is accurate, complete and unalteredCryptographic hashing (SHA-256), digital signatures, checksums, write-once storage, audit logsMan-in-the-middle tampering, SQL injection altering records, ransomware encryption
AvailabilitySystems and data are accessible when requiredRedundancy, load balancing, DDoS mitigation, backups, disaster recovery, UPSDenial of Service, ransomware, hardware failure, accidental deletion

Extended Security Goals

GoalDefinitionMechanism
AuthenticationVerifying that an entity is who it claims to bePasswords, OTP, biometrics, certificates
AuthorisationDetermining what an authenticated entity may doRBAC, ACLs, policy engines
AccountabilityAttributing actions to a specific entityAudit logs, SIEM, non-repudiation
Non-repudiationPreventing denial of having performed an actionDigital signatures, timestamps, blockchain
PrivacyControlling the collection and use of personal dataData minimisation, consent, anonymisation
CIA Triad as a Design Constraint \[ \text{Security} = f(\text{Confidentiality},\ \text{Integrity},\ \text{Availability}) \]

Note the inherent tension: maximising confidentiality (heavy encryption, strict access control) can reduce availability and usability. Security engineering is the art of balancing these three competing objectives for a given risk profile.

5.3 The Threat Landscape

Definition — Threat, Vulnerability, Risk, Exploit

Threat: any potential cause of harm.
Vulnerability: a weakness that a threat can exploit.
Exploit: a technique or tool that takes advantage of a vulnerability.
Risk: the likelihood and impact of a threat exploiting a vulnerability.

Risk Quantification \[ \text{Risk} = \text{Threat} \times \text{Vulnerability} \times \text{Impact} \] \[ \text{SLE} = \text{Asset Value} \times \text{Exposure Factor} \qquad \text{ALE} = \text{SLE} \times \text{ARO} \]

SLE = Single Loss Expectancy; ARO = Annualised Rate of Occurrence; ALE = Annualised Loss Expectancy.

Threat Actors

ActorMotivationSophisticationTypical Target
Script KiddieCuriosity, bragging rightsLow — uses existing toolsAny unpatched system
HacktivistIdeology, publicityMediumGovernment, corporate websites
CybercriminalFinancial gainMedium–HighBanks, e-commerce, individuals
InsiderRevenge, money, negligenceLow–Medium (has access)Own organisation's data
Nation-State (APT)Espionage, sabotage, geopoliticsVery HighCritical infrastructure, defence, IP
CompetitorCommercial advantageMediumProprietary designs, customer lists

5.4 Malware Classification

TypeCharacteristicsSelf-Replicates?Needs a Host?Primary Impact
VirusAttaches to a legitimate file; executes when the host executesYesYesFile corruption, system instability
WormStandalone program that spreads across networks autonomouslyYesNoNetwork flooding, bandwidth exhaustion
Trojan HorseDisguised as useful software; performs hidden malicious actionsNoNoBackdoor access, data theft
RansomwareEncrypts files and demands payment for the decryption keySometimesNoTotal data unavailability, extortion
SpywareSecretly monitors user activity and transmits itNoNoPrivacy loss, credential theft
KeyloggerRecords every keystroke, capturing passwords and messagesNoNoCredential compromise
AdwareForces unwanted advertisements; may hijack the browserSometimesNoAnnoyance, degraded performance
RootkitHides malicious processes and files at kernel or firmware levelNoNoPersistent, hard-to-detect compromise
Botnet AgentTurns the host into a remotely controlled "zombie"YesNoParticipation in DDoS, spam campaigns
Logic BombTriggers malicious code on a specific condition or dateNoYesInsider-triggered destruction
Fileless MalwareLives in memory and uses legitimate system tools (PowerShell, WMI)NoNoEvades file-based antivirus
Example 11 — Identifying the Malware Type from Symptoms

Scenario A: A company's file server shows all documents renamed with a .locked extension, and a text file on the desktop demands payment in Bitcoin within 72 hours.

Diagnosis: Ransomware. Immediate response: isolate the server from the network (prevent spread), do not pay, restore from the most recent offline backup, report to the CERT-In, and conduct a root-cause analysis of the initial access vector (likely a phishing email or an exposed RDP port).

Scenario B: A university network slows to a crawl. Log analysis shows thousands of outbound connections from lab machines to an unknown external IP, each sending small packets every few seconds.

Diagnosis: Botnet agent / worm propagation. The lab machines have been recruited into a botnet and are beaconing to a command-and-control server. Immediate response: block the C2 IP at the firewall, isolate affected hosts, run full endpoint scans, patch the vulnerability that allowed initial infection.

Scenario C: A free "PDF converter" downloaded from a third-party site installs silently, adds browser toolbars, and opens a hidden reverse shell to an external host.

Diagnosis: Trojan horse (with adware and backdoor components). Immediate response: remove the software, scan with a reputable anti-malware tool, change any credentials entered while it was installed, and enforce a policy restricting software installation to approved sources.

5.5 Attack Techniques

AttackMechanismTarget of CIAMitigation
PhishingDeceptive email/message luring the victim to a fake site or malicious attachmentConfidentialityEmail filtering, user training, MFA, DMARC/SPF/DKIM
Spear PhishingHighly targeted phishing using researched personal detailsConfidentialityVerification procedures for unusual requests, MFA
Vishing / SmishingPhishing via voice call / SMSConfidentialityNever share OTPs; call back on a known number
PretextingInventing a scenario to extract informationConfidentialityIdentity verification protocols
BaitingLeaving infected USB drives in public placesConfidentiality / IntegrityDisable autorun; policy against unknown media
TailgatingFollowing an authorised person into a restricted areaConfidentialityAccess cards, mantraps, security awareness
Man-in-the-MiddleIntercepting and possibly altering communication between two partiesConfidentiality, IntegrityTLS with certificate pinning, VPN, HSTS
Denial of Service (DoS/DDoS)Flooding a service to exhaust resourcesAvailabilityRate limiting, CDN, scrubbing centres, autoscaling
SQL InjectionInjecting SQL via unsanitised input to read or modify the databaseConfidentiality, IntegrityParameterised queries, ORM, input validation, least-privilege DB accounts
Cross-Site Scripting (XSS)Injecting script that executes in another user's browserConfidentialityOutput encoding, Content Security Policy, HttpOnly cookies
Cross-Site Request Forgery (CSRF)Forcing an authenticated user's browser to perform an unwanted actionIntegrityAnti-CSRF tokens, SameSite cookies
Privilege EscalationGaining higher permissions than grantedAll threePatching, least privilege, sandboxing
Zero-Day ExploitAttacking a vulnerability unknown to the vendorAll threeDefence in depth, EDR behavioural detection, network segmentation
Password Attack (Brute Force / Credential Stuffing)Guessing or replaying credentialsConfidentialityMFA, account lockout, breach monitoring, unique passwords
Insider ThreatMalicious or negligent action by an authorised userAll threeLeast privilege, DLP, audit logging, separation of duties

Anatomy of a Phishing Email — Red Flags

Reporting a suspected phishing email

Do not click, do not forward it to colleagues, do not reply. Report it to the IT/security team using the official reporting channel, then delete it. If you already clicked and entered credentials: change the password immediately from a different device, enable MFA, and inform the security team — speed matters far more than embarrassment.

5.6 Defence in Depth

No single control stops every attack. Defence in depth layers multiple independent controls so that the failure of one does not compromise the whole system.

LayerControls
PhysicalLocks, access cards, CCTV, locked server racks
NetworkFirewalls, VLAN segmentation, IDS/IPS, VPN, zero-trust network access
HostEndpoint protection (EDR), host firewall, patch management, disk encryption
ApplicationSecure coding, input validation, WAF, dependency scanning
DataEncryption at rest and in transit, tokenisation, DLP, backups
IdentityMFA, least privilege, privileged access management, SSO
HumanSecurity awareness training, phishing simulations, clear policies
ProcessIncident response plan, business continuity, disaster recovery drills

VI. Firewalls and Network Defence

6.1 Definition and Purpose

Definition — Firewall

A firewall is a network security device — implemented in hardware, software or both — that monitors and controls incoming and outgoing network traffic based on a defined set of security rules. It establishes a barrier between a trusted internal network and an untrusted external network such as the Internet.

6.2 Generations of Firewall Technology

GenerationTypeOperating LayerHow It WorksLimitations
1stPacket FilteringNetwork / Transport (L3–L4)Inspects source IP, destination IP, port and protocol against a static rule list (ACL)Stateless — each packet judged in isolation; cannot inspect payload; vulnerable to IP spoofing
2ndStateful InspectionNetwork / Transport (L3–L4)Maintains a connection state table (NEW, ESTABLISHED, RELATED, INVALID) and allows return traffic for established sessionsMemory-intensive for large tables; still cannot inspect encrypted payload
3rdApplication / ProxyApplication (L7)Terminates the client connection, inspects the full request, and creates a new connection to the serverSlower; requires per-application configuration; can break non-standard protocols
4thNext-Generation Firewall (NGFW)L3–L7Deep packet inspection, application awareness, integrated IPS, TLS inspection, user identity awareness, threat intelligence feedsHigher cost; complex policy management; performance overhead
Cloud Firewall / WAFL7 (HTTP/HTTPS)Filters web traffic for SQL injection, XSS, bot traffic, and OWASP Top 10 attacksOnly protects traffic that passes through it; cannot protect non-web protocols

Deployment Classifications

TypePlacementProtectsExample
Host-based (personal)Installed on a single machineThat host onlyWindows Defender Firewall, ufw, iptables
Network-basedAt the network perimeter or between segmentsAn entire network or subnetCisco ASA, Palo Alto PA-series, pfSense
Cloud-nativeWithin a cloud provider's infrastructureCloud workloads and VPCsAWS Security Groups, Azure NSG
Virtual applianceAs a VM in a virtualised environmentVirtual network segmentsFortiGate VM, OPNsense VM

6.3 Firewall Rule Anatomy and Default Policies

# Rule format:  ACTION  PROTO  SRC           DST          PORT   COMMENT

ALLOW   TCP    any           10.0.0.5     443    Allow HTTPS to the public web server
ALLOW   TCP    10.0.1.0/24   10.0.0.5     22     Allow SSH only from the admin subnet
ALLOW   TCP    any           10.0.0.7     25,587 Allow SMTP submission to the mail relay
DENY    TCP    any           10.0.0.5     3306   Block direct MySQL access from the Internet
DENY    ANY    any           any          any    Default deny — implicit final rule
PolicyBehaviourSecurity PostureUsability
Default deny (whitelist)Block everything not explicitly permittedStrong — recommended practiceRequires careful rule maintenance; new services break until allowed
Default allow (blacklist)Permit everything not explicitly blockedWeak — only as good as the block listConvenient but dangerous
Rule design principles
Example 12 — Writing a Firewall Rule Set for a Small Web Application

Requirements: A three-tier application — public web server (10.0.0.5), application server (10.0.1.10) and database (10.0.2.20). Admin access originates from the office subnet 192.168.10.0/24.

# ---- Perimeter firewall (Internet-facing) ----
ALLOW  TCP   any               10.0.0.5   80,443  Public HTTP/HTTPS to web tier
ALLOW  TCP   192.168.10.0/24   10.0.0.5   22      SSH from office only
DENY   TCP   any               10.0.0.5   22      Block SSH from the Internet
DENY   TCP   any               10.0.1.10  any     Web tier must never reach app tier directly
DENY   ANY   any               any        any     Default deny

# ---- Internal firewall (between tiers) ----
ALLOW  TCP   10.0.0.5          10.0.1.10  8080    Web tier → app tier on the app port
ALLOW  TCP   10.0.1.10         10.0.2.20  5432    App tier → PostgreSQL only
DENY   TCP   10.0.0.5          10.0.2.20  any     Web tier must never touch the database
DENY   TCP   192.168.10.0/24   10.0.2.20  5432    No direct admin DB access (use a bastion)
DENY   ANY   any               any        any     Default deny

Reasoning for each design decision:

6.4 Demilitarised Zone (DMZ)

Definition — DMZ

A DMZ (Demilitarised Zone) is a buffer sub-network that hosts public-facing services between two firewalls — an external firewall facing the Internet and an internal firewall facing the private LAN. It limits the damage if a public server is compromised.

ZoneContentsTypical Rules
Internet (untrusted)Everything externalOnly ports 80/443 reach the DMZ; nothing reaches the LAN directly
DMZ (semi-trusted)Web server, mail relay, reverse proxy, DNSMay query the internal database on one specific port; cannot initiate connections to the LAN otherwise
LAN (trusted)Workstations, internal servers, databaseMay be reached from the DMZ only on explicit, minimal ports

Design principle: if the web server in the DMZ is fully compromised, the attacker still faces the internal firewall. This converts a total breach into a contained incident.

6.5 Related Network Defence Technologies

TechnologyFunctionDistinguishing Feature
IDS (Intrusion Detection System)Monitors traffic and raises alerts on suspicious patternsPassive — detects but does not block
IPS (Intrusion Prevention System)Monitors and actively blocks malicious traffic inlineActive — sits in the traffic path; can drop packets
VPN (Virtual Private Network)Creates an encrypted tunnel over an untrusted networkProtects confidentiality and integrity in transit
NAT (Network Address Translation)Maps private IPs to a public IPIncidental privacy; not a security control by itself
Proxy serverIntermediary for client requestsCan filter content and cache responses
Network segmentation (VLAN)Splits a network into isolated logical segmentsLimits lateral movement after a compromise
SIEMAggregates logs from many sources for correlation and alertingCentral visibility for incident response
Zero Trust Architecture"Never trust, always verify" — every request is authenticated and authorisedReplaces perimeter-only security; assumes the network is hostile

6.6 Cryptographic Building Blocks

TechniqueKeysPurposeExampleSpeed
Symmetric encryptionOne shared keyConfidentiality of bulk dataAES-256, ChaCha20Very fast
Asymmetric encryptionPublic + private key pairKey exchange, digital signaturesRSA-2048, ECC (P-256), Ed25519Slow
Cryptographic hashingNo keyIntegrity verificationSHA-256, SHA-3, BLAKE3Fast
Keyed hash (HMAC)Shared secret keyMessage authenticationHMAC-SHA256Fast
Digital signaturePrivate key to sign, public to verifyAuthenticity and non-repudiationRSA-PSS, ECDSASlow

How HTTPS (TLS) Combines These

  1. The client connects and the server presents its certificate (containing its public key, signed by a trusted CA).
  2. The client validates the certificate chain against its trust store.
  3. Using asymmetric cryptography (ECDHE), both parties agree on a shared session key without transmitting it.
  4. All subsequent traffic is encrypted with fast symmetric encryption (AES-GCM).
  5. Each record carries an HMAC tag, guaranteeing integrity.

This hybrid design is why TLS is both secure and performant — asymmetric cryptography solves the key-distribution problem, and symmetric cryptography handles the bulk data.

Exam tip — comparing firewalls

When asked to compare firewall generations, always use these four parameters: (1) OSI layer inspected, (2) whether it is stateful, (3) whether it can inspect payload, (4) performance overhead. This structure reliably earns full marks.

VII. User Account Types, Privileges and Access Control

7.1 User Accounts

Definition — User Account

A user account is a digital identity within a system that associates a person or service with a set of credentials, permissions and resources. Every action performed on a multi-user system is attributable to an account.

7.2 Account Types

Account TypePrivilegesTypical UseRisk if Compromised
Administrator / Root / SuperuserFull control: install software, modify system configuration, manage all users, access all filesSystem administration only — never for daily workCritical — total system compromise
Standard / Regular UserRun applications, modify own files; cannot change system-wide settingsEveryday work for most usersModerate — limited to that user's data
GuestMinimal access, no persistent storage, often time-limitedVisitors, kiosks, public terminalsLow — restricted by design
Service / System AccountNon-interactive; permissions limited to what one specific service requiresWeb server, database daemon, backup agentModerate–High — often over-privileged in practice
Power User (legacy Windows)Between standard and administrator; can install some softwareLegacy compatibility requirementsModerate
Privileged / Elevated (sudo)Temporary elevation of a standard account for a specific commandAdministrative tasks on Linux/macOSHigh while elevated

Windows vs Linux Account Model

AspectWindowsLinux / Unix
Administrator accountAdministratorroot (UID 0)
Elevation mechanismUAC promptsudo, su
Standard userStandard UserRegular user (UID ≥ 1000)
Permission modelACLs (NTFS permissions)rwx bits + ACLs + ownership
Service accountsLocalSystem, NetworkService, LocalServicewww-data, postgres, nobody

7.3 Principle of Least Privilege (PoLP)

Definition — PoLP

Every user, program or process should be granted only the minimum privileges necessary to perform its intended function, and only for the minimum time required.

Why PoLP Matters

Practical Implementation of PoLP

PracticeImplementation
Separate admin from daily accountsTwo accounts per administrator: a standard account for email/browsing and a separate admin account for privileged tasks
Just-in-time elevationUse sudo with time-limited sessions rather than logging in as root
Service account scopingGrant the database service account rights only to the directories it needs, not to the whole filesystem
Regular access reviewsQuarterly attestation: managers confirm each team member still needs their access
Prompt revocationDisable accounts immediately on termination or role change
No shared accountsEvery account must map to one person for accountability

7.4 Access Control Models

ModelFull NameDecision BasisAdvantagesDisadvantagesExample
DACDiscretionary Access ControlThe resource owner decides who gets accessFlexible; intuitive; user autonomyOwner errors propagate; no central policy; vulnerable to trojan horsesUnix chmod/chown, Windows file permissions
MACMandatory Access ControlSystem-wide labels and clearance levels; users cannot overrideVery strong; enforced centrallyRigid; complex administration; high setup costSELinux, AppArmor, military MLS systems
RBACRole-Based Access ControlPermissions are attached to roles; users are assigned to rolesScalable; easy to audit; supports separation of dutiesRole explosion in large organisations; coarse granularityERP systems (HR Manager, Auditor, Developer roles)
ABACAttribute-Based Access ControlPolicy evaluated on attributes of user, resource, action and environmentVery fine-grained; context-aware; dynamicComplex policy authoring and testingZero-trust architectures, cloud IAM policies
RuBACRule-Based Access ControlFixed rules applied to all users (e.g. time-of-day restrictions)Simple for specific constraintsNot user-specific; limited flexibilityFirewall ACLs, campus network access hours

RBAC — Core Concepts

Example 13 — Designing RBAC for a University Department

Roles and permissions:

RoleView MarksEdit MarksPublish ResultsManage UsersExport Data
Student✔ (own)
Faculty✔ (own courses)✔ (own courses)✔ (own courses)
Exam Coordinator✔ (all)✔ (all)✔ (all)
Admin✔ (all)✔ (all)✔ (all)

Separation of duties: the Exam Coordinator can publish results but cannot manage user accounts; the Admin can manage accounts but results publication requires the Coordinator role — no single person can both alter marks and publish them undetected.

PoLP in practice: a Faculty member can edit only the courses they teach, not the entire department's records. If a Faculty account is compromised, the damage is confined to one semester's courses.

7.5 Authentication, Authorisation and Accounting (AAA)

ComponentQuestion AnsweredMechanisms
Authentication"Who are you?"Passwords, OTP, biometrics, smart cards, certificates, FIDO2/WebAuthn
Authorisation"What are you allowed to do?"RBAC, ACLs, policy engines, capability tokens, scopes
Accounting / Auditing"What did you actually do?"Audit logs, SIEM, session recording, immutable log storage

7.6 Multi-Factor Authentication (MFA)

Definition — MFA

Multi-Factor Authentication requires the user to present two or more authentication factors drawn from different categories. Using two passwords is not MFA — both factors belong to the same category ("something you know").

CategoryDescriptionExamplesWeaknesses
Something you knowKnowledge factorPassword, PIN, security questionPhishing, keylogging, credential stuffing, shoulder surfing
Something you havePossession factorOTP token, authenticator app, smart card, hardware key (YubiKey)SIM swapping (SMS OTP), device theft
Something you areInherence factorFingerprint, face ID, iris scan, voiceCannot be changed if compromised; spoofing attempts
Somewhere you areLocation factorGPS, IP range, network locationSpoofable; privacy concerns
Something you doBehaviour factorTyping rhythm, gait, mouse movement patternsLow accuracy alone; needs large training data
MFA MethodSecurity LevelNotes
SMS OTPLow–MediumVulnerable to SIM-swap and SS7 interception; better than nothing
Email OTPLow–MediumDepends on the security of the email account itself
Authenticator app (TOTP)HighCode generated locally every 30 s; not transmitted over the network
Push notification with number matchingHighDefeats MFA-fatigue attacks; requires approving the correct number
Hardware security key (FIDO2/WebAuthn)Very HighPhishing-resistant — cryptographically bound to the origin domain
Biometric + PINHighCombines inherence with knowledge; used on mobile devices
Why MFA matters

Microsoft's security research consistently reports that enabling MFA blocks the overwhelming majority (approximately 99%) of automated account-compromise attempts. It is the single highest-value security control available to an individual user, because it defeats credential stuffing and the reuse of breached passwords.

7.7 Password Strength and Policies

Password Search Space \[ N = C^{L} \]

\(C\) = size of the character set, \(L\) = password length, \(N\) = number of possible passwords.

Time to Exhaustive Search \[ T = \frac{N}{2 \cdot R} \]

\(R\) = guessing rate (guesses per second); dividing by 2 gives the expected time for a random search.

Character SetSize \(C\)Example
Lowercase letters26abcdefghijklmnopqrstuvwxyz
+ Uppercase52a–z, A–Z
+ Digits620–9 added
+ Common symbols94!@#$%^&*()_+-=[]{} etc.
Example 14 — Quantifying Password Strength

Password A: summer2024 — 10 characters from a set of lowercase + digits (\(C = 36\)).

\[ N_A = 36^{10} \approx 3.66 \times 10^{15} \]

At \(R = 10^{10}\) guesses/second (a modern GPU rig):

\[ T_A = \frac{3.66 \times 10^{15}}{2 \times 10^{10}} \approx 183{,}000 \text{ s} \approx 2.1 \text{ days} \]

Password B: Tr0ub4dor&3 — 11 characters from the full set (\(C = 94\)).

\[ N_B = 94^{11} \approx 5.13 \times 10^{21} \]

\[ T_B = \frac{5.13 \times 10^{21}}{2 \times 10^{10}} \approx 2.56 \times 10^{11} \text{ s} \approx 8{,}100 \text{ years} \]

Password C: correct-horse-battery-staple — 28 characters, lowercase + hyphens (\(C = 27\)).

\[ N_C = 27^{28} \approx 1.2 \times 10^{40} \]

Conclusion: Length dominates complexity. Password C is a passphrase — easy for a human to remember, but astronomically harder to brute-force than a short cryptic password. The modern recommendation (NIST SP 800-63B) prioritises length, discourages forced complexity rules and periodic rotation, and mandates screening against known-breached password lists.

Weak PracticeWhy It FailsBetter Practice
Reusing passwords across sitesOne breach compromises every account (credential stuffing)Unique password for every site, stored in a password manager
Short passwords with symbol substitutionDictionary and rule-based attacks handle p@ssw0rd triviallyLong passphrase (4–6 random words)
Forced 90-day rotationLeads to predictable increments (Summer1!Summer2!)Rotate only on evidence of compromise
Security questions with public answersAnswers are discoverable via social mediaUse a random string stored in the password manager
Sharing passwords via chat or emailLeaves a permanent plaintext recordUse a password manager's sharing feature or a secret vault
Storing passwords in a spreadsheetUnencrypted, easy to exfiltrateUse a dedicated encrypted password manager
Password manager — the practical recommendation

A password manager solves the central tension: humans cannot memorise 100 unique strong passwords, but reusing one is unsafe. Store all unique passwords in an encrypted vault protected by one strong master passphrase plus MFA. The manager also detects phishing automatically, because it will not autofill a credential on a lookalike domain.

VIII. Safe Internet Practices

8.1 Concept

Definition — Safe Internet Practices

Safe internet practices are the habits, configurations and behaviours that individuals adopt to protect their devices, data, identity and privacy while using the Internet.

Security is not solely a technical problem. The overwhelming majority of successful breaches begin with a human action — clicking a link, reusing a password, ignoring an update, connecting to an untrusted network. Safe practices therefore provide the highest return on effort for an individual user.

8.2 Secure Browsing

PracticeWhy It Matters
Verify HTTPS (padlock icon) before entering credentialsEnsures traffic is encrypted with TLS and the certificate matches the domain
Check the full domain, not just the brand namepaypal.com.secure-login.ru is a subdomain of secure-login.ru, not of PayPal
Hover over links before clickingReveals the true destination in the status bar
Avoid clicking links in unsolicited emails or SMSNavigate directly by typing the known address instead
Use browser extensions sparinglyMalicious extensions can read every page you visit, including banking pages
Keep the browser updatedBrowsers patch critical vulnerabilities frequently
Use a DNS filtering serviceBlocks known-malicious domains before a connection is made
Log out of sensitive sessionsPrevents session hijacking on shared or stolen devices
Use incognito/private mode appropriatelyPrevents local history storage, but does not hide traffic from the network or ISP

8.3 Public Wi-Fi and Untrusted Networks

Risks of Open Wi-Fi

MitigationEffectivenessNotes
Use HTTPS everywhereHighProtects content, but metadata (which sites you visit) remains visible
Use a reputable VPNHighEncrypts all traffic to the VPN endpoint; hides traffic from the local network
Enable "Always use HTTPS" and DNS-over-HTTPSMedium–HighReduces plaintext exposure
Avoid banking and sensitive logins on public Wi-FiHighBehavioural control — the simplest and most reliable
Use your mobile hotspot insteadHighYour own carrier network is generally more trustworthy
Disable file sharing and auto-connectMediumPrevents accidental exposure on known network profiles
Forget the network when doneMediumPrevents automatic reconnection to a spoofed twin later
Free VPN caution

"Free" VPN services must monetise somehow, and the common business model is logging and selling user traffic data. Use only reputable paid providers with published, independently audited no-logs policies — or rely on your institution's VPN.

8.4 Updates and Patch Management

An unpatched system is a known-vulnerable system. Public exploit code for a published CVE often appears within days, so the window between disclosure and exploitation is short.

ComponentUpdate FrequencySetting
Operating systemMonthly (Patch Tuesday) + emergency patchesAutomatic updates enabled
BrowserEvery 4–6 weeksAuto-update; restart promptly when prompted
Antivirus / EDR signaturesMultiple times dailyAutomatic
Applications (Office, PDF readers, Java)As releasedUse a patch-management tool where possible
Router / IoT firmwareRarely — check quarterlyManual check; enable auto-update if supported
Mobile appsFrequentAuto-update over Wi-Fi
The 30-day rule

Any device that has not been patched in 30 days should be treated as compromised. Track patch status for your own devices in the same way a system administrator tracks a fleet — a simple calendar reminder is sufficient for personal use.

8.5 Backup Strategy — the 3-2-1 Rule

Definition — 3-2-1 Backup Rule

3 copies of the data, on 2 different media types, with 1 copy stored offsite (or offline).

ElementPurposeExample Implementation
3 copiesSurvives two simultaneous failuresOriginal + local backup + cloud backup
2 media typesProtects against media-specific failureInternal SSD + external HDD
1 offsite/offlineSurvives fire, theft, ransomware that encrypts network sharesCloud storage or a rotated external drive kept elsewhere

Additional principles:

8.6 Device and Account Hygiene

AreaPractice
Screen lockEnable auto-lock after 2–5 minutes; use a PIN/biometric
Disk encryptionEnable BitLocker (Windows), FileVault (macOS), LUKS (Linux) to protect a lost device
App permissionsReview camera, microphone, location and contacts access; revoke anything unnecessary
Account inventoryList all online accounts; delete dormant ones — they are unmonitored attack surface
Breach monitoringPeriodically check Have I Been Pwned; act on any reported exposure
Recovery optionsSet up a recovery email and phone; store backup codes securely offline
Session reviewPeriodically sign out of all devices to evict forgotten sessions
USB hygieneNever plug in found USB drives; disable autorun
Download sourcesInstall software only from official vendor sites or signed package repositories

8.7 Safe Social Media and Communication

Example 15 — Incident Response: A Student's Account is Compromised

Situation: A third-year student receives a notification that someone logged into their university email from an unrecognised city at 3 a.m.

Correct response sequence:

  1. Contain: from a different, trusted device, change the email password immediately.
  2. Revoke: sign out of all active sessions and remove any unfamiliar recovery email or phone number.
  3. Enable: turn on MFA using an authenticator app if it is not already active.
  4. Check: review mailbox rules and forwarding settings — attackers commonly add a hidden forwarding rule to keep receiving mail after a password change.
  5. Trace: review the login activity log to determine the entry point (a phishing link, a reused password from another breach, or a malicious browser extension).
  6. Contain downstream: change the password on any other account that used the same password, starting with banking and social media.
  7. Report: inform the university IT/security team so they can check for related compromise on other accounts.
  8. Learn: identify the root cause and remove it. If a phishing site captured the credentials, the same site may still be live and targeting classmates.

Preventive reflection: MFA alone would have blocked this. A password manager would have prevented the credential reuse that likely enabled it.

IX. Digital Footprint

9.1 Definition and Concept

Definition — Digital Footprint

A digital footprint (also called a digital shadow or electronic footprint) is the trail of data created by a person's activity on the Internet. It is the cumulative sum of all information about an individual that exists online, whether published deliberately or collected automatically.

Two properties make the digital footprint fundamentally different from a physical one:

9.2 Active vs Passive Digital Footprint

ParameterActive FootprintPassive Footprint
CreationDeliberately created by the userCollected automatically without conscious action
User awarenessHighLow — often entirely invisible
User controlHigh — the user decides what to publishLimited to browser and privacy settings
ExamplesSocial media posts, comments, photographs, blog articles, form submissions, reviews, uploaded videos, forum answersIP address logs, browser cookies, device fingerprint, browsing history, location pings, email tracking pixels, app analytics
Typical collectorsPublic audience, followers, search enginesAdvertisers, data brokers, analytics platforms, ISPs, websites
PersistenceUntil deleted; may survive in archivesOften retained indefinitely by third parties
Deletion difficultyModerate — delete from the platformVery hard — data is held by parties you cannot contact

9.3 Why the Digital Footprint Matters

DomainImpact
EmployabilityRecruiters routinely screen candidates online. Offensive posts, unprofessional photographs or evidence of dishonesty can eliminate an otherwise strong application before the interview stage.
Academic standingUniversities investigate plagiarism, harassment and misconduct based on online evidence. Disciplinary action can affect scholarships and placements.
Reputation and personal brandThe footprint is your online reputation, whether you manage it or not. A positive footprint — technical blogs, open-source contributions, project repositories — actively helps.
SecurityOversharing fuels social engineering. A posted birthdate, pet name or mother's maiden name can answer security questions and enable account recovery attacks.
PrivacyAggregated passive data enables detailed behavioural profiling by advertisers and data brokers.
Legal exposureOld posts can surface in legal proceedings, defamation claims or regulatory investigations.
FinancialInsurers, lenders and landlords increasingly check online presence.
Personal relationshipsContent visible to future partners, friends and family can resurface years later.
The screening reality

Multiple industry surveys consistently report that a large majority of recruiters research candidates on social media, and a significant fraction have rejected candidates based on what they found — most commonly: provocative content, information about drinking or drug use, poor communication skills, and disparaging remarks about a previous employer or colleague.

9.4 Components of a Digital Footprint

ComponentWhat It RevealsTypical Source
Social media activityInterests, opinions, social circle, behaviourInstagram, X/Twitter, Facebook, Reddit
Professional presenceSkills, work history, endorsementsLinkedIn, GitHub, personal portfolio
Search historyConcerns, health issues, purchasesSearch engines, ISP logs
Browsing behaviourReading habits, shopping intentCookies, tracking pixels, third-party scripts
Location dataHome, workplace, routineMobile OS, mapping apps, photo EXIF metadata
Purchases and transactionsSpending capacity, lifestyleE-commerce platforms, payment services
Comments and forum postsAttitude, expertise, toneStack Overflow, Quora, YouTube comments
MetadataDevice model, timestamps, GPS coordinatesPhoto EXIF, document properties
Public recordsAddresses, property, court recordsGovernment registries
Data-broker profilesAggregated inferences about behaviour and demographicsData brokers, credit agencies

9.5 Managing Your Digital Footprint — Six-Step Strategy

  1. Audit. Search your own name on Google, Bing and DuckDuckGo. Use quotation marks for exact matches and check image search. Review old social media posts, tagged photographs and comments. Check Have I Been Pwned for breached accounts.

  2. Prune. Delete outdated, offensive or overly personal content. Deactivate accounts you no longer use. Remove tags where possible. Where deletion is not possible, publish newer positive content to push old content down in search results.

  3. Lock down. Set social profiles to private. Disable location tagging and geotagging in the camera. Review and revoke third-party app access. Turn off ad personalisation where possible.

  4. Separate. Maintain distinct professional and personal identities. Use one email address for professional correspondence and a different one for social sign-ups. Keep professional profiles (LinkedIn, GitHub) consistently polished.

  5. Monitor. Set up Google Alerts for your name. Review account activity logs periodically. Check privacy settings after major platform updates, which frequently reset defaults.

  6. Build positively. Publish technical blogs, contribute to open source, maintain a project portfolio and participate in professional communities. A strong positive footprint does not merely offset a negative one — it becomes a genuine career asset.

Example 16 — Digital Footprint Audit and Corrective Plan

Situation: A final-year CSE student with a strong CGPA (8.6) and two internships is receiving no interview calls despite applying to over forty companies.

Audit findings:

FindingRisk LevelImpact
Public Instagram account with offensive posts from 2019 (age 16)HighImmediate rejection at screening
GitHub profile with 30 forked repositories and no original work; no README filesHighSuggests no genuine technical depth despite the internships
LinkedIn headline: "Student at XYZ University"MediumFails to communicate specialisation or value
Email address: party_king_99@example.comMediumUnprofessional impression before the CV is even read
Twitter account with political arguments and aggressive repliesHighRaises concerns about workplace conduct
Outdated portfolio website with broken linksMediumSuggests lack of attention to detail

Corrective action plan:

  1. Archive or delete the 2019 Instagram posts; set the account to private; audit remaining content.
  2. Delete the Twitter account entirely — the reputational cost exceeds any benefit.
  3. Restructure GitHub: pin three original projects, each with a proper README (problem, tech stack, screenshots, setup, results).
  4. Rewrite the LinkedIn headline: "Final-Year CSE | Python · SQL · AWS | Built 3 deployed web apps | Seeking SDE Internship" and add project entries with repository links.
  5. Create a professional email address (firstname.lastname@example.com) and update it across all applications and accounts.
  6. Rebuild the portfolio site with six documented projects and test every link.
  7. Begin publishing one technical blog post per month to generate positive search results.
  8. Set Google Alerts for the full name and re-audit every quarter.

Outcome: Within one recruitment cycle, four interview calls. Lesson: the digital footprint is a screening filter that acts before the interview — and it is entirely within the candidate's control to shape it.

9.6 Photo Metadata and Location Privacy

Modern smartphones embed EXIF metadata in every photograph: device model, timestamp, and often precise GPS coordinates. Uploading an unprocessed photograph can therefore reveal the exact location of your home, workplace or child's school.

EXIF FieldReveals
GPSLatitude / GPSLongitudePrecise location to within a few metres
DateTimeOriginalExact date and time the photo was taken
Make / ModelDevice make and model — useful for device fingerprinting
SerialNumberIn some devices, a unique device identifier
SoftwareEditing software and version used

Mitigation: disable location tagging in the camera settings; strip metadata before sharing (most social platforms do this automatically, but email and messaging apps often do not).

The "front page test"

Before posting anything, apply the front-page test: would you be comfortable if this appeared on the front page of a newspaper alongside your full name and photograph? If not, do not post it. This single heuristic prevents most digital-footprint regrets.

X. Cyber Ethics and the Legal Framework

10.1 Definition and Scope

Definition — Cyber Ethics

Cyber ethics is the study of moral, legal and social issues relating to the use of computers, networks and digital information. It defines the standards of responsible behaviour expected of individuals and organisations operating in cyberspace.

Cyber ethics addresses a gap that law alone cannot fill: technology evolves faster than legislation, and many harmful actions are not explicitly illegal. Ethical standards guide behaviour where the law is silent or ambiguous.

10.2 Relationship Between Law, Ethics and Professional Codes

DomainSource of AuthorityConsequence of ViolationExample
LawState / legislatureProsecution, fine, imprisonmentUnauthorised access under IT Act s.66
EthicsMoral reasoning, social normsSocial disapproval, loss of trustReading a colleague's unlocked screen
Professional codesProfessional bodies (IEEE, ACM, BCS)Disciplinary action, loss of membership/certificationSigning off on untested safety-critical code
Organisational policyEmployer / institutionWarning, terminationInstalling unapproved software

An action can be legal but unethical (e.g. legally collecting and selling personal data without meaningful consent), or ethical but illegal (e.g. whistle-blowing through unauthorised disclosure). The most defensible position is one where all four domains align.

10.3 Major Cyber Ethics Issues

IssueDescriptionEthical ConcernResponsible Practice
Software PiracyUnauthorised copying, distribution or use of licensed softwareDenies creators legitimate compensation; funds criminal networksUse licensed, open-source or student-licensed software
PlagiarismPresenting another's work, code or ideas as one's ownMisrepresents competence; devalues genuine effortCite all sources including code snippets and AI assistance
Intellectual Property ViolationInfringing copyright, patents or trademarksUndermines innovation incentivesRespect licence terms (MIT, GPL, Apache, CC)
Unauthorised Access / HackingAccessing systems without explicit permissionViolates privacy and property; causes real harmEthical hacking only with written authorisation and a defined scope
Data Privacy ViolationsCollecting, using or sharing personal data without consentAutonomy, dignity, potential for discriminationData minimisation, explicit consent, purpose limitation
Cyberbullying and HarassmentIntimidating or humiliating others onlinePsychological harm; power imbalanceDo not participate; report; support the target
Identity TheftImpersonating someone onlineFinancial loss and reputational damage to the victimProtect personal data; enable MFA; monitor accounts
Misinformation / DisinformationSpreading false content, sometimes deliberatelyUndermines public discourse and safetyVerify before sharing; cite primary sources
AI EthicsBias, opacity and accountability in automated decisionsDiscrimination at scale; unaccountable harmTest for bias; document limitations; retain human oversight
DeepfakesSynthetic media depicting real people saying or doing things they did notDefamation, election manipulation, non-consensual imageryDo not create or circulate; label synthetic media clearly
Digital DivideUnequal access to technology and digital literacyCompounds existing social inequalitySupport digital-literacy initiatives; design for accessibility
Environmental ImpactEnergy and water consumption of data centres and AI trainingExternalised environmental costOptimise models; prefer efficient architectures; measure footprint

10.4 The Ten Commandments of Computer Ethics

Published by the Computer Ethics Institute (1992), this remains the most widely cited summary of computing ethics:

  1. Thou shalt not use a computer to harm other people.
  2. Thou shalt not interfere with other people's computer work.
  3. Thou shalt not snoop around in other people's computer files.
  4. Thou shalt not use a computer to steal.
  5. Thou shalt not use a computer to bear false witness.
  6. Thou shalt not copy or use proprietary software for which you have not paid.
  7. Thou shalt not use other people's computer resources without authorisation or proper compensation.
  8. Thou shalt not appropriate other people's intellectual output.
  9. Thou shalt think about the social consequences of the program you are writing or the system you are designing.
  10. Thou shalt always use a computer in ways that ensure consideration and respect for your fellow humans.

IEEE / ACM Software Engineering Code of Ethics — Eight Principles

PrincipleCommitment To
PublicAct consistently with the public interest
Client and EmployerAct in their best interest, consistent with the public interest
ProductEnsure products and modifications meet the highest professional standards
JudgmentMaintain integrity and independence in professional judgment
ManagementPromote an ethical approach to managing software development
ProfessionAdvance the integrity and reputation of the profession
ColleaguesBe fair to and supportive of colleagues
SelfParticipate in lifelong learning and promote an ethical approach to practice

10.5 Ethical Hacking vs Malicious Hacking

ParameterEthical Hacking (White Hat)Malicious Hacking (Black Hat)
AuthorisationWritten permission with a defined scopeNone
IntentImprove security; help the organisationPersonal gain, damage, espionage
DisclosureFindings reported privately to the ownerExploited, sold or published maliciously
Legal statusLawful within the agreed scopeCriminal offence
MethodFollows a methodology (recon → scan → exploit → report → remediate)Opportunistic; often uses existing tools
DeliverablePenetration test report with remediation guidanceStolen data, ransom demand, disruption

Grey hat hacking sits between: the actor finds a vulnerability without authorisation but reports it (sometimes demanding a reward). It remains legally problematic, because authorisation is what distinguishes the two.

Responsible disclosure

If you discover a vulnerability, do not exploit it, do not access data beyond what is necessary to demonstrate the issue, and do not publish it publicly before the vendor has had a reasonable opportunity to fix it. Report it privately through the organisation's security contact or a coordinated vulnerability disclosure programme (bug bounty). Typical disclosure timelines are 90 days.

10.6 Indian Legal Framework

LawYearRelevance to Computing
Information Technology Act2000The primary cyber law of India — provides legal recognition for electronic records and digital signatures, and defines cyber offences and penalties
IT (Amendment) Act2008Added Sections 66–69 and others; introduced provisions on cyber terrorism, obscene material, and interception powers
Copyright Act1957Protects source code, documentation and creative works; covers software as a literary work
Digital Personal Data Protection Act2023Consent-based processing of personal data; establishes obligations for data fiduciaries and rights for data principals
Indian Penal Code / Bharatiya Nyaya Sanhita1860 / 2023Covers traditional offences (fraud, forgery, defamation, criminal intimidation) committed through digital means

Key Sections of the IT Act, 2000 (as amended)

SectionProvisionConsequence
Section 43Damage to computer, computer system or network — unauthorised access, downloading, copying, disruptionCivil liability — compensation to the affected party
Section 43AFailure to protect sensitive personal dataCompensation to affected persons
Section 65Tampering with computer source documentsImprisonment up to 3 years and/or fine up to ₹2 lakh
Section 66Computer-related offences — dishonest or fraudulent acts under Section 43Imprisonment up to 3 years and/or fine up to ₹5 lakh
Section 66CIdentity theft — fraudulent use of another's electronic signature, password or identification featureImprisonment up to 3 years and/or fine up to ₹1 lakh
Section 66DCheating by personation using a computer resourceImprisonment up to 3 years and/or fine up to ₹1 lakh
Section 66EViolation of privacy — capturing or publishing private images without consentImprisonment up to 3 years and/or fine up to ₹2 lakh
Section 66FCyber terrorism — acts threatening the unity, integrity or security of IndiaImprisonment which may extend to life
Section 67Publishing obscene material in electronic formFirst conviction: up to 3 years and/or fine up to ₹5 lakh
Section 69Powers to intercept, monitor or decrypt informationGovernment authority, exercised under defined procedure
Section 72Breach of confidentiality and privacy by a person with authorised accessImprisonment up to 2 years and/or fine up to ₹1 lakh
Legal warning for students

Unauthorised access to any computer system is a punishable offence under Sections 43 and 66 of the IT Act, 2000 — even if no data is stolen, even if no damage occurs, and even if the intent was merely to "check whether it was possible". Testing your own college's network, a friend's account, or an unsecured public server without written authorisation is a criminal act, not a harmless experiment. Port scanning, credential guessing and exploiting a vulnerability all fall within the prohibition. Always obtain written permission with an explicit scope before any security testing.

10.7 Personal Data Protection Principles

PrincipleRequirement
Lawfulness and consentProcess personal data only with a lawful basis, typically the individual's informed consent
Purpose limitationCollect data only for the specific, stated purpose
Data minimisationCollect only what is genuinely necessary
AccuracyKeep data accurate and up to date
Storage limitationRetain data only as long as needed for the stated purpose
SecurityImplement appropriate technical and organisational safeguards
AccountabilityThe data controller must be able to demonstrate compliance
Individual rightsRight to access, correction, erasure and grievance redressal
Example 17 — Applying Ethical Reasoning to a Real Dilemma

Scenario: During a college tech fest, a student discovers that the registration portal (built by a peer) stores user passwords in plaintext in the database, and that the database is publicly readable at an unauthenticated URL. The student is unsure what to do.

Analysis of options:

OptionLegal PositionEthical PositionAssessment
Download the database to prove the vulnerabilityIllegal — unauthorised access under s.43 and s.66, plus s.66C if credentials are usedUnethical — accesses others' personal data unnecessarilyUnacceptable
Publicly post the URL on social media to force a fixPotentially illegal — may constitute unauthorised disclosureUnethical — exposes thousands of students to harmUnacceptable
Ignore it; it is not your responsibilityLegalQuestionable — you now know of a harm and have the means to prevent itWeak
Privately inform the developer and a faculty supervisor, sharing only a screenshot of the URL without downloading any dataLegal — no unauthorised access to dataEthical — minimises harm, respects privacy, enables remediationRecommended
Offer to help fix the issue (password hashing with bcrypt/argon2, access control on the endpoint)Legal, and constructiveEthical — solves the root causeRecommended

Resolution: Notify the developer and supervisor privately, verify only what is visible without authentication (a single screenshot of the error page, no data extraction), and volunteer to implement password hashing and endpoint authorisation. After the fix, write a short internal post-mortem so future fest portals do not repeat the mistake.

Key principle demonstrated: responsible disclosure — demonstrate the minimum necessary, disclose privately, and support remediation.

XI. Summary Tables & Quick Revision Sheet

11.1 Core Definitions — One Line Each

TermOne-Line Definition
Software EngineeringSystematic application of engineering principles to the design, development, testing and maintenance of software
SDLCStructured sequence of phases from requirements to maintenance in software development
Functional RequirementWhat the system does
Non-Functional RequirementHow well the system does it (performance, security, usability)
Waterfall ModelLinear, sequential SDLC with no going back
V-ModelWaterfall with a matching test phase for every development phase
Spiral ModelRisk-driven iterative SDLC passing through four quadrants per cycle
AgileIterative, incremental approach delivering working software in short cycles and welcoming change
ScrumAn Agile framework with defined roles, artifacts and ceremonies
DevOpsCultural and technical unification of development and operations for rapid, reliable releases
CI / CDAutomated build-and-test on every commit / always-deployable state
Version Control SystemTool recording file changes over time to enable recall and collaboration
CommitImmutable snapshot of staged changes identified by a SHA-1 hash
Staging AreaHolding area where changes are prepared before committing
BranchMovable pointer to a commit; an independent line of development
Merge vs RebaseCombine histories preserving topology vs replay commits to linearise history
Pull RequestRequest to merge a branch, providing review and discussion
CIA TriadConfidentiality, Integrity, Availability — the three security objectives
VulnerabilityA weakness that a threat can exploit
RiskLikelihood × impact of a threat exploiting a vulnerability
FirewallDevice or software filtering network traffic based on rules
DMZBuffer sub-network hosting public services between two firewalls
IDS vs IPSPassive detection vs active inline prevention
Principle of Least PrivilegeGrant only the minimum access necessary for the minimum time
RBACPermissions attached to roles; users assigned to roles
MFAAuthentication using two or more factors from different categories
AAAAuthentication, Authorisation, Accounting
Digital FootprintPermanent trail of data created by online activity
Cyber EthicsMoral principles governing responsible behaviour in cyberspace
Responsible DisclosureReporting a vulnerability privately to the owner with minimal demonstration

11.2 Key Formulas

ConceptFormula
Defect densityDefects ÷ KLOC
MTBFTotal operating time ÷ number of failures
AvailabilityMTBF ÷ (MTBF + MTTR)
Risk exposure (spiral)\(RE = P(UO) \times L(UO)\)
Agile velocityStory points completed per sprint
Sprints remainingRemaining backlog points ÷ average velocity
Commit hashSHA-1 of tree, parent, author, timestamp, message
Security riskThreat × Vulnerability × Impact
Single Loss ExpectancyAsset Value × Exposure Factor
Annualised Loss ExpectancySLE × ARO
Password search space\(N = C^{L}\)
Time to brute force\(T = N / (2R)\)

11.3 Quick Comparison Grid

PairKey Distinguishing Point
Waterfall vs AgileSequential and change-averse vs iterative and change-welcoming
Incremental vs IterativeAdds new features (breadth) vs refines existing ones (depth)
Verification vs Validation"Are we building the product right?" vs "Are we building the right product?"
Black-box vs White-box testingTests behaviour without code knowledge vs tests internal paths
Centralised vs Distributed VCSSingle server repository vs full history on every clone
fetch vs pullDownloads only vs downloads and merges
merge vs rebasePreserves branch topology vs rewrites history into a line
reset vs revertRewrites history (dangerous if pushed) vs adds an inverse commit (safe)
Virus vs WormRequires a host file vs self-propagating across networks
Trojan vs VirusDoes not self-replicate; disguises itself vs replicates by attaching to files
IDS vs IPSDetects and alerts vs detects and blocks inline
Authentication vs AuthorisationWho you are vs what you may do
DAC vs MACOwner decides vs system-enforced labels
RBAC vs ABACPermissions by role vs permissions by multi-attribute policy
Symmetric vs Asymmetric encryptionOne shared key, fast vs key pair, slow but solves key distribution
Hashing vs EncryptionOne-way integrity check vs reversible confidentiality
Active vs Passive footprintDeliberately shared vs automatically collected
White hat vs Black hatAuthorised, reports privately vs unauthorised, exploits

XII. Top 10 Exam Tips & Practice Questions

12.1 Top 10 Exam Tips

  1. Define before you describe. Every answer should open with a precise one-sentence definition. Definitions carry guaranteed marks and demonstrate command of terminology.
  2. Tabulate every comparison. If the question says "differentiate", "compare" or "distinguish", answer in a two-column table with at least four parameters. Prose comparisons lose marks through omission.
  3. Name the model, then justify it. In SDLC questions, always state which model you recommend and why, referencing the specific project characteristics (requirement stability, risk, team size, regulatory burden).
  4. Write Git commands exactly. Use the correct syntax: git switch -c feature/x, not "create a branch". Marks are awarded for accurate command usage.
  5. Draw the firewall topology. A diagram showing Internet → external firewall → DMZ → internal firewall → LAN earns more marks than three paragraphs of description.
  6. Use the four-parameter firewall comparison. OSI layer inspected, stateful or not, payload inspection, performance overhead. This structure answers almost any firewall comparison question.
  7. Cite the law precisely. Reference the IT Act 2000 with section numbers (43, 66, 66C, 66F, 67) and the DPDP Act 2023 for privacy questions. Generic references to "cyber law" earn fewer marks.
  8. Quantify where possible. Password search space, defect density, velocity, risk exposure, ALE — showing a calculation demonstrates understanding that description alone does not.
  9. Explain the "why" behind every practice. State the threat a control mitigates, not just the control itself. "Use MFA" is weak; "Use MFA because it defeats credential stuffing and the reuse of breached passwords" is strong.
  10. Manage time by marks. Allocate roughly one minute per mark. Leave the final 10% of the time for review, particularly checking that every "differentiate" question is answered in table form.

12.2 Practice Questions

Q1. Define software engineering and explain why the "software crisis" of the 1960s led to the development of structured SDLC processes. Easy

Q2. Explain the six phases of the SDLC with their deliverables and exit criteria. Which type of maintenance consumes the largest share of lifetime cost, and why does this matter? Easy

Q3. Compare the Waterfall, Spiral and Agile models on the parameters of change handling, customer involvement, risk management and suitability. Recommend a model for a banking mobile application with a fixed regulatory deadline and evolving UI requirements, justifying your choice. Medium

Q4. A team's velocity over four sprints was 22, 26, 25 and 27 story points. The remaining backlog is 240 points. Calculate the average velocity, the number of sprints required, and the calendar duration assuming two-week sprints. Explain why a buffer should be added. Medium

Q5. Differentiate between centralised and distributed version control systems on at least five parameters. Explain why Git stores snapshots rather than differences, and what benefit this provides. Medium

Q6. Explain the three trees of Git. Write the complete sequence of commands for a feature-branch workflow from branching through to cleaning up after a merged pull request. Medium

Q7. Explain the CIA triad with one control and one attack for each pillar. Define the terms threat, vulnerability, exploit and risk, and state the risk quantification formula. Easy

Q8. Classify firewalls by generation. Compare packet-filtering and stateful inspection firewalls on OSI layer, state awareness, vulnerability and performance. Explain the concept of a DMZ with a suitable diagram description. Hard

Q9. Explain the principle of least privilege and describe four practical methods of implementing it in an organisation. Compare DAC, MAC and RBAC access control models. Medium

Q10. Calculate the password search space and the expected brute-force time for: (a) an 8-character lowercase-only password, and (b) a 14-character password from a 94-character set, assuming a guessing rate of \(10^{11}\) guesses per second. Comment on the implication for password policy. Hard

Q11. Differentiate between active and passive digital footprints with five parameters. Describe a six-step strategy for managing your digital footprint and explain why deletion alone is insufficient. Medium

Q12. Define cyber ethics. Explain any six major cyber ethics issues with their ethical concerns and responsible practices. State the key sections of the IT Act 2000 relevant to unauthorised access, identity theft and cyber terrorism. Hard

XIII. Solutions to Practice Questions

Solution 1

Definition: Software engineering is the systematic application of engineering principles — process, measurement, documentation and review — to the design, development, testing, deployment and maintenance of software systems.

The software crisis: The term was coined at the 1968 NATO Software Engineering Conference to describe the chronic failure of large software projects. Projects consistently exceeded budgets and schedules, produced unreliable products, and were prohibitively expensive to maintain. The root cause was that project size and complexity grew rapidly while development discipline did not — code was written ad hoc, requirements were undocumented, and testing was an afterthought.

How SDLC processes addressed it:

Solution 2
PhaseKey ActivitiesDeliverableExit Criterion
Requirement gathering & analysisStakeholder interviews, scope definition, feasibility studySRS documentSRS signed off by client
System designArchitecture, database design, UI design, interface specificationDesign document, ER and UML diagramsDesign review approved
ImplementationCoding, unit testing, code reviewSource code, unit test suiteCode merged; unit tests pass
TestingIntegration, system and acceptance testing; defect loggingTest plan, test cases, defect reportsDefect density within threshold
DeploymentRelease packaging, installation, user trainingRelease build, user manualProduction sign-off
MaintenanceCorrective, adaptive, perfective and preventive maintenancePatches, minor releasesProduct retired

Largest maintenance share: Perfective maintenance — approximately 50% of maintenance effort — covering improvements to performance, maintainability and readability without changing external behaviour. Corrective is ~20%, adaptive ~25%, preventive ~5%.

Why this matters: Maintenance consumes 60–70% of a system's total lifetime cost. This makes maintainability a first-class quality attribute: readable code, meaningful names, adequate test coverage, good documentation and modular design all reduce the long-term cost of change. It also justifies Agile practices such as continuous refactoring — paying down technical debt early is far cheaper than paying it during maintenance.

Solution 3
ParameterWaterfallSpiralAgile / Scrum
NatureLinear, sequentialRisk-driven iterative spiralIterative and incremental sprints
Change handlingVery poor — changes are expensive after sign-offExcellent — each cycle re-evaluates objectives and risksExcellent — backlog reprioritised every sprint
Customer involvementStart and end onlyEvery cycle (formal review)Continuous, via the Product Owner and sprint reviews
Risk managementImplicit; risks surface lateExplicit and formal — quadrant 2 of every loopImplicit through short feedback cycles
Working softwareVery latePrototypes from early cyclesEvery sprint (2–4 weeks)
Documentation burdenHeavyModerate–HeavyLight (working software prioritised)
Cost profileFront-loaded, then fixedHigh — prototyping each cycleContinuous, predictable per sprint
Best forFrozen, well-understood requirementsLarge, high-risk, high-budget projectsEvolving requirements, fast delivery

Recommendation for the banking mobile application:

Neither pure Waterfall nor pure Agile fits. The fixed regulatory deadline and the need for auditability argue against a pure Agile approach; the evolving UI requirements argue against pure Waterfall. The recommended approach is a hybrid: Agile delivery inside a Waterfall-governed framework.

Justification:

Solution 4

Given: Velocities = 22, 26, 25, 27. Remaining backlog = 240 points. Sprint length = 2 weeks.

Average velocity:

\[ \overline{V} = \frac{22 + 26 + 25 + 27}{4} = \frac{100}{4} = 25 \text{ points/sprint} \]

Sprints required:

\[ \text{Sprints} = \frac{240}{25} = 9.6 \rightarrow 10 \text{ sprints} \]

Calendar duration:

\[ 10 \times 2 = 20 \text{ weeks} \]

Why a buffer is necessary:

A defensible buffer is 1–2 additional sprints, giving a commitment of 11–12 sprints (22–24 weeks) for external communication, while planning internally for 10. Publishing the buffered figure protects credibility; planning to the unbuffered figure maintains focus.

XIII. Solutions to Practice Questions (continued)

Solution 5
ParameterCentralised VCSDistributed VCS
Repository locationSingle central server holds the authoritative repositoryEvery clone contains the complete repository and history
Offline capabilityVery limited — most operations require server connectivityFull — commit, branch, diff, log and merge all work offline
Single point of failureYes — server loss can destroy the entire historyNo — any clone can restore the full repository
Branching costExpensive and slow, often discouragedCheap and near-instantaneous; encourages feature branching
Merge handlingBasic; often requires manual file copyingSophisticated three-way merge with conflict detection
Speed of operationsNetwork-dependentLocal operations are extremely fast
Access controlCentralised and straightforwardDistributed; more complex to enforce uniformly
Learning curveGentlerSteeper — more concepts (staging, rebase, remotes)
Disk usageMinimal on the clientLarger — the full history is duplicated on every clone
ExamplesSVN, CVS, PerforceGit, Mercurial

Why Git stores snapshots rather than differences:

Traditional version control systems store a base version plus a chain of deltas (differences). Reconstructing any version requires replaying every delta from the base — an operation whose cost grows with history depth. Git instead stores a complete snapshot of the project tree at each commit, but achieves efficiency through two mechanisms:

  1. Content-addressed storage: a file's content is hashed (SHA-1) and stored once. If the same content appears again, it is referenced rather than duplicated.
  2. Deduplication across commits: only files that actually changed get new blob objects. Unchanged files are referenced by the same hash in the new tree.

Benefits this provides:

Solution 6

The three trees of Git:

TreeContentsCommand that places data here
Working DirectoryThe actual files currently being editedgit switch / git checkout populates it; editing modifies it
Staging Area (Index)Changes marked to be included in the next commitgit add
Repository (HEAD)Committed immutable snapshotsgit commit

Data flows: Working Directory → (git add) → Staging Area → (git commit) → Repository. The reverse flow is (git checkout/switch/restore).

The staging area exists to allow selective, coherent commits. If you have fixed a bug and simultaneously begun a new feature, you can stage and commit only the bug fix, leaving the feature work uncommitted — producing a clean, reviewable history.

Complete feature-branch workflow:

# 1. Sync the base branch
git switch main
git pull origin main

# 2. Create the feature branch
git switch -c feature/payment-gateway

# 3. Implement and commit in logical units
#    ... edit src/payment.js, tests/payment.test.js ...
git status
git diff
git add src/payment.js
git commit -m "feat: integrate Razorpay payment SDK"
git add tests/payment.test.js
git commit -m "test: cover payment success and failure paths"

# 4. Keep the branch current with main
git fetch origin
git rebase origin/main
#    resolve any conflicts, then: git add . && git rebase --continue

# 5. Publish and open a pull request
git push -u origin feature/payment-gateway
#    open PR on GitHub, request 1–2 reviewers, wait for CI

# 6. After the PR is merged (squash or rebase-merge)
git switch main
git pull origin main

# 7. Clean up
git branch -d feature/payment-gateway
git push origin --delete feature/payment-gateway

# 8. Verify
git log --oneline --graph -8
Solution 7
PillarMeaningOne ControlOne Attack
ConfidentialityInformation is accessible only to authorised partiesAES-256 encryption at rest plus role-based access controlData breach through credential theft; unencrypted data intercepted on a public network
IntegrityData is accurate, complete and unalteredSHA-256 hashing with digital signatures; append-only audit logsMan-in-the-middle tampering; SQL injection modifying database records
AvailabilitySystems and data are accessible when requiredRedundant servers, load balancing, 3-2-1 backups, DDoS scrubbingDistributed Denial of Service; ransomware encrypting production data

Definitions:

Risk quantification:

\[ \text{Risk} = \text{Threat} \times \text{Vulnerability} \times \text{Impact} \]

For financial quantification:

\[ \text{SLE} = \text{Asset Value} \times \text{Exposure Factor} \qquad \text{ALE} = \text{SLE} \times \text{ARO} \]

Worked illustration: A database worth ₹50,00,000 has an exposure factor of 0.4 (a breach would destroy 40% of its value). Then SLE = ₹20,00,000. If such an incident is expected twice a year, ARO = 2 and ALE = ₹40,00,000. A security control costing ₹15,00,000 that reduces the ARO to 0.5 would deliver an ALE reduction of ₹30,00,000 — clearly justified.

Solution 8

Classification by generation:

  1. Packet Filtering Firewall (1st generation) — inspects source/destination IP, port and protocol against a static ACL.
  2. Stateful Inspection Firewall (2nd generation) — maintains a connection state table (NEW, ESTABLISHED, RELATED, INVALID).
  3. Application / Proxy Firewall (3rd generation) — terminates and re-creates connections at the application layer, inspecting full payloads.
  4. Next-Generation Firewall (NGFW) (4th generation) — deep packet inspection, application awareness, integrated IPS, TLS inspection, user identity awareness and threat intelligence.

Additionally, by deployment: host-based, network-based, cloud-native and virtual appliance firewalls; and Web Application Firewalls (WAFs) specialise in HTTP/HTTPS traffic.

Comparison — Packet Filtering vs Stateful Inspection:

ParameterPacket FilteringStateful Inspection
OSI layer inspectedNetwork and Transport (L3–L4)Network and Transport with session context (L3–L4)
State awarenessStateless — each packet judged independentlyStateful — maintains a connection state table
Return traffic handlingRequires an explicit rule allowing the reverse directionAutomatically permits return traffic for ESTABLISHED sessions
Vulnerability to spoofingHigh — a spoofed source IP can bypass rulesLow — the state table makes spoofing far harder
Payload inspectionNone — header fields onlyNone (though it tracks protocol state)
PerformanceVery fast, minimal overheadSlower; requires memory for the state table
Scalability concernRule-list lengthState-table size under high concurrent connection load
Typical useSimple routers and legacy devicesModern perimeter firewalls

DMZ — concept and topology:

A DMZ is a buffer sub-network that hosts public-facing services between two firewalls:

INTERNET
    │
    ▼
[ External Firewall ]     ← allows only 80/443 inbound to the DMZ
    │
    ▼
   DMZ   (web server, mail relay, reverse proxy, DNS)
    │
    ▼
[ Internal Firewall ]     ← allows DMZ → LAN only on specific ports
    │
    ▼
   LAN   (workstations, application servers, database)

Rule design: Internet → DMZ on ports 80/443 only; DMZ → LAN denied by default, with narrow exceptions (e.g. the web server may query the internal database on port 5432 only); LAN → Internet permitted with inspection.

Security benefit: if the web server in the DMZ is fully compromised, the attacker still faces the internal firewall and cannot freely reach internal systems. A total breach is thereby converted into a contained incident. The DMZ also concentrates the attack surface into a designated, heavily monitored zone rather than exposing internal servers directly.

XIII. Solutions to Practice Questions (continued)

Solution 9

Principle of Least Privilege (PoLP): Every user, program or process should be granted only the minimum privileges necessary to perform its intended function, and only for the minimum time required.

Four practical implementation methods:

  1. Separate administrative and daily-use accounts. Each administrator holds two accounts: a standard account for email and browsing, and a privileged account used only for administrative tasks. Malware executed while browsing cannot inherit administrative rights, because the compromised account does not possess them.
  2. Just-in-time elevation. Instead of logging in permanently as root or Administrator, users elevate on demand with sudo or a privileged access management (PAM) tool, with the elevation time-limited and fully logged. This shrinks the window during which privileged credentials are exposed.
  3. Scoped service accounts. A database service account should have read/write access to its own data directory and nothing else — not to the entire filesystem, not to the application source code, and not to other databases. Similarly, a web server process should run as a dedicated low-privilege user such as www-data.
  4. Regular access reviews with prompt revocation. Conduct quarterly attestation in which each manager confirms that their team members still require their current access. Revoke access immediately on role change or termination. Stale accounts belonging to departed employees are among the most commonly exploited entry points.

Two additional supporting practices: no shared accounts (every account maps to one person, preserving accountability) and role-based provisioning (access derives from the role, not from individual negotiation).

Comparison of DAC, MAC and RBAC:

ParameterDACMACRBAC
Full nameDiscretionary Access ControlMandatory Access ControlRole-Based Access Control
Decision authorityThe resource ownerThe system, via labels and clearancesThe role definition; users are assigned to roles
GranularityPer-file / per-resourcePer-label and per-clearance levelPer-role, typically functional
FlexibilityHigh — users decide freelyLow — rigid and centrally imposedModerate — changes require role redesign
Administrative effortDistributed; scales poorlyHigh; requires a formal classification schemeModerate; scales well as roles grow slowly
Strength against insider misuseWeak — owners may grant excessive accessStrong — users cannot override the policyGood — enforces separation of duties
AuditabilityDifficult — permissions are scatteredGood — policy is centralGood — role membership is enumerable
Typical weaknessTrojan horses inherit the user's permissionsComplex administration; user frictionRole explosion in large organisations
ExampleUnix chmod and chown; Windows NTFS permissionsSELinux, AppArmor, military multi-level security systemsERP systems with HR Manager, Auditor, Developer roles

Practical observation: most real systems combine models. A Linux server might use DAC for ordinary file permissions, MAC (SELinux) for confinement of network-facing daemons, and RBAC at the application layer for business functions.

Solution 10

Given: Guessing rate \(R = 10^{11}\) guesses per second. Expected time \(T = N / (2R)\).

Part (a): 8-character lowercase-only password

Character set \(C = 26\) (lowercase letters only), length \(L = 8\).

\[ N_a = 26^{8} = 208{,}827{,}064{,}576 \approx 2.09 \times 10^{11} \]

\[ T_a = \frac{2.09 \times 10^{11}}{2 \times 10^{11}} \approx 1.04 \text{ seconds} \]

Part (b): 14-character password from a 94-character set

Character set \(C = 94\) (upper, lower, digits, symbols), length \(L = 14\).

\[ N_b = 94^{14} \approx 4.21 \times 10^{27} \]

\[ T_b = \frac{4.21 \times 10^{27}}{2 \times 10^{11}} \approx 2.10 \times 10^{16} \text{ seconds} \]

Converting to years: \(2.10 \times 10^{16} / (3.15 \times 10^{7}) \approx 6.7 \times 10^{8}\) years — approximately 670 million years.

Comparison summary:

Password\(C\)\(L\)Search Space \(N\)Time to Crack
8 lowercase268\(2.09 \times 10^{11}\)≈ 1 second
14 full set9414\(4.21 \times 10^{27}\)≈ 670 million years

Implications for password policy:

XIII. Solutions to Practice Questions (continued)

Solution 11
ParameterActive FootprintPassive Footprint
Creation mechanismDeliberately created and published by the userCollected automatically without conscious user action
User awarenessHigh — the user knows what they postedLow — largely invisible to the user
ExamplesSocial posts, comments, photographs, blog articles, reviews, form submissions, uploaded videosIP logs, cookies, device fingerprint, browsing history, location pings, email tracking pixels
Who collects itPublic audience, followers, search engines, recruitersAdvertisers, data brokers, analytics platforms, ISPs, websites
User controlHigh — deletion and privacy settings are within reachLimited to browser/privacy configuration and app permissions
Persistence and removabilityPersists until deleted; may survive in caches and archivesOften retained indefinitely by third parties with no practical deletion route

Six-step digital footprint management strategy:

  1. Audit. Search your own name across multiple search engines (Google, Bing, DuckDuckGo) using exact-match quotation marks and image search. Review old posts, comments and tagged photographs. Check breach-monitoring services.
  2. Prune. Delete outdated, offensive or overly personal content. Deactivate unused accounts. Remove tags where possible. Where deletion is impossible, publish newer positive content to displace old material in search rankings.
  3. Lock down. Set social profiles to private. Disable location tagging in camera settings. Review and revoke third-party application access. Turn off ad personalisation and tracking where the platform allows.
  4. Separate. Maintain distinct professional and personal identities. Use one email address for professional correspondence and another for social sign-ups. Keep professional profiles (LinkedIn, GitHub) consistently polished and current.
  5. Monitor. Set Google Alerts for your name. Review account activity logs periodically. Re-check privacy settings after major platform updates, which frequently reset defaults to more permissive values.
  6. Build positively. Publish technical blogs, contribute to open source, maintain a project portfolio and engage in professional communities. A strong positive footprint becomes a genuine career asset rather than merely an offset against negative content.

Why deletion alone is insufficient:

The practical conclusion is that prevention is substantially more effective than cleanup — hence the value of the "front page test" before publishing anything.

Solution 12

Definition: Cyber ethics is the study of moral, legal and social issues arising from the use of computers, networks and digital information. It establishes standards of responsible behaviour in cyberspace, covering areas where legislation is absent, ambiguous or lagging behind technological change.

Six major cyber ethics issues:

IssueDescriptionEthical ConcernResponsible Practice
Software piracyUnauthorised copying, distribution or use of licensed softwareDenies developers legitimate compensation; funds criminal networks; undermines innovationUse licensed, open-source or properly obtained student licences; respect EULA terms
PlagiarismPresenting another's work, code or ideas as one's ownMisrepresents competence; devalues genuine effort; constitutes academic misconductCite all sources including code snippets, tutorials and AI-assisted content
Unauthorised accessAccessing systems, accounts or data without explicit permissionViolates privacy and property rights; causes real operational harmConduct security testing only with written authorisation and a defined scope; follow responsible disclosure
Data privacy violationCollecting, using or sharing personal data without informed consentViolates individual autonomy and dignity; enables discrimination and profilingData minimisation, explicit consent, purpose limitation, transparency about collection
Cyberbullying and harassmentIntimidating, humiliating or threatening others onlineSerious psychological harm; exploits power imbalances; amplified by anonymityDo not participate or amplify; report through platform mechanisms; support the target
AI ethics and deepfakesBias, opacity and accountability in automated decisions; synthetic media depicting real people falselyDiscrimination at scale; unaccountable harm; erosion of trust in mediaTest for bias; document limitations; retain human oversight; label synthetic media clearly; never create non-consensual content

Key sections of the IT Act, 2000 (as amended) relevant to the offences named:

OffenceSectionProvision and Consequence
Unauthorised accessSection 43Civil liability for damage to a computer, system or network — compensation payable to the affected party. This applies even where no data is stolen.
Unauthorised access with dishonest intentSection 66Where Section 43 is committed dishonestly or fraudulently — imprisonment up to 3 years and/or fine up to ₹5 lakh.
Identity theftSection 66CFraudulent or dishonest use of another person's electronic signature, password or other unique identification feature — imprisonment up to 3 years and/or fine up to ₹1 lakh.
Cheating by personationSection 66DCheating by personation using a computer resource or communication device — imprisonment up to 3 years and/or fine up to ₹1 lakh.
Violation of privacySection 66EIntentionally capturing, publishing or transmitting a private image without consent — imprisonment up to 3 years and/or fine up to ₹2 lakh.
Cyber terrorismSection 66FActs threatening the unity, integrity, security or sovereignty of India, or striking terror in the public — imprisonment which may extend to life.
Publishing obscene materialSection 67Publishing or transmitting obscene material in electronic form — first conviction up to 3 years and/or fine up to ₹5 lakh.
Tampering with source documentsSection 65Knowingly concealing, destroying or altering computer source code — imprisonment up to 3 years and/or fine up to ₹2 lakh.
Breach of confidentialitySection 72Disclosure of information by a person with authorised access, in breach of a legal contract — imprisonment up to 2 years and/or fine up to ₹1 lakh.

Critical point for students: Section 43 imposes civil liability for unauthorised access even in the absence of theft or damage. Section 66 elevates this to a criminal offence when the access is dishonest or fraudulent. There is no exemption for "curiosity", "educational purposes" or "I was only testing". Written authorisation with a defined scope is what distinguishes legitimate security research from a criminal act.

Complementary framework: the Digital Personal Data Protection Act, 2023 establishes consent-based processing requirements, obligations on data fiduciaries, and rights for data principals including access, correction, erasure and grievance redressal — filling the privacy gap that the IT Act only partially addressed.

XIV. References, Key Takeaways & CO Mapping

14.1 Textbooks

CodeTitleAuthorPublisher
T-1Operating System ConceptsAbraham Silberschatz, Peter B. Galvin, Greg GagneWiley
T-2Computer FundamentalsPradeep K. Sinha and Priti SinhaBPB Publication, New Delhi

14.2 Reference Books

CodeTitleAuthorPublisher
R-1Data Communications and Networking with TCP/IP Protocol SuiteBehrouz A. ForouzanMcGraw Hill

14.3 Other Reading and Online Resources

CodeResourceTopic Covered
OR-1byjus.com/gate/types-of-operating-system-notesTypes of Operating Systems (software development context)
RW-1geeksforgeeks.org/cloud-computing/virtualization-cloud-computing-typesCloud Computing and Virtualisation (DevOps deployment)
RW-2geeksforgeeks.org/product-management/emerging-technologies-and-future-trends-ai-moreEmerging Technologies
RW-3nptel.ac.inMOOC courses on software engineering and cyber security
RW-5geeksforgeeks.org/cybersecurity/what-is-cyberethicsCyber Ethics
RW-6cisco.com/site/in/en/learn/topics/security/what-is-cybersecurityCyber Security fundamentals

14.4 Additional Recommended Reading

ResourceTopic
Pro Git — Chacon & Straub (free online)Complete Git reference
The Agile Manifesto (agilemanifesto.org)Four values and twelve principles
OWASP Top 10Most critical web application security risks
NIST SP 800-63BDigital identity guidelines — password policy
MeitY / CERT-In advisoriesIndian cyber security guidance and incident reporting
IEEE/ACM Software Engineering Code of EthicsProfessional ethical standards

14.5 Key Takeaways — 12 Points

  1. Software engineering is distinguished from ad-hoc programming by process, measurement, documentation and review — the response to the software crisis of the 1960s.
  2. The SDLC provides six phases with defined deliverables and exit criteria; maintenance consumes the largest share of lifetime cost, making maintainability a first-class quality attribute.
  3. SDLC models differ chiefly in how they handle change and risk. Waterfall and V-Model suit frozen requirements; Spiral suits high-risk large projects; Agile and DevOps embrace continuous change.
  4. Agile delivers working software in short cycles; Scrum provides the concrete roles (PO, Scrum Master, Team), artifacts (product backlog, sprint backlog, increment) and ceremonies that make it operational.
  5. DevOps and CI/CD automate build, test and deployment so that releases are frequent, small and low-risk rather than infrequent and catastrophic.
  6. Version control is non-negotiable professional practice. Git is distributed, stores snapshots rather than deltas, and forms a cryptographically verifiable history chain.
  7. The three trees — working directory, staging area and repository — enable selective, coherent commits. Branching, merging, rebasing and pull requests are the core collaboration mechanics.
  8. Security rests on the CIA triad — confidentiality, integrity and availability — extended by authentication, authorisation, accountability and non-repudiation.
  9. Firewalls evolved through four generations from stateless packet filtering to next-generation inspection; default-deny and tier isolation via a DMZ are the essential design principles.
  10. The principle of least privilege, role-based access control, and multi-factor authentication are the highest-value access controls available; password strength is dominated by length, not complexity.
  11. Safe internet practice is fundamentally behavioural: verify before clicking, patch promptly, back up using the 3-2-1 rule, and manage your digital footprint before it manages you.
  12. Cyber ethics and law are complementary. Unauthorised access is a punishable offence under Sections 43 and 66 of the IT Act 2000 even without theft or damage — responsible disclosure, not exploitation, is the professional standard.

14.6 Course Outcome Mapping

COStatementCovered In
CO1Apply computational thinking and computing environment concepts to solve basic computing problemsSection I (software engineering discipline), Section II (structured development process)
CO2Explain software development practices, version control, and fundamental cybersecurity concepts for secure computingSections I, II, III, IV (SDLC, Agile, DevOps, Git) and Sections V–X (cyber security, firewalls, accounts, safe practices, digital footprint, cyber ethics)
CO4Describe AI, ML, Generative AI, Agentic AI and emerging computing technologies with ethical considerationsSection II (DevOps/cloud), Section X (AI ethics and deepfakes)

14.7 Assessment Component Mapping

ComponentWeightageMapped COsPreparation Sections
Test25%CO1, CO2I, II, III, IV, V, VI, VII, XI
Design Your Dream CV25%CO1, CO2, CO4, CO5, CO6Section IV (GitHub profile as portfolio evidence), Section IX (digital footprint)
EDU-RevolUTION Task25%CO3Section II (certification pathways in software engineering and security)
Assignment25%CO4, CO5Sections V, VI, VII, X (security analysis, ethical reasoning)

14.8 Self-Assessment Checklist

Before the assessment, confirm you can do each of the following without referring to notes:

End of Unit II

Software Development, Version Control & Cyber Security
CSE111 — Orientation to Computing
Build with Process · Version Everything · Secure by Design