Skip to content

feat: add Infrastructure as Code (IaC) scanning support#237

Closed
jasonouellet wants to merge 2 commits intosnyk:mainfrom
jasonouellet:add-iac-scan
Closed

feat: add Infrastructure as Code (IaC) scanning support#237
jasonouellet wants to merge 2 commits intosnyk:mainfrom
jasonouellet:add-iac-scan

Conversation

@jasonouellet
Copy link
Copy Markdown

Summary

This PR adds support for Snyk Infrastructure as Code (IaC) scanning to the Azure Pipelines task, enabling users to scan IaC files such as Terraform, CloudFormation, Kubernetes manifests, and ARM templates for security misconfigurations.

Changes

New Features

  • Added iac as a new test type option in the task configuration
  • Support for snyk iac test command execution
  • Added iac and iac test as valid commands for the command input
  • IaC scans now support severity thresholds (low, medium, high, critical)
  • IaC projects can be monitored using snyk monitor
  • Target file specification for IaC configurations via targetFile parameter

Updated Components

  • task.json: Added IaC to test type options and updated visibility rules for relevant parameters
  • task-lib.ts: Added TestType.IAC enum value, severity threshold configuration, and valid command definitions
  • index.ts: Updated runSnykTest to handle IaC test type
  • test-task-args.ts: Updated test expectations to include new IaC commands
  • README.md: Comprehensive documentation including IaC usage examples and updated parameter descriptions

Supported IaC Options

All Snyk CLI options for snyk iac test are supported via the additionalArguments parameter, including:

  • --scan modes (resource-changes, deployment-analysis, full-scan)
  • --var-file for Terraform variables
  • --policy-path for custom policies
  • --rules for custom rule sets
  • --report for sharing results with Snyk
  • And all other documented CLI flags

Testing

  • All existing unit tests pass (88/88)
  • Code adheres to ESLint and Prettier standards
  • Updated test for valid command validation

Usage Example

- task: SnykSecurityScan@1
  inputs:
    serviceConnectionEndpoint: 'mySnykToken'
    testType: 'iac'
    severityThreshold: 'high'
    failOnIssues: true
    monitorWhen: 'always'

Documentation

  • README.md updated with IaC examples and parameter descriptions
  • All IaC-specific parameters are documented in the Task Parameters table

This proposal follows the project's conventions (Angular-style commits) and provides a clear and comprehensive description of the changes made.

@snyk-io
Copy link
Copy Markdown

snyk-io Bot commented Jan 7, 2026

Snyk checks have passed. No issues have been found so far.

Status Scanner Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@jasonouellet jasonouellet marked this pull request as ready for review January 7, 2026 15:43
@jasonouellet jasonouellet requested review from a team as code owners January 7, 2026 15:43
- Add TestType.IAC enum and severity threshold configuration
- Add 'iac' and 'iac test' as valid commands
- Update task.json with IaC options and visibility rules
- Update runSnykTest to handle IaC test type
- Add unit tests for IaC validation and monitor behavior
- Update README.md with IaC examples and documentation
@jasonouellet jasonouellet changed the title Feat: add Infrastructure as Code (IaC) scanning support #234 feat: add Infrastructure as Code (IaC) scanning support Jan 8, 2026
@jasonouellet
Copy link
Copy Markdown
Author

@danlucian, can you review this ?

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 1, 2026

Your PR has not had any activity for 30 days. In 2 days I'll close it. Make some activity to remove this.

@github-actions github-actions Bot added the Stale label Mar 1, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 3, 2026

Your PR has now been stale for 2 days. I'm closing it.

@github-actions github-actions Bot closed this Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant