PW.6 Harden compilation and build processes

PW.6 asks you to use compiler, interpreter and build tools that improve executable security, decide which features to enable and how to configure them, then implement and verify those choices.

On this page

What PW.6 asks for and why the decision is yours

If a customer, contract or agency asks you to attest to the NIST Secure Software Development Framework and PW.6 is the line nobody on your team can explain, the first thing to know is that PW.6 asks you to choose and verify, not to switch on a fixed list of settings. PW.6 sits in the Produce Well-Secured Software group of SP 800-218 and concerns how the compiler, interpreter and build tools you use turn source code into executables. It has two tasks. PW.6.1 asks you to use compiler, interpreter and build tools that offer features which improve the security of the resulting executables. PW.6.2 asks you to determine which of those features you will use, how each one should be configured, and then to implement those choices and verify that they are in effect.

NIST describes the SSDF as outcome-based rather than a checklist, so how each task is met is the organization's decision, based on risk, cost, feasibility and applicability. The notional examples attached to PW.6 are illustrations, and SP 800-218 does not require you to follow any of them. This is why PW.6 is harder to satisfy than its one-line summary suggests. The right answer depends on your toolchain, the languages your teams use (a C++ service, a Go binary and a Java application each expose different build options), and whether your build platform even allows a given setting. Confirm with your engineering leads which compilers, interpreters and build tools produce your release artifacts before you discuss PW.6 with an assessor.

The part auditors and customers test most closely is the record. You should be able to show which features you chose for each toolchain, why you chose them, the configuration you applied, and evidence that the build actually produced hardened output, such as build logs or verification results from a pipeline that is version controlled. A reasonable decision that is undocumented, or a documented setting that nobody verifies, leaves the task unmet. Plan for that record now. An implementation partner can help define the decision framework, configure build pipelines and gather verification evidence, but the organization owns the risk decisions and an independent assessor, not the partner, decides whether the evidence is sufficient.

Which build pipelines, toolchains and products fall under PW.6

PW.6 applies wherever software is compiled, interpreted, packaged or assembled into a release. The cards below separate the artifacts and tools that define that scope, so the organization can decide which features to use, how to configure them and where to verify the choices. The boundary matters because each separate toolchain or pipeline needs its own settings and evidence.

Products and release pipelines

Each product line that ships executables, libraries, containers or firmware has its own path from source to artifact. Record every release pipeline that produces a shipped artifact, including hotfix and patch paths that bypass the normal route. Check whether each pipeline applies the same hardening decisions as the main build, because emergency pipelines are where settings often drift. Confirm that the team can name the pipeline that built any released version.

SP 800-218 publication

Compilers and interpreters by language

Each language in the codebase brings its own compiler or interpreter and its own protective options, such as stack protection, position-independent executables or warning levels treated as errors. Inventory languages by product, not by company, because one product may mix C++, Python and Go. Treat each compiler version as a separate item to configure and verify. Record the option set chosen for each language so a reviewer can see the decision and its reason.

Build tools and package managers

Build systems such as make, Gradle, Maven, npm and similar tools control which flags, plugins and scripts run during a build. Their configuration files are part of the hardening decision, so changes to them need the same review as source code. Check which build tool features offer executable security options and which are left at defaults. Note any build tool plugin that rewrites output after compilation.

Build runners and images

Build runners and the container images they use set the compiler versions, system libraries and environment variables available to every build. Inventory each runner pool, its operating system image and its toolchain versions, and record how they are updated. Confirm that runners used for release builds are separated from those used for testing or experiments. Ask who can change a runner image and how that change is logged.

GitLab protected branches

Shared CI templates and vendored toolchains

Shared pipeline templates let many projects inherit one set of build options, which makes a single change reach every product. Vendored toolchains, such as a compiler copied into a repository, sit outside the normal update path and can keep old options long after the main toolchain changes. Identify every shared template and vendored toolchain, record its owner and check whether it is in scope. Third-party build steps fetched at build time also need to be listed.

How an assessor tests PW.6

This table walks through how an assessor would test each PW.6 task, what evidence they ask for and where teams usually fall short. Read it as a checklist of questions to answer before an assessment, since NIST treats SSDF practices as outcomes to meet rather than fixed steps.

Assessment stepWhat the assessor checksEvidence requestedCommon finding
PW.6.1 toolchain featuresThe compiler, interpreter and build tools in use offer features that improve executable security, such as hardening or warning flagsTool names and versions, vendor documentation for the relevant features, and the build image or toolchain definitionToolchain versions are recorded but no one has checked which hardening features those versions actually provide
PW.6.2 decision recordThe organization decided which features to use, why, and how each one is configuredA written decision record per toolchain listing each feature, its setting, the risk or applicability reasoning and the owner who approved itFeatures are enabled, but no record explains why others were left off or what trade-off was accepted
Build definition alignmentThe chosen settings appear in the build scripts, CI configuration and build tool files that produce released artifactsPipeline configuration files from the repository, build logs showing the flags in use, and the commit history for changes to themSettings appear in a developer's local build file but are missing from the CI pipeline that produces release builds
Verification of the configurationThe organization checked that the settings took effect in the built executables and kept them in place over timeVerification results such as binary inspection output, test reports or scheduled checks, with dates and the person or job that ran themVerification was done once during setup and never repeated after toolchain or pipeline changes
Change control over settingsChanges to compiler or build settings go through review, so weakened options cannot slip in unnoticedProtected branch or merge request settings covering build configuration paths, and review records for recent changesBuild configuration files sit outside review rules, so a single contributor can disable a hardening flag
Exceptions and deviationsAny feature not used has a documented reason and, where needed, compensating controlsException records with approver, reason, scope and review dateExceptions exist only as informal comments in code or chat threads
Coverage across productsEvery product and build target the organization releases follows the same decision record or documents its ownInventory of build targets mapped to decision recordsA legacy or internal tool is built with default settings and was never included in the review
Context from SP 800-53 referencesSP 800-218 lists SA-15 and SR-9 as related references for PW.6 tasks, so assessors may also look at how development and supply chain processes support these settingsEvidence that the build process is covered in the development and supply chain controls the organization already maintainsBuild hardening is documented separately from the broader development and supply chain controls, so the connection is hard to show

How to implement PW.6 in five steps

This sequence turns PW.6 from a general intention into documented, version-controlled build settings that can be verified each time a toolchain changes. Each step produces an artifact an assessor or customer can review.

  1. Inventory toolchains for each product

    Start by listing every compiler, interpreter and build tool used to produce each shipped product, including versions, container base images, CI runners and any vendor-supplied toolchains. Engineering leads and build owners should own this list, because gaps here cause the rest of the work to miss components. The step is done when each product has a named toolchain record that the build owner has confirmed against the actual build pipeline, not against memory or old documentation.

  2. Research hardening features for each tool

    For each tool on the inventory, the security or platform team reviews the executable-security features it offers, such as memory protection, control-flow hardening, warnings treated as errors and secure defaults for linking. Use the vendor documentation for the exact version in use, and note which features the tool supports at all. The output is a feature matrix per toolchain that lists each feature, what it protects against in general terms, and whether it is available in the version the team runs.

  3. Record the decision and configuration rationale

    For each feature, decide whether to enable it, leave it off or enable it with a specific configuration, and write down the reason. Reasons should reference risk, compatibility, performance cost and whether the team can verify the setting, since NIST describes the SSDF as outcome-based rather than a checklist. Security leadership should approve the record. The step closes when each feature has an enable, disable or exception entry with an owner, a rationale and a review date set by the organization.

  4. Encode settings in version-controlled build definitions

    Translate the approved decisions into the build definitions the pipeline actually reads, such as compiler flags in build scripts, container build files, CI job templates and build tool configuration files. Store these in the same repository workflow as application code so changes go through review. Protected branches in a platform such as GitLab can restrict who may merge changes to those files. The step is done when a clean build from the main branch applies the configured settings and the resulting build logs show them.

  5. Verify settings and re-verify after toolchain upgrades

    Confirm the settings took effect in the built artifacts, using build log checks, binary inspection tools or test builds that deliberately trigger a warning, and record the results against each task. Then add a repeatable check to the pipeline so any toolchain upgrade, base image change or build configuration edit triggers re-verification. Owners should note that a flag accepted by one compiler version may be ignored or renamed in another. The output is a verification record per product, and the step only closes when a toolchain change has been re-verified against the same records.

Deciding and documenting which build features to use

For compiled languages such as C, C++, Go, Rust and Java-based native outputs, the build decision usually concerns the compiler and linker. Teams should list each target build (for example, each release platform and architecture), then record which compiler and linker features are enabled, the configuration value chosen for each, and the reason tied to the risk the feature addresses. Compiler versions matter because feature support and defaults change between releases, so the record should name the exact toolchain version used for each release.

  • Feature inventory: List every hardening-relevant feature the toolchain offers for each target, including those left off.
  • Configuration values: Record the exact setting for each feature, stored in the build configuration that produces the release.
  • Risk reason: Tie each enabled feature to the vulnerability class it reduces, such as memory corruption or unsafe loading.
  • Accepted exceptions: Document any disabled feature, the owner who approved it, the expiry date and the compensating control.
  • Verification evidence: Keep a build log or test output showing the feature was active in the released binary.

Check that each release binary can be traced to a recorded toolchain version and configuration, and that the record is updated when the compiler changes.

Evidence that satisfies PW.6 and how to keep it current

PW.6 is met through a chain of records: what was decided, how the build is configured, what ran, what was checked and what was accepted as an exception. Each artifact should be versioned and tied to the toolchain it describes, so the set stays accurate between assessments. The cards below cover each artifact and the routine that keeps it current.

Feature decision record

This is the written record of which compiler, interpreter and build tool features the organization chose for PW.6.2, and why. For each language and toolchain, note the feature, the configuration selected, the risk or cost reasoning and the named owner who approved it. Because SP 800-218 leaves the choice to the organization based on risk, cost and feasibility, this record is what shows the decision was deliberate. Check that every production language in the portfolio has an entry.

PW.6 tasks
2 tasks
SP 800-218 text

Versioned build configuration

Store compiler flags, linker options, build tool settings and hardening switches in version control alongside the code they build. Each change should go through a reviewed merge request, so the history shows who changed a setting, when and why. Confirm that the repository's protected branch rules prevent unreviewed edits to build files. Tie each configuration file to the toolchain version it was written for, since flag names and defaults change between releases.

CI logs showing applied settings

Build logs should show the hardening options actually passed to the compiler or build tool on each run, not only the configuration file. Print the effective flags in the pipeline output and retain logs for the period your assessment window requires. Sample a release build and confirm the flags in the log match the decision record. A mismatch between the documented setting and the logged setting is a finding an assessor will look for first.

Verification results

PW.6.2 requires that chosen features are implemented and verified. Keep reproducible verification output, such as a test build that fails when a hardening flag is removed, a binary inspection report or a scan result that confirms the protection is present in the compiled artifact. Store the results with the build identifier and date. Ask the team to state which check covers each feature, so verification is traceable rather than assumed.

Exception records

Some features will not be enabled for a given component, for example because a legacy library breaks under a flag or a platform does not support it. Record each exception with the component, the feature not used, the compensating control, the risk owner's approval and an expiry or review date. Without this record, a missing flag looks like an oversight. Ask whether any exception has passed its review date without renewal.

Review history and upkeep routine

Schedule a periodic review of the decision record and build configuration, and log each review with its outcome and reviewer. Add a specific trigger for toolchain upgrades: when a compiler, interpreter or build tool changes major or minor version, re-check defaults, deprecated flags and newly available features, then update the decision record before the new toolchain reaches production. Ask your implementation partner or auditor which review cadence they expect, since the organization sets its own.

What meeting PW.6 costs in money and effort

This table breaks down the cost components of configuring compilers, interpreters and build tools for PW.6, showing who is paid for each, whether it is one-time or recurring, and what drives it up. Use it to build a quote request and to decide which parts to keep in-house. No figures are given because none were supplied for this practice; ask vendors and providers for written estimates based on your own products and toolchains.

Cost componentOne-time or recurringWho is paid, and what drives it
Engineering research and configurationOne-time per toolchain, then recurring on upgradesInternal engineers or an implementation partner research hardening flags for each compiler, interpreter and build tool, then set them. Driven by the number of languages and build systems in use.
Tooling licensesRecurring if commercial, often none for open sourceSelf-hosted open-source build and scanning tools, such as Semgrep Community Edition, can remove license spend. Commercial add-ons and support contracts still carry recurring fees. Confirm license terms before deployment.
Verification and testing of hardened buildsOne-time for baseline, recurring per releaseEngineers confirm hardening options are active in produced binaries and that builds still function. Driven by the number of products, target platforms and release frequency.
Documentation of chosen features and settingsOne-time setup, recurring upkeepWriting down which features are used, why, and how each is configured. Costs rise when decisions are scattered across pipeline files with no single record.
Evidence upkeep after toolchain changesRecurringEach compiler, interpreter or build tool upgrade can change default behavior or flag support, so configuration and evidence must be rechecked. Driven by how often toolchains change and how many pipelines share them.
External review by a consultant or assessorUsually one-time readiness, optionally recurringOutside reviewers check the decision record and sample build outputs before an assessment. Ask for a fixed scope in writing, including which products and pipelines are covered.
Auditor sampling and testingRecurring per assessment cycleIndependent auditors select products and builds to test. The number of products, pipelines and sampled releases drives the effort. Ask your auditor how samples are chosen before you prepare.

Open-source tools that support PW.6 evidence

These tools cover the controls and records around the build rather than the build itself. Each card names the evidence it produces for PW.6 and the license terms to confirm before adoption. Read the final card first if licensing is a procurement question.

GitLab protected branches

GitLab Community Edition (MIT) protected branches let maintainers limit which roles can push or merge to a branch. Setting push access to no one blocks direct pushes, and force pushes stay disabled unless explicitly allowed. For PW.6, apply this to the branch that holds CI pipeline files and compiler or build tool configuration, so changes to how executables are built pass through a controlled merge. Evidence is the protected branch configuration and the merge history showing who changed build settings. Confirm which approval rules your edition and plan support before relying on them.

GitLab protected branches docs

Semgrep scans in CI/CD

Semgrep Community Edition (LGPL-2.1-only) scans code in languages including C/C++, Go, Java, Rust and Python, and can run in CI/CD pipelines to scan repositories continuously. Each pipeline run produces findings that show which code was checked against which rules. For PW.6, its contribution is indirect: it can surface insecure code patterns that affect executables, but it is not designed to confirm that a binary was built with hardening enabled. Ask which rulesets run on each branch and keep those results as build-stage evidence.

Semgrep supported languages

Dependency-Track SBOM records

OWASP Dependency-Track (Apache-2.0) consumes and produces CycloneDX SBOMs and VEX, so the components that feed your build can be recorded per project and version. Upload an SBOM generated from each build and the platform keeps the component inventory as a dated record. For PW.6, this is the evidence that shows which libraries and packages went into a given executable. Confirm that your build tooling can produce CycloneDX output and that each release links to its SBOM.

Dependency-Track docs

Component risk and license findings

Dependency-Track identifies components with known vulnerabilities, outdated or modified components and license risk, and tracks license use by component with SPDX license IDs. Review these findings before a release is built, and record the decision in VEX where a vulnerability does not affect your build. Modified components deserve particular attention because a changed upstream package can alter the executable without a version change. Ask who triages findings, how long they stay open and whether the analysis is kept with the release record.

Licenses and what none of them does

GitLab Community Edition is MIT licensed, Semgrep Community Edition is LGPL-2.1-only, and Dependency-Track is Apache-2.0. Each license governs how you may use, modify or redistribute the software, so have counsel confirm the terms for your deployment model, especially if you distribute modified copies. None of these tools directly enables compiler hardening flags. Your compiler and build tool configuration must still implement the PW.6.2 choices, and these tools only record and review the evidence around them.

Who does what: your team, a partner and the auditor

Your organization owns the decision. SP 800-218 is outcome-based, so NIST leaves it to you to decide which compiler, interpreter and build tool features reduce risk for your software, based on risk, cost, feasibility and applicability. That decision, and the reasons behind it, must be written down and approved by someone accountable for the product. Your team also owns the build configuration that results from it, because the settings live in your repositories and pipelines.

  • Decision record: the list of features you chose to use, the ones you declined, and the reasons for each.
  • Accountable owner: a named role, such as the product security lead, who approves changes to the decision record.
  • Build configuration: the flags, toolchain versions and pipeline definitions that enforce the decision, kept under version control.
  • Exception handling: a documented route for teams that cannot apply a setting, with a time-limited risk acceptance.
  • Periodic review: a scheduled check that the decision still fits new compiler releases and the software's threat profile.

Before an audit, confirm that someone inside the organization can explain every feature choice without relying on a consultant's memory.

Where PW.6 usually fails and how to close each gap

PW.6 asks for a deliberate choice of compiler, interpreter and build tool features, applied consistently and checked after each change. Most failures come from the same few places: the decision is never written down, the settings live on laptops instead of in the build, or the configuration changes without anyone noticing. The cards below cover each gap with a closing action you can assign and verify.

No documented decision

PW.6.2 expects the organization to determine which compiler, interpreter and build tool features it uses and how each is configured. Without a written record, an assessor cannot tell whether the choice was deliberate or accidental, and teams drift toward defaults. Record each chosen feature, its configuration value, the toolchain version it applies to, and the risk reason for enabling or skipping it. Closing action: store this record in the repository beside the build definition and assign an owner who reviews it when the toolchain changes.

Features enabled only on laptops

Developers often turn on hardening flags in local IDE settings or personal build scripts, while the CI pipeline that produces release artifacts uses a bare configuration. The shipped binary then lacks the protections the team believes it has. Compare the flags used by local builds with those in the release pipeline, and confirm that the artifact you deliver was built with the documented set. Closing action: move the flags into the shared build configuration so that every build, local or automated, reads the same source.

Settings drifting after upgrades

A compiler or build tool upgrade can change default behavior, rename options, or silently drop a flag that was previously accepted. Teams that upgrade without re-checking the hardening configuration may ship weaker builds for months before anyone notices. Check the effective flags in the build output after every toolchain change, not only the flags in your configuration file. Closing action: add a pinned toolchain version and a build step that prints the active hardening options, so a change appears in the build log before a release.

No verification record

PW.6.2 requires the chosen features to be implemented and verified, and verification is the evidence an assessor asks for first. A configuration that exists in a file proves intent, not effect. Keep a record showing that each documented feature was present in the produced binary, with the build identifier and date. Closing action: run an automated check against release artifacts, such as inspecting the binary for the expected protections, and retain the output with the build record.

Build definitions editable without review

If anyone with write access can change the pipeline file or the branch that builds releases, a hardening flag can be removed in a single commit without review. Protect the branches and the build definition the same way you protect the code that runs. In GitLab, protected branches can restrict who may push or merge, block direct pushes, and keep force pushes disabled unless explicitly allowed. Closing action: confirm that changes to the build configuration require a reviewer who is not the author, and test this by attempting a direct push to the release branch.

GitLab protected branches

PW.6 questions buyers ask before hiring help

How much effort does PW.6 take to meet?

Effort depends mostly on how many build pipelines, languages and release targets the organization runs, and on how many compiler, interpreter and build tool features it already uses. PW.6 has two tasks in NIST SP 800-218: PW.6.1 asks the team to use build tools that offer executable-hardening features, and PW.6.2 asks it to decide which features to use, configure them, implement the choices and verify them. The first task is mostly an inventory and tooling question. The second is where the work grows, because each decision needs a recorded rationale and a test that shows the setting is actually applied. Ask any provider to size the work by pipeline count and language mix rather than by a single headline figure.

Can our team handle PW.6 without outside help?

Often yes, if the team already owns its build scripts and has someone who can read compiler documentation. The SSDF is outcome-based and is not a checklist, so the organization decides how each task is met based on risk, cost, feasibility and applicability. That makes internal ownership workable, but it also means someone must write down the decisions and keep them current. Outside help is most useful when build configuration is spread across many teams, when nobody has verified the flags in release artifacts, or when a customer asks for evidence the internal team has not produced before. Confirm internal capacity against the tasks above before deciding.

How long does it usually take to prepare PW.6 evidence?

No supplied figure gives a standard duration, so treat any number a vendor quotes as a claim to test. The timeline is driven by how many pipelines need changes, whether build tools must be upgraded to support the features you choose, and how long it takes to verify settings across release targets. Teams with a small number of pipelines that already pin tool versions usually move faster than teams with many legacy builds. Ask for a written plan that lists each pipeline, the decision record for each feature, the verification step and the retest date, so you can measure progress against it.

What does PW.6 need from the engineering team?

PW.6 needs build engineers and release owners to take part, not only security staff. The work requires access to build definitions, the ability to change compiler and build tool settings in a controlled way, and time to test that a release still builds and runs after the change. Engineers also need to record why each feature is enabled or set to a given value. The main inputs are:

  • Current build scripts and CI/CD configuration for every release target
  • Compiler, interpreter and build tool versions in use
  • A way to inspect built artifacts or build logs to confirm the chosen settings were applied
  • A review path so changes to build settings go through the same approval as code changes
Is the SSDF a checklist I can tick off for PW.6?

No. NIST states that the SSDF is outcome-based and is not intended to be a checklist, but a basis for a risk-based approach to secure software development. For PW.6, that means the organization chooses which compiler, interpreter and build tool features to use and how to configure them, then records those choices and proves they were implemented. NIST also says the notional implementation examples are not required. A customer or assessor will therefore ask why a setting was chosen, what risk it addresses and how you verified it. Prepare a decision record for each feature rather than a yes or no answer for each task.

What will a PW.6 partner deliver, and what will it not deliver?

A partner such as DeployOpen can plan, implement and document the build hardening work in your own infrastructure, and it can test whether the chosen settings hold in the built output. Within a fixed scope, typical deliverables include an inventory of build pipelines, configuration changes, a decision record for each feature, verification results and a retest. A partner does not own your controls, does not decide your risk tolerance on your behalf, and does not issue attestations or certifications. Only an independent auditor, assessor or certification body issues reports or certificates. Confirm the deliverables, acceptance criteria and exclusions in writing before work starts.

Which open-source tools support PW.6 evidence, and what do they cover?

Open-source tooling can support the process around PW.6 without replacing the build decisions. GitLab Community Edition protected branches help restrict who can change the pipeline definitions that set build flags, which supports change control over the build. Semgrep Community Edition can scan code in CI/CD pipelines, though it does not by itself verify compiler flags. OWASP Dependency-Track, which consumes CycloneDX SBOMs, helps track the components that go into a build. Confirm with each project whether it reports on the specific compiler or linker settings you need, because none of these tools should be assumed to verify PW.6.2 on its own.

How the PW.6 decision flows from toolchain to verified build

The flow starts with an inventory of the compilers, interpreters and build tools the team actually uses, since PW.6.1 can only be met for tools already in view. Each feature is then assessed against the organization's risk, cost, feasibility and applicability, which is the judgment NIST leaves to the organization under the outcome-based approach. The chosen settings are written down, placed in build definitions, and checked by a verification step in CI. Evidence is recorded and the settings are re-verified whenever a toolchain is upgraded, because a version change can alter which features exist or their defaults.

Steps from toolchain inventory to verified build and re-verification on upgrade.

How DeployOpen prepares PW.6 evidence

DeployOpen works on PW.6 by first agreeing with the client which compiler, interpreter and build tool features matter for their software and environment. It then configures and verifies those choices inside the client's own build infrastructure, so the client's teams can review and maintain the evidence. The client keeps ownership of the decisions and the controls.

How we scope

  • The written scope lists the languages, build tools and pipelines that PW.6 covers for your software.
  • Scope records which build hardening features the team will evaluate and the risk reasons for each choice.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before any work starts.

How we build

  • We configure compiler and build tool settings in your pipelines and record each configuration value used.
  • We set up repository controls such as protected branches so build configuration changes need an approved review.
  • We verify each hardening setting with a test build or scan, and keep the results alongside the configuration.

How we hand over

  • You receive documented decisions for each PW.6.2 choice, including the reasoning, configuration and verification steps.
  • Build pipeline configuration and change history are delivered in a form your security and compliance teams can review.
  • Your organization decides whether the evidence satisfies its own risk criteria, and any independent assessor reviews it separately.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers when build tools change.
  • Retesting after pipeline or toolchain upgrades confirms that the chosen hardening features still apply as configured.
  • Confirm with your team which tool versions and features your build environment supports before finalizing the scope.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.