diff --git a/CHANGELOG.md b/CHANGELOG.md index 085d61b..830f86c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/). + +## [2.2.1] - 2026-10-16 + +### Fixed + +- Reject null, empty, or whitespace-only attribute values in `create.ps1` and `update.ps1` with an attribute-specific audit error, preventing empty values from being stored in the blocklist. + ## [2.2.0] - 2026-08-03 ### Added diff --git a/UniquenessCheck/uniquenessCheckAdChecksSql.ps1 b/UniquenessCheck/uniquenessCheckAdChecksSql.ps1 index 7e8fd0a..43683e1 100644 --- a/UniquenessCheck/uniquenessCheckAdChecksSql.ps1 +++ b/UniquenessCheck/uniquenessCheckAdChecksSql.ps1 @@ -1,5 +1,5 @@ ######################################################################### -# HelloID-Conn-Prov-Target-Blocklist-Check-On-External-Systems-AD-SQL +# HelloID-Conn-Prov-Target-Blocklist-Check-On-External-Systems-SQL ######################################################################### # Initialize default properties diff --git a/create.ps1 b/create.ps1 index 3cf8131..8a890f1 100644 --- a/create.ps1 +++ b/create.ps1 @@ -219,6 +219,11 @@ try { $querySelectResult = [System.Collections.ArrayList]::new() Invoke-SQLQuery @querySelectSplatParams -Data ([ref]$querySelectResult) -verbose:$false + if ([string]::IsNullOrWhiteSpace($actionContext.Data.$attributeName)) { + $actionMessage = "validating attribute [$attributeName]" + throw "Attribute [$attributeName] must not be null, empty or whitespace." + } + $selectRowCount = ($querySelectResult | Measure-Object).count Write-Information "Queried data FROM [$table] WHERE [attributeName] = '$attributeName' AND [attributeValue] = '$attributeValue'. Result count: $selectRowCount" diff --git a/update.ps1 b/update.ps1 index a208605..ba073d1 100644 --- a/update.ps1 +++ b/update.ps1 @@ -222,6 +222,11 @@ try { $querySelectResult = [System.Collections.ArrayList]::new() Invoke-SQLQuery @querySelectSplatParams -Data ([ref]$querySelectResult) -verbose:$false + if ([string]::IsNullOrWhiteSpace($actionContext.Data.$attributeName)) { + $actionMessage = "validating attribute [$attributeName]" + throw "Attribute [$attributeName] must not be null, empty or whitespace." + } + $selectRowCount = ($querySelectResult | measure-object).count Write-Verbose "Queried data FROM [$table] WHERE [attributeName] = '$attributeName' AND [attributeValue] = '$attributeValue'. Result count: $selectRowCount"