Skip to main content

GOST R 56939-2024 assessment workflow

Collect evidence and assess 25 secure-development processes against GOST R 56939-2024 with the CodeGraph CLI. Compare statuses with the saved report.

Enterprise

Engineering leads and security specialists need to see which secure-development materials are available and what to prepare for the next review. CodeGraph maps project artifacts to the 25 process identifiers in section 5 of GOST R 56939-2024. The report shows each process status and its evidence; stored history lets the team compare two assessments.

Start with the artifact checklist, generate the report and traceability matrix, then save the results. This gives the team a shared work list: add materials, review links to code and tests, and compare changes with the previous assessment.

Assessment commands

The report supports an internal assessment. It does not grant certification or replace an independent assessment against the standard.

The report workflow is currently CLI-based:

  • python -m src.cli compliance gost-56939
  • python -m src.cli compliance checklist
  • python -m src.cli compliance traceability
  • python -m src.cli compliance history
  • python -m src.cli compliance delta

The CLI generates reports, artifact checklists, and traceability matrices, saves assessment history, and compares assessments. The dashboard gets its heatmap from /api/v1/compliance/heatmap.

Reproducible assessment

Use PowerShell with the installed CodeGraph Python environment. Change to the root of the project being assessed; python -m src.cli must remain available there. The collector and traceability builder read files relative to the current directory. --project only names the report; it does not select a source directory. Pass the matching DuckDB path explicitly. Without --project, the name is the database filename stem, or unknown if no database is given.

Enable security.local_cli_enabled: true in this project’s config.yaml for local execution. Merge the configuration below into the existing file and retain its other sections. Create the data directory for history. The matrix queries the CPG through a running GoCPG server: configure its address and access to the selected database using the gRPC guide.

For a local server, open a separate PowerShell window. Replace <GOCPG_BINARY> with the installed executable path and <CPG_DIRECTORY> with the directory containing the selected database. Keep this window open during the assessment:

$GoCPG = "<GOCPG_BINARY>"
$CpgDirectory = "<CPG_DIRECTORY>"
& $GoCPG serve --host 127.0.0.1 --port 50051 --data-dir $CpgDirectory

The configuration below uses the same 127.0.0.1:50051 address. If your installation uses another port, update both the command and grpc_port. If the connection is already configured under project_import.gocpg, update that section: it takes precedence over the top-level gocpg section.

In the window with the CodeGraph Python environment activated, specify its checkout root (<CODEGRAPH_ROOT>) and the assessed project root (<PROJECT_ROOT>). Replace the database path in $CpgDb:

$CodeGraphRoot = "<CODEGRAPH_ROOT>"
$env:PYTHONPATH = $CodeGraphRoot + [System.IO.Path]::PathSeparator + $env:PYTHONPATH
$ProjectRoot = "<PROJECT_ROOT>"
Set-Location -LiteralPath $ProjectRoot
$ProjectName = "my-project"
$CpgDb = "D:\codegraph-data\my-project.duckdb"
New-Item -ItemType Directory -Path "data", "reports" -Force | Out-Null

python -m src.cli compliance checklist --project $ProjectName --db $CpgDb --format json

python -m src.cli compliance gost-56939 --project $ProjectName --db $CpgDb --format markdown --language en --include-traceability

The checklist shows available and missing artifacts for the 23 processes with configured collectors. Staff training (5.2) and decommissioning (5.25) use organizational evidence. The final report contains all 25 processes.

Check the project name, process count, and artifacts behind each status. In JSON, these are project_name, summary.total, and processes. The second command writes the report to stdout. To save a file, pass --output:

python -m src.cli compliance gost-56939 --project $ProjectName --db $CpgDb --format gost --language en --include-traceability --output "gost-56939-report.md"

Use --auto-collect only when the assessment is authorized to generate missing inputs. --force-collect bypasses the collection cache only when --auto-collect is also set; it can take longer. Record those flags because they change how evidence was obtained.

History and comparison

Save the first assessment with --save-history. After changing the project artifacts, run the command again and save a second report. Use the two printed identifiers to compare them:

python -m src.cli compliance gost-56939 --project $ProjectName --db $CpgDb --format json --save-history --output "gost-56939-before.json"

# Repeat after changing the project artifacts.
python -m src.cli compliance gost-56939 --project $ProjectName --db $CpgDb --format json --save-history --output "gost-56939-after.json"

python -m src.cli compliance history --project $ProjectName --limit 10

python -m src.cli compliance delta --old "<older-report-id>" --new "<newer-report-id>"

Replace both quoted report-ID placeholders with identifiers printed when saving the reports. With --save-history, a confirmation line follows the report on stdout. For JSON processing, use --output to keep the report file separate from that confirmation. History reads and writes use the configured SQLite store; opening a missing store can initialize it.

Generate a standalone traceability matrix when it is needed separately:

python -m src.cli compliance traceability --project $ProjectName --db $CpgDb --format markdown --output "gost-56939-traceability.md"

A delta compares stored assessments. Record the source revision, configuration, collection mode, and manual evidence with both report identifiers so the change has its full context.

After saving two reports, history shows two new rows with their identifiers and scores. If artifacts and settings are identical between runs, delta prints a +0.0% change and Unchanged: 25 processes. After changing inputs, review Improved and Degraded: these sections list processes whose status changed.

Traceability input example

Save the following educational SARIF as reports/example.sarif relative to the project root. It describes the input finding docs-example-89, CWE-89, and location source/sample.c:3. The matrix reads these fields from SARIF; this example checks the transfer of data from an external tool.

{
  "version": "2.1.0",
  "runs": [
    {
      "tool": {
        "driver": {
          "name": "Traceability example",
          "rules": [
            {
              "id": "DOCS-CWE-89",
              "properties": {
                "tags": [
                  "CWE-89"
                ]
              }
            }
          ]
        }
      },
      "results": [
        {
          "ruleId": "DOCS-CWE-89",
          "message": {
            "text": "Example input for the traceability matrix"
          },
          "locations": [
            {
              "physicalLocation": {
                "artifactLocation": {
                  "uri": "source/sample.c"
                },
                "region": {
                  "startLine": 3
                }
              }
            }
          ],
          "fingerprints": {
            "primaryLocationLineHash": "docs-example-89"
          }
        }
      ]
    }
  ]
}

Run the compliance traceability command above again. The gost-56939-traceability.md file will contain a CWE-89 row with location source/sample.c:3; the Findings column will show one finding. For this input with no linked tests, the status is partial. To check the finding identifier, save the matrix as JSON:

python -m src.cli compliance traceability --project $ProjectName --db $CpgDb --format json --output "gost-56939-traceability.json"

In the CWE-89 record, findings contains docs-example-89 and code_references contains source/sample.c:3. In a working project, use your tool’s SARIF output: findings and code locations are transferred in the same way.

Process registry

The registry below describes evaluation type and coverage. Actual status is derived from available artifacts and evaluator behavior at runtime.

The automated type uses programmatic artifact collection, external uses outputs from other tools, organizational uses organizational evidence, and mixed combines sources.

Process registry
Process Type Evaluation boundary
5.1 organizational Planning evidence; manual and collected inputs
5.2 organizational Staff training requires manual assessment
5.3 mixed Security requirements evidence
5.4 automated Configuration-management artifacts
5.5 mixed Defect-management artifacts
5.6 automated Architecture artifacts
5.7 automated Threat-model artifacts
5.8 automated Coding-standard artifacts
5.9 automated Code-review artifacts
5.10 automated Static-analysis artifacts
5.11 external Dynamic-analysis evidence from integrated tools
5.12 mixed Secure-build evidence
5.13 mixed Build-environment evidence
5.14 automated Access-control artifacts
5.15 automated Secret-protection artifacts
5.16 external Composition-analysis evidence
5.17 external Supply-chain evidence
5.18 mixed Functional-test evidence
5.19 mixed Non-functional-test evidence
5.20 mixed Release-security evidence
5.21 automated Delivery artifacts
5.22 organizational Support process requires organizational evidence
5.23 mixed Vulnerability-response evidence
5.24 automated Vulnerability-search artifacts
5.25 organizational Decommissioning requires manual assessment

Status and score

Each process is classified as FULL, PARTIAL, GAP, or N/A.

  • FULL contributes 1.0.
  • PARTIAL contributes 0.5.
  • GAP contributes 0.
  • N/A is excluded from the denominator.

The report percentage is the sum of applicable points divided by the count of applicable processes. The percentage reflects evidence recognized by the configured evaluators. Review it alongside the status and artifacts of each process.

manual_overrides can request a status for a process. A FULL override is guarded by the completion threshold and requires the associated completion evidence. Keep the override rationale, approver, and source artifact outside the generated report when governance requires it.

In JSON, the status values are full, partial, gap, and n_a. For example, one FULL, one PARTIAL, and one N/A process produce (1 + 0.5) / 2 × 100 = 75%. If every process is N/A, the model returns 0.0 and the applicable-process list is empty. FULL is assigned when the configured evidence threshold is reached: 0.8 by default. Open the process artifacts to review the basis for its status. Exit code 0 confirms report generation; GAP statuses and collection errors appear in the report itself.

Configuration

gocpg:
  grpc_host: 127.0.0.1
  grpc_port: 50051
security:
  local_cli_enabled: true
compliance:
  gost_56939:
    enabled: true
    auto_evaluate_on_audit: true
    store_history: true
    history_db_path: "data/compliance_history.sqlite"
    organizational_processes_status: "n_a"
    sarif_search_paths:
      - "data/"
      - "reports/"
    manual_overrides: {}
    content_check_min_bytes: 500
    content_check_read_limit: 8192
  • enabled controls the feature.
  • auto_evaluate_on_audit allows audit integration to request an assessment.
  • store_history and history_db_path configure stored assessment history.
  • organizational_processes_status is the default organizational status setting.
  • sarif_search_paths limits where SARIF evidence is searched.
  • manual_overrides supplies explicit per-process requests.
  • content_check_min_bytes and content_check_read_limit bound content-presence checks.

These are shared runtime settings. The explicit CLI report path reads history_db_path, sarif_search_paths, manual_overrides, and content-check limits. It does not consult enabled, auto_evaluate_on_audit, store_history, or organizational_processes_status to gate this command. In particular, store_history: true does not replace --save-history. Control history for this invocation with --save-history and local CLI access with security.local_cli_enabled.

Use installation-owned absolute or approved relative paths. Review generated reports before sharing them outside the organization because evidence locations, findings, and project metadata may be sensitive.

Traceability and evidence

The traceability output connects recognized requirements and CWE-related evidence to code, tests, findings, and fixes when those relations are available. An empty relation records that the collected evidence contains no link; evaluate the control through its configured sources.

For an auditable run, record:

  • source revision and project identity;
  • DuckDB identity and freshness;
  • configuration revision;
  • exact CLI command and exit code;
  • collection flags and input directories;
  • generated report and traceability hashes;
  • manual evidence and reviewer decision;
  • known missing or unavailable sources.

Failure and recovery

  • Unknown or database-derived project: rerun with --project and --db.
  • Missing artifacts: inspect checklist, correct input paths, then recollect.
  • Unexpected FULL or PARTIAL: inspect process artifacts and manual_overrides.
  • History missing: confirm --save-history and history_db_path.
  • Two reports cannot be compared: check both identifiers in the same history store. For an unknown identifier, the command prints Error: One or both report IDs not found and returns 1.
  • Runtime command succeeds but evidence is incomplete: keep the assessment open and complete the compliance review before recording the verdict.

Prepare evidence for the next assessment

Use process statuses to plan the next review. For GAP, collect the materials listed in the checklist. For PARTIAL, add evidence and review links to code and tests. For FULL, open the artifacts and retain the basis for the assessment. After updating the materials, generate another report and compare it with the previous run.