Skip to content

Add Fortify AST Scan workflow - #281

Open
drdave-flexnetos wants to merge 1 commit into
mainfrom
FlexNetOS-patch-2
Open

Add Fortify AST Scan workflow#281
drdave-flexnetos wants to merge 1 commit into
mainfrom
FlexNetOS-patch-2

Conversation

@drdave-flexnetos

Copy link
Copy Markdown
Owner

This workflow integrates Fortify Application Security Testing into GitHub workflows, enabling SAST and SCA scans.

This workflow integrates Fortify Application Security Testing into GitHub workflows, enabling SAST and SCA scans.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +68 to +71
FOD_URL: https://ams.fortify.com # Must be hardcoded or configured through GitHub variable, not secret
FOD_TENANT: ${{secrets.FOD_TENANT}} # Either tenant/user/password or client id/secret are required;
FOD_USER: ${{secrets.FOD_USER}} # these should be configured through GitHub secrets.
FOD_PASSWORD: ${{secrets.FOD_PAT}}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Avoid Fortify scan failing on forked pull requests

This workflow runs on every pull_request to main but the Fortify action is configured with FoD credentials from repository secrets (FOD_TENANT, FOD_USER, FOD_PASSWORD). GitHub does not expose repository secrets to pull_request events from forks, so any forked PR will execute this job with empty credentials and the Fortify login will fail before scanning. Consider restricting the trigger to trusted branches or adding an if guard to skip/short-circuit when secrets are unavailable so external PRs do not see immediate CI failures.

Useful? React with 👍 / 👎.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new GitHub Actions workflow for integrating Fortify Application Security Testing (AST) into the CI/CD pipeline, enabling Static Application Security Testing (SAST) and Software Composition Analysis (SCA) scans.

Key Changes:

  • Adds .github/workflows/fortify.yml workflow with triggers for push, pull requests, scheduled scans, and manual dispatch
  • Configures the Fortify GitHub Action (v1.6.2) with both SAST and Debricked SCA scanning enabled
  • Includes configuration templates for both Fortify on Demand (FoD) and Software Security Center (SSC) deployment options

Comment on lines +64 to +129
#############################################################
##### Fortify on Demand configuration
##### Remove this section if you're integrating with Fortify Hosted/Software Security Center (see below)
### Required configuration
FOD_URL: https://ams.fortify.com # Must be hardcoded or configured through GitHub variable, not secret
FOD_TENANT: ${{secrets.FOD_TENANT}} # Either tenant/user/password or client id/secret are required;
FOD_USER: ${{secrets.FOD_USER}} # these should be configured through GitHub secrets.
FOD_PASSWORD: ${{secrets.FOD_PAT}}
# FOD_CLIENT_ID: ${{secrets.FOD_CLIENT_ID}}
# FOD_CLIENT_SECRET: ${{secrets.FOD_CLIENT_SECRET}}
### Optional configuration
# FOD_LOGIN_EXTRA_OPTS: --socket-timeout=60s # Extra 'fcli fod session login' options
# FOD_RELEASE: MyApp:MyRelease # FoD release name, default: <org>/<repo>:<branch>
# DO_SETUP: true # Setup FoD application, release & static scan configuration
# SETUP_ACTION: <URL or file> # Customize setup action
# Pass extra options to setup action:
# SETUP_EXTRA_OPTS: --copy-from "${{ github.repository }}:${{ github.event.repository.default_branch }}"
# PACKAGE_EXTRA_OPTS: -oss -bt mvn # Extra 'scancentral package' options
# FOD_SAST_SCAN_EXTRA_OPTS: # Extra 'fcli fod sast-scan start' options
# DO_WAIT: true # Wait for successful scan completion (implied if post-scan actions enabled)
# DO_POLICY_CHECK: true # Fail pipeline if security policy outcome is FAIL
# POLICY_CHECK_ACTION: <URL or file> # Customize security policy checks
# POLICY_CHECK_EXTRA_OPTS: --on-unsigned=ignore # Pass extra options to policy check action
# DO_JOB_SUMMARY: true # Generate workflow job summary
# JOB_SUMMARY_ACTION: <URL or file> # Customize job summary
# JOB_SUMMARY_EXTRA_OPTS: --on-unsigned=ignore # Pass extra options to job summary action
# DO_PR_COMMENT: true # Generate PR comments, only used on pull_request triggers
# PR_COMMENT_ACTION: <URL or file> # Customize PR comments
# PR_COMMENT_EXTRA_OPTS: --on-unsigned=ignore # Pass extra options to PR comment action
# DO_EXPORT: true # Export vulnerability data to GitHub code scanning dashboard
# EXPORT_ACTION: <URL or file> # Customize export action
# EXPORT_EXTRA_OPTS: --on-unsigned=ignore # Pass extra options to export action
# TOOL_DEFINITIONS: <URL> # URL from where to retrieve Fortify tool definitions

#############################################################
##### Fortify Hosted / Software Security Center & ScanCentral
##### Remove this section if you're integrating with Fortify on Demand (see above)
### Required configuration
SSC_URL: ${{vars.SSC_URL}} # Must be hardcoded or configured through GitHub variable, not secret
SSC_TOKEN: ${{secrets.SSC_TOKEN}} # SSC CIToken; credentials should be configured through GitHub secrets
SC_SAST_TOKEN: ${{secrets.SC_CLIENT_AUTH_TOKEN}} # ScanCentral SAST client_auth_token, required if SAST scan is enabled
DEBRICKED_TOKEN: ${{secrets.DEBRICKED_TOKEN}} # Debricked token, required if Debricked scan is enabled
SC_SAST_SENSOR_VERSION: 24.4.0 # Sensor version to use for the scan, required if SAST scan is enabled
### Optional configuration
# SSC_LOGIN_EXTRA_OPTS: --socket-timeout=60s # Extra 'fcli ssc session login' options
# SC_SAST_LOGIN_EXTRA_OPTS: --socket-timeout=60s # Extra 'fcli sc-sast session login' options
# SSC_APPVERSION: MyApp:MyVersion # SSC application version name, default: <org>/<repo>:<branch>
# DO_SETUP: true # Set up SSC application & version
# SETUP_ACTION: <URL or file> # Customize setup action
# SETUP_EXTRA_OPTS: --on-unsigned=ignore # Pass extra options to setup action
# PACKAGE_EXTRA_OPTS: -bt mvn # Extra 'scancentral package' options
# EXTRA_SC_SAST_SCAN_OPTS: # Extra 'fcli sc-sast scan start' options
# DO_WAIT: true # Wait for successful scan completion (implied if post-scan actions enabled)
# DO_POLICY_CHECK: true # Fail pipeline if security policy outcome is FAIL
# POLICY_CHECK_ACTION: <URL or file> # Customize security policy checks
# POLICY_CHECK_EXTRA_OPTS: --on-unsigned=ignore # Pass extra options to policy check action
# DO_JOB_SUMMARY: true # Generate workflow job summary
# JOB_SUMMARY_ACTION: <URL or file> # Customize job summary
# JOB_SUMMARY_EXTRA_OPTS: --on-unsigned=ignore # Pass extra options to job summary action
# DO_PR_COMMENT: true # Generate PR comments, only used on pull_request triggers
# PR_COMMENT_ACTION: <URL or file> # Customize PR comments
# PR_COMMENT_EXTRA_OPTS: --on-unsigned=ignore # Pass extra options to PR comment action
# DO_EXPORT: true # Export vulnerability data to GitHub code scanning dashboard
# EXPORT_ACTION: <URL or file> # Customize export action
# EXPORT_EXTRA_OPTS: --on-unsigned=ignore # Pass extra options to export action
# TOOL_DEFINITIONS: <URL> # URL from where to retrieve Fortify tool definitions

Copilot AI Dec 6, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both Fortify on Demand (FoD) and Software Security Center (SSC) configurations are active simultaneously. The comments on lines 66 and 100 indicate these sections should be mutually exclusive ("Remove this section if you're integrating with..."), but both sections are present with uncommented configuration values. This will cause the workflow to attempt to connect to both services, which is likely unintended.

Recommendation: Comment out or remove the configuration section that is not being used. If using FoD, remove/comment lines 98-129. If using SSC, remove/comment lines 64-96.

Copilot uses AI. Check for mistakes.
Comment on lines +72 to +73
# FOD_CLIENT_ID: ${{secrets.FOD_CLIENT_ID}}
# FOD_CLIENT_SECRET: ${{secrets.FOD_CLIENT_SECRET}}

Copilot AI Dec 6, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both authentication methods for Fortify on Demand are partially configured. Lines 69-71 specify tenant/user/password authentication, while lines 72-73 show commented client ID/secret authentication. Having both credential sets configured (even with one commented) may lead to confusion about which authentication method is in use.

Recommendation: Remove or clearly document which authentication method should be used. If using tenant/user/password, remove the commented FOD_CLIENT_ID and FOD_CLIENT_SECRET lines. If using client credentials, comment out lines 69-71 and uncomment lines 72-73.

Suggested change
# FOD_CLIENT_ID: ${{secrets.FOD_CLIENT_ID}}
# FOD_CLIENT_SECRET: ${{secrets.FOD_CLIENT_SECRET}}

Copilot uses AI. Check for mistakes.
SSC_TOKEN: ${{secrets.SSC_TOKEN}} # SSC CIToken; credentials should be configured through GitHub secrets
SC_SAST_TOKEN: ${{secrets.SC_CLIENT_AUTH_TOKEN}} # ScanCentral SAST client_auth_token, required if SAST scan is enabled
DEBRICKED_TOKEN: ${{secrets.DEBRICKED_TOKEN}} # Debricked token, required if Debricked scan is enabled
SC_SAST_SENSOR_VERSION: 24.4.0 # Sensor version to use for the scan, required if SAST scan is enabled

Copilot AI Dec 6, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The SC_SAST_SENSOR_VERSION is hardcoded to version 24.4.0. Hardcoding specific versions in workflow files can lead to maintenance issues as versions become outdated. This value should either be:

  1. Configured through a GitHub variable for easier updates across workflows
  2. Documented with a comment about when/how to update it
  3. Referenced from a centralized configuration

Recommendation: Consider using ${{vars.SC_SAST_SENSOR_VERSION}} instead of hardcoding, or add a comment indicating this value should be reviewed and updated periodically.

Suggested change
SC_SAST_SENSOR_VERSION: 24.4.0 # Sensor version to use for the scan, required if SAST scan is enabled
SC_SAST_SENSOR_VERSION: ${{vars.SC_SAST_SENSOR_VERSION}} # Sensor version to use for the scan, required if SAST scan is enabled

Copilot uses AI. Check for mistakes.
# uses the commit id corresponding to version 1.6.2. It is recommended to check whether any later releases
# are available at https://github.com/fortify/github-action/releases. Depending on the amount of stability
# required, you may want to consider using fortify/github-action@v1 instead to use the latest 1.x.y version
# of this action, allowing your workflows to automatically benefit from any new features and bug fixes.

Copilot AI Dec 6, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] The workflow uses a specific commit SHA (ef5539bf4bd9c45c0bd971978f635a69eae55297) for the Fortify GitHub Action, which the comment states corresponds to version 1.6.2. However, there's no validation that this commit SHA is correct or that this is indeed a secure, verified version of the action.

Recommendation: While using commit SHAs is a security best practice for supply chain security, consider:

  1. Verifying this commit SHA is correct for version 1.6.2 at https://github.com/fortify/github-action/releases
  2. Adding a comment with the actual version tag for easier tracking (e.g., # v1.6.2: ef5539bf4bd9c45c0bd971978f635a69eae55297)
  3. Periodically reviewing for newer stable versions
Suggested change
# of this action, allowing your workflows to automatically benefit from any new features and bug fixes.
# of this action, allowing your workflows to automatically benefit from any new features and bug fixes.
# v1.6.2: ef5539bf4bd9c45c0bd971978f635a69eae55297

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants