Skip to content

Commit

Permalink
fix: secure variable migration token (#3394)
Browse files Browse the repository at this point in the history
## Description

<!--
>Thank you for your contribution !
> Please include a summary of the change and which issue is fixed.
> Please also include the context.
> List any dependencies that are required for this change.

Fixes #123
Fixes #456
Closes #123
Closes #456
-->

Closes #3172 

fix: add secure validation to migrationToken parameter

Implement input validation for the migrationToken parameter in the Bicep
template to ensure only authorized tokens are accepted.

This prevents potential misuse of the parameter and enhances the
security of the deployment process.


## Pipeline Reference

<!-- Insert your Pipeline Status Badge below -->

| Pipeline |
| -------- |
|
[![avm.res.cognitive-services.account](https://github.com/jceval/bicep-registry-modules/actions/workflows/avm.res.cognitive-services.account.yml/badge.svg?branch=fix%2Fsecure_variable_migration_token)](https://github.com/jceval/bicep-registry-modules/actions/workflows/avm.res.cognitive-services.account.yml)
|

## Type of Change

<!-- Use the checkboxes [x] on the options that are relevant. -->

- [ ] Update to CI Environment or utilities (Non-module affecting
changes)
- [ ] Azure Verified Module updates:
- [ ] Bugfix containing backwards-compatible bug fixes, and I have NOT
bumped the MAJOR or MINOR version in `version.json`:
- [ ] Someone has opened a bug report issue, and I have included "Closes
#{bug_report_issue_number}" in the PR description.
- [ ] The bug was found by the module author, and no one has opened an
issue to report it yet.
- [ ] Feature update backwards compatible feature updates, and I have
bumped the MINOR version in `version.json`.
- [ ] Breaking changes and I have bumped the MAJOR version in
`version.json`.
  - [ ] Update to documentation

## Checklist

- [ ] I'm sure there are no other open Pull Requests for the same
update/change
- [ ] I have run `Set-AVMModule` locally to generate the supporting
module files.
- [ ] My corresponding pipelines / checks run clean and green without
any errors or warnings

<!-- Please keep up to date with the contribution guide at
https://aka.ms/avm/contribute/bicep -->

---------

Co-authored-by: Erika Gressi <[email protected]>
  • Loading branch information
jceval and eriqua authored Oct 10, 2024
1 parent d0cbe01 commit 1d897ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions avm/res/cognitive-services/account/main.bicep
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ param customerManagedKey customerManagedKeyType
@description('Optional. The flag to enable dynamic throttling.')
param dynamicThrottlingEnabled bool = false

@secure()
@description('Optional. Resource migration token.')
param migrationToken string?

Expand Down
10 changes: 5 additions & 5 deletions avm/res/cognitive-services/account/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "259342811715055071"
"version": "0.30.23.60470",
"templateHash": "325704537018634474"
},
"name": "Cognitive Services",
"description": "This module deploys a Cognitive Service.",
Expand Down Expand Up @@ -795,7 +795,7 @@
}
},
"migrationToken": {
"type": "string",
"type": "securestring",
"nullable": true,
"metadata": {
"description": "Optional. Resource migration token."
Expand Down Expand Up @@ -1784,8 +1784,8 @@
"metadata": {
"_generator": {
"name": "bicep",
"version": "0.29.47.4906",
"templateHash": "986606208324987345"
"version": "0.30.23.60470",
"templateHash": "12263717469683062316"
}
},
"definitions": {
Expand Down

0 comments on commit 1d897ee

Please sign in to comment.