Module 16 of 17

Building Malware-Resistant Software

Apply SSDF, SLSA 1.2, signing, provenance, SBOMs, least privilege, and safe rollback.

4 hours1 exercisesFree

Start here

Learning objectives

  • Threat-model the source, build, package, update, plugin, and runtime trust boundaries of a developer product.
  • Apply NIST SSDF practices to reduce vulnerabilities and protect software from tampering.
  • Explain how SLSA 1.2 provenance, signatures, and policy work together without treating any one control as sufficient.
  • Use an SBOM as inventory evidence while recognizing what it cannot prove.
  • Design least-privilege installation, safe update, rollback, and incident-readiness controls.

Before

  • Trust the CI badge
  • Sign one artifact
  • Run updater as administrator
  • Hope rollback works

After

  • Verify the trust path
  • Enforce provenance and policy
  • Separate verification from privilege
  • Exercise revocation and recovery
Building Malware-Resistant Software defensive workflow A four-step flow from Protect source through Observe and recover. The diagram describes defensive analysis only. Building Malware-Resistant Software Observe evidence, test a hypothesis, choose a control, and record uncertainty. Protect source step 1 Harden build step 2 Verify release step 3 Observe and recover step 4 Course rule: no live malware, weaponized payloads, stealth, persistence, credential access, or public callbacks.

Design the Trust Path

Software reaches a user through a chain of trust decisions: contributor identity, source review, dependency resolution, build workers, release approval, artifact storage, update metadata, installer privilege, plugin loading, runtime permissions, telemetry, and recovery. An attacker needs only one weak boundary; a developer needs a coherent policy across the path.

Draw the path before selecting tools. Mark who can change source, workflow, dependency policy, build inputs, signing configuration, release metadata, and update channels. Mark where untrusted data enters and where a component crosses into greater privilege. Record which evidence a verifier can check independently.

Secure by design means the safe path is the default path. Users should not need hidden flags or expert knowledge to verify an update, disable an unnecessary plugin, recover a previous version, or operate the product with limited privilege.

Use the SSDF as an Engineering Backlog

NIST SP 800-218 organizes secure software development into four practice groups: Prepare the Organization, Protect the Software, Produce Well-Secured Software, and Respond to Vulnerabilities. Use the SSDF to find gaps in responsibilities, environments, source protection, component review, secure design, verification, release integrity, vulnerability intake, remediation, and lessons learned.

The SSDF is outcome-oriented. Translate each selected practice into an owner, repository or platform control, evidence, review cadence, and exception process. A policy document without automated guardrails and verifiable evidence will drift from daily engineering behavior.

Prioritize by product risk. A self-updating developer tool with organization credentials needs stronger release and runtime boundaries than a static documentation generator. Both still need provenance, dependency awareness, review, and a supported vulnerability-reporting path.

Signatures, Provenance, and SLSA 1.2

A signature can bind an artifact to a signing identity and reveal later modification. It does not prove the source was reviewed, the build was isolated, the dependencies were safe, or the signer was authorized for that release. Policy must decide which identities, workflows, repositories, and environments are trusted.

Provenance describes how an artifact was produced. SLSA 1.2 provides tracks and levels for improving supply-chain integrity, including a Build track focused on provenance and protections around the build process. Verify provenance against policy before promotion: expected source, immutable revision, approved builder identity, required parameters, and subject digest.

Keep signing authority separate from ordinary developer workstations. Protect release workflows with reviewed configuration, short-lived identity where supported, restricted permissions, independent approval for sensitive changes, and a tested response for key or identity compromise. Verification should fail safely without making recovery impossible.

SBOMs Support Decisions, Not Verdicts

A software bill of materials inventories components and relationships for a defined artifact. It can help answer which releases contain an affected component, where a transitive dependency entered, and which teams need to investigate. Common formats include SPDX and CycloneDX.

An SBOM does not prove a component was untampered, reachable, vulnerable in the deployed configuration, or absent when the generator had incomplete visibility. Record the generator, format version, artifact digest, completeness scope, and creation time. Sign or bind the SBOM to the release and verify that relationship.

Combine SBOM inventory with provenance, vulnerability intelligence, reachability or exposure context, runtime observations, and owner decisions. Do not publish internal component inventories without reviewing the security and licensing implications.

Least Privilege, Updates, Plugins, and Rollback

Installers and updaters are attractive trust boundaries because they often write executable content and request high privilege. Separate update checking, download, verification, staging, and privileged installation. Verify metadata and artifact identity before privilege is granted. Bind an update to the expected product, channel, version, and rollback policy.

Plugins should have explicit capabilities, isolated storage, version constraints, trusted distribution policy, and a kill switch. Loading arbitrary code into the main process gives a plugin all of the host application's authority. Where possible, move extensions into a constrained process or declarative interface and require user-visible permission changes.

Rollback must be safe as well as available. Prevent silent downgrade to a release with known security defects, preserve compatible data migrations, verify the rollback artifact, and keep a recovery channel independent from the primary updater. Build incident readiness into the product: release inventory, feature kill switches, trustworthy audit events, revocation policy, and an owned communication path.

Suggested Study Plan (4 hours)

The published duration includes active practice, not video playback alone. Complete each block with the course-owned evidence and retain the stated deliverable so another reviewer can reproduce your reasoning.

Study blockTimeRequired evidence
Guided lesson and primary-source review36 minutesAnnotated notes that separate observations, hypotheses, limits, and version-sensitive facts.
Worked evidence walkthroughs30 minutesReproduce the lesson's tables or decision flow and challenge at least two assumptions.
Independent practice rounds30 minutesApply the method to two alternate records in the sanitized evidence pack and compare the conclusions.
Required lab2 hoursA trust-boundary diagram, prioritized SSDF backlog, release verification policy, update and plugin architecture, and rollback acceptance checklist.
Knowledge check and review24 minutesAnswer the evidence check, review the rubric, and record one production follow-up.

Evidence Check

Question: A release has a valid signature and an SBOM. Does that prove it is safe to install?

Reveal the defensive reasoning

No. The signature proves a relationship to a signing identity and detects modification under that scheme; the SBOM provides component inventory for its stated scope. The verifier must still check signer authorization, source and builder provenance, artifact digest, policy, vulnerability and exposure context, update metadata, product and channel binding, and installation or rollback risk.

Primary References

Use these primary sources for the current standard or tool behavior. The course records framework versions so mappings can be reviewed when upstream guidance changes.

Real world

Where this shows up

  • Hardening a desktop or CLI auto-update channel
  • Adding provenance and signer policy to CI/CD promotion
  • Using an SBOM to scope component exposure across released versions
  • Constraining a plugin ecosystem and designing emergency revocation
  • Restoring a known-good version after a synthetic release-integrity incident

Production notes

Keep these close

  • Enforce branch, workflow, builder, signing, and promotion policy outside the artifact being verified.
  • Bind provenance and SBOMs to immutable artifact digests and retain them for the supported release lifetime.
  • Exercise signer compromise, update outage, revocation, rollback, and telemetry-loss scenarios.
  • Treat exceptions as expiring, owned risk decisions with compensating controls.

Common mistakes

What usually breaks

  • Treating a valid signature as proof that software is benign or correctly built
  • Generating an SBOM but not binding it to a specific release or using it during response
  • Giving an updater or plugin permanent broad privilege for convenience
  • Offering rollback without downgrade protection, data compatibility, or verified artifacts

Security risks

Threats to watch

  • A compromised signing identity can distribute trusted-looking artifacts if authorization policy is weak.
  • A mutable CI workflow or builder can produce signed artifacts from unauthorized inputs.
  • An over-privileged updater or plugin can expand the impact of a defect or compromise.
  • An untested revocation or rollback path can trap users on an affected release.

Tradeoffs

Design choices you should be able to defend

In-process plugin model

Pros

  • Simple API and high performance
  • Easy access to host features

Cons

  • Plugin receives host process authority
  • Faults and compromise share the same boundary

Constrained out-of-process extensions

Pros

  • Clearer capability boundary
  • Independent monitoring and termination

Cons

  • More complex API and lifecycle
  • Serialization and performance overhead

Automatic immediate updates

Pros

  • Fast security rollout
  • Low user effort

Cons

  • Update-channel failure spreads quickly
  • Needs staged release, verification, and rollback

Think like an engineer

Questions to answer before shipping

  • Which verifier can independently prove how this exact artifact was produced?
  • What happens when the signing identity is valid but no longer authorized?
  • Can an extension accomplish its job without sharing the host process and credentials?
  • How will customers recover if the normal update service is unavailable or untrusted?

Key terms

Vocabulary used in this module

SSDF

The NIST Secure Software Development Framework, a set of outcome-oriented practices for secure software development.

SLSA

A framework of tracks and levels for improving software supply-chain integrity.

Provenance

Verifiable information describing where, from what inputs, and by which process an artifact was produced.

SBOM

A software bill of materials that inventories components and relationships for a defined software artifact.

Revocation

A controlled decision that an identity, artifact, release, or authorization should no longer be trusted.

Exercises

Practice inside the lesson

2 hoursIntermediate

Harden a Fictional Developer Tool Release

Review a safe architecture packet and design verifiable source-to-update controls without executing or packaging software.

  1. Confirm the exercise uses only diagrams, manifests, fictional identities, sample policies, and inert metadata; no installer, plugin, package, or binary is provided.
  2. Map the source, dependency, build, signing, registry, update, plugin, installation, runtime, and rollback trust boundaries.
  3. Identify which SSDF practices address the five highest-risk gaps and assign an owner and evidence artifact to each.
  4. Write a release policy covering source revision, approved builder, SLSA 1.2 provenance, subject digest, signing identity, SBOM binding, and promotion approval.
  5. Redesign the updater so download, verification, staging, privilege, installation, health check, and rollback are separate observable stages.
  6. Define plugin capabilities, isolation, distribution policy, permission-change review, and emergency disablement.
  7. Create recovery acceptance tests for a revoked release identity, unavailable update service, failed health check, and safe rollback.

Expected evidence

A trust-boundary diagram, prioritized SSDF backlog, release verification policy, update and plugin architecture, and rollback acceptance checklist.

Assessment criteria

  • The trust map covers source through runtime and names who can change each sensitive stage.
  • The SSDF backlog has risk rationale, owners, evidence, review cadence, and exception handling.
  • Release policy verifies provenance, identity authorization, artifact digest, SBOM binding, and promotion context.
  • Updater and plugin designs minimize privilege and make verification and permission changes observable.
  • Rollback and revocation paths are safe, testable, and independent enough to support incident recovery.

Teardown

  1. Delete temporary packet copies and draft diagrams.
  2. Retain only the final trust map, policies, owned backlog, and rollback acceptance checklist.

Recap

Key takeaways

  • Malware resistance is a source-to-runtime trust design, not a single scanner or signature.
  • SSDF practices become useful when translated into owned controls and verifiable evidence.
  • Signatures, SLSA provenance, SBOMs, and policy answer different questions and work best together.
  • Least privilege, constrained plugins, staged updates, revocation, and safe rollback reduce incident impact.

Related resources

Keep learning across CodersSecret