For the complete documentation index, see llms.txt. This page is also available as Markdown.

Policy as Code

Policy as Code lets you define Fortify SCA automation policies in a standalone JSON file and include them in a scan request.

Policy as Code lets you define Fortify SCA automation policies in a JSON file. Include the file with a scan request.

Name the policy file debricked_policy.json. It is independent of debricked.config. Use it to:

  • Keep security and compliance policies under version control.

  • Apply policies to stateless scan requests.

  • Include policies in Fortify on Demand (FoD) scan payloads.

  • Define consistent, deterministic automation behavior.

  • Validate policies before executing automation rules.

  • Manage policy configuration alongside application configuration.

The debricked_policy.json file contains three main sections:

  • schemaVersion

  • settings

  • automations

Each automation rule defines:

  1. Conditions that determine when the rule matches.

  2. Actions that Fortify SCA performs when those conditions match.

Getting started

Create a JSON file named debricked_policy.json. This minimal example creates one automation rule:

Use the supplied sample debricked_policy.json file as a starting point. Then modify its rules for your organization.

File structure

schemaVersion

schemaVersion identifies the Policy as Code contract version. Use the following value for version 1:

Fortify SCA rejects unsupported schema versions during policy validation.

settings

The settings object controls how Fortify SCA processes the policy file.

Value
Behavior

fileOnly

Evaluates only the rules in debricked_policy.json for the scan request.

mergeWithWebappRules

Evaluates file rules together with rules configured in Fortify SCA.

invalidPolicyBehavior

invalidPolicyBehavior determines how Fortify SCA handles an invalid policy file.

Value
Behavior

fail

Fails the scan request when the policy file is invalid.

warn

Reports a warning when the policy file is invalid.

Defining automation rules

Define automation rules in automations.rules. Each rule contains enabled, conditions, and actions.

Enable or disable a rule

Set enabled to true to evaluate a rule. Set it to false to keep it in the file without evaluating it.

Conditions

Conditions define what must match before Fortify SCA executes a rule's actions.

Property
Description

subject

The item or attribute being evaluated.

op

The comparison operator.

value

The comparison value or values. Supply values as an array.

conj

How the condition combines with other conditions in the rule.

Supported condition subjects

  • vulnerability

  • dependency

  • branch

  • cvss

  • rule

  • license

  • licenseFamily

  • licenseRisk

  • vulnerabilityDiscoveredDate

  • securityScore

  • contributorScore

  • popularityScore

  • scope

  • licenseReviewStatus

  • dependencyDepth

  • cve

  • dependencyAge

  • dependencyVersion

Supported condition operators

  • is

  • less

  • greater

  • is_not

  • untriggered

  • is_more_than

  • is_in

  • is_less_than

Combining conditions with AND and OR

Use conj to control condition grouping:

  • and keeps the condition in the current group.

  • or starts a new OR group.

Fortify SCA evaluates conditions using this pattern:

Mixed AND/OR example

This rule matches either group:

  • CVSS is greater than low and the branch is feature.

  • The dependency is in denied_list and CVSS is greater than medium.

Dependency lists

When subject is dependency and op is is_in, use one of these list values:

  • allowed_list

  • denied_list

  • allowed_list_direct_only

  • denied_list_direct_only

Actions

Action
Purpose

failPipeline

Fails the pipeline when the rule matches.

warnPipeline

Generates a pipeline warning.

markUnaffected

Marks matching vulnerabilities as unaffected.

markVulnerable

Marks the matching item as vulnerable.

ignoreIfMarkedUnaffected

Ignores vulnerabilities already marked as unaffected.

notifyEmailAddresses

Notifies the specified email addresses.

notifyRoles

Notifies users assigned the specified roles.

webhookUrl

Specifies the webhook destination.

webhookSecret

Specifies the secret associated with the webhook.

Troubleshooting

The policy file is rejected

Verify the following:

  • The file contains valid JSON and is named debricked_policy.json.

  • schemaVersion is set to "1.0".

  • executionMode and invalidPolicyBehavior use supported values.

  • automations.rules contains at least one rule.

  • Each condition uses a supported subject, operator, and value format.

  • No rule sets both failPipeline and warnPipeline to true.

  • No rule sets both markUnaffected and markVulnerable to true.

A rule is not evaluated

Verify the following:

  • enabled is set to true.

  • The rule is defined under automations.rules.

  • The condition values match the scanned project.

  • The selected operator is supported for the condition subject.

  • The AND/OR grouping matches the intended logic.

  • The selected execution mode includes the rule source.

Web application rules are not evaluated

When executionMode is set to fileOnly, only rules defined in debricked_policy.json are evaluated.

To evaluate file-based rules together with rules configured in the web application, set executionMode to mergeWithWebappRules.

Last updated

Was this helpful?