Add InfraScan analysis workflow#316
Conversation
This workflow allows users to run InfraScan analysis tools and generates an HTML report.
|
| Filename | Overview |
|---|---|
| .github/workflows/analysis-tools.yml | New workflow adding soldevelo/infrascan scanning via workflow_dispatch; all three actions are pinned to mutable version tags rather than commit SHAs (violating the repo's established pattern), no permissions block is defined, and the referenced v1.0.9 tag may not yet exist. |
Reviews (1): Last reviewed commit: "Add InfraScan analysis workflow" | Re-trigger Greptile
| run: mkdir -p infrascan-reports | ||
|
|
||
| - name: Run InfraScan | ||
| uses: soldevelo/infrascan@v1.0.9 |
There was a problem hiding this comment.
Unpinned third-party action — supply chain risk
Every other workflow in this repository pins actions to an immutable commit SHA (e.g., actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11), not a mutable version tag. soldevelo/infrascan@v1.0.9 is a mutable tag that the upstream maintainer can silently repoint to arbitrary code; if the tag is moved, the next run executes whatever new code it points to with full access to the repository checkout and any secrets available to the job. Additionally, research into the public SolDevelo/InfraScan repository found no evidence that a v1.0.9 tag has been published — only v1.0.5 and v1.0.8 are known to exist — so this workflow may currently fail on every dispatch. Pin all three actions to a specific commit SHA and record the tag in a comment (e.g., soldevelo/infrascan@<SHA> # v1.0.9), and verify that the tag exists before merging.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| infrascan: | ||
| if: ${{ github.event.inputs.tool == 'infrascan' }} | ||
| runs-on: ubuntu-latest |
There was a problem hiding this comment.
All other workflows in this repository declare an explicit permissions block at the workflow or job level (e.g., permissions: read-all in scorecard.yml, permissions: contents: read in code.yml). Without it, this job inherits the repository's default token permissions, which may be broader than needed for a read-only scanning workflow. Add a minimal permissions block — at minimum permissions: contents: read — to follow the principle of least privilege and match the rest of the repo's patterns.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
There was a problem hiding this comment.
actions/checkout and actions/upload-artifact are unpinned
Consistent with the finding on soldevelo/infrascan, actions/checkout@v4 (line 20) and actions/upload-artifact@v4 (line 31) are also pinned to mutable version tags rather than commit SHAs. The existing workflows use actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 and actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1. Pin all three actions in this file to commit SHAs to match the repo's established supply-chain security posture.
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
This pull request integrates the InfraScan security, compliance, and cloud cost optimization analysis tool (
v1.0.9) into thesubstationrepository. It introduces a new GitHub Actions workflow (Analysis Tools) that can be manually triggered viaworkflow_dispatch. This allows developers and maintainers to run comprehensive infrastructure security and cost audits on demand, automatically publishing the results as download-ready HTML artifacts.View Full Web Report
Scanned Areas
Description
This change introduces automated infrastructure scanning using the InfraScan static analysis tool. The workflow targets all defined cloud assets, evaluates them against industry-standard security baselines, assesses container health, and calculates projected resource costs.
Motivation and Context
Implementing InfraScan provides a robust Why for our operational lifecycle: it establishes a definitive shift-left practice. By surface-testing configurations directly within the repository, we catch security flaws and costly configuration errors (such as unattached Elastic IPs or oversized NAT gateways) long before they are deployed to live cloud environments.
Key Scan Results
substationmainComponent Breakdown
1 High,26 Medium,1 Low)1 High,4 Medium,1 Low)22 Medium)Recommendations
Highpriority cost violation on theeip(Elastic IP) which can guarantee an immediate, high-confidence saving of $4/mo. Review the utilization metrics for thenat_gatewayto safely claim an additional saving of up to $34/mo.Mediumseverity security violations discovered within the infrastructure code to close active perimeter gaps and achieve a perfect 100% security baseline.appconfig_application,appconfig_deployment_strategy), as they are excluded from the automated cost estimation module.Value Provided by InfraScan
How Has This Been Tested?
The GitHub Actions workflow has been executed within the repository using the
workflow_dispatchtrigger. It completed successfully, created theinfrascan-reportsdirectory, ran the static analyzer, and correctly exported the resulting HTML document as a structured pipeline artifact.Types of changes
Checklist: