@codemod/secure-param-defaults-audit
Read-only audit of deployment JSON templates for top-level secureString and secureObject parameters that incorrectly include defaultValue, with findings, metrics, and remediation guidance.
What It Does
- Scans
**/*.jsondeployment templates only. - Inspects only the top-level
parametersobject. - Reports one finding per top-level parameter whose
typeis exactlysecureStringorsecureObjectand that also declaresdefaultValue. - Emits file-level metrics for files with findings plus per-type and per-parameter counters.
- Never rewrites source files.
Detection Rules
The codemod treats a JSON file as a deployment template when it has a top-level parameters object and template markers such as:
- a deployment template
$schema - a top-level
resourcesarray - top-level
variablesoroutputs contentVersiontogether with typed parameter definitions
Each finding includes stable metadata such as:
filePathparamNamesecureTypejsonPointerlineandcolumn- remediation guidance
Recommended remediation: remove the defaultValue and provide the secret at deployment time through a secure parameter file, a key-management reference, or CI/CD secret injection.
Exclusions
- non-JSON files
- non-template JSON documents
- deployment parameter files that use the deployment-parameters schema
- nested objects coincidentally named
parameters - parameter types other than exact
secureStringandsecureObject - secure parameters that omit
defaultValue defaultValuementions that only appear in metadata, descriptions, or examples
Metrics
deployment_templates_scanneddeployment_secure_param_defaultvalue_filesdeployment_secure_param_defaultvalue_findingsdeployment_securestring_defaultvalue_findingsdeployment_secureobject_defaultvalue_findings
Current parser mode uses JSSG's JSON language, so malformed JSON files do not reach the transform. The optional unparsable-file metric from the spec is therefore not emitted by this package.
Usage
bash
Development
bash
License
MIT