Skip to content

ScubaConfigValidator doesn't allow yaml to run if products don't match what's in config #2007

@DickTracyII

Description

@DickTracyII

Prerequisites

  • This issue has an informative and human-readable title.

ScubaGear Version

1.7.1

Operating System

Windows 11

PowerShell Version

5.1

M365 Environment and License(s)

M365Envrionment: commercial, gcc, gcchigh, dod

🐛 Summary

ScubaConfigValidator currently fails configuration validation and blocks execution when a yaml references a product that is not explicitly used with the -ProductNames parameter, even when the YAML is otherwise valid and the product exists in the baseline.

This behavior prevents users from running ScubaGear when:

  • The command line is overwriting the product names but the yaml contains additional products in Exclusions, OmitPolicy or AnnotatePolicies
  • A misspelled product is in the yaml will error even if yet the product name does not have that product.

This appears to be over‑strict validation, as the configuration should allow the user to run it

Steps to reproduce

  1. Create a ScubaConfig yaml file with two annotate policies for two different products. (eg aad, defender)
Organization: contoso.com
OrgName: contoso
Description: "two product testenvironment" 
ProductNames: 
  - aad 
  - defender 
M365Environment: commercial

AnnotatePolicy: 
  MS.AAD.2.1v1: 
    Comment: "test this" 

  MS.DEFENDER.1.1v1: 
    Comment: "and this"
  1. Run Invoke-Scuba -ConfigFIlePath <path>\twoscubaproduct.yaml -ProductNames aad.
  2. An error will come up stating "references product 'aad' which is not in the selected ProductNames..."

Expected behavior

It should be a warning and skip mismatched products and allow SCuBAGear to run, it should
validate only policies relevant to the selected products.

Output from Initialize-SCuBA (optional)

Image

Metadata

Metadata

Assignees

Labels

bugThis issue or pull request addresses broken functionality

Type

Frequency

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions