Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
credscan
command will scan.tf
files under the target working directory, and build index based on given swagger repo if provided or download online index file if not provided, then match properties set inazapi_resource
in.tf
files and the corrspondingx-ms-secret
marked properties in swagger, fire error if these credential fields set inazapi_resource
:sensitive: true
And the errors is saved in json/markdown format, specifically
armstrong_credscan_{date}/error.json
andarmstrong_credscan_{data}/error.md
under the working directory.example
current limitations:
To match azapi_resource and swagger model, we mock resource ID based on
azapi_resource.type
, and then use mocked resource ID to find the swagger model. The resource ID is simply mocked by adding subscription and resource group prefix and then add customized resource names, e.g.,Microsoft.Network/virtualNetworks
tosubscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/xxx
. So in some cases the mocked resource ID is not correct, e.g.,Microsoft.Resources/resourceGroups
. But this might be OK for we only cares about credential field, and most of these resource should be under resource group level.Only simple
variable
usage can be processed. Other terraform grammer likemodule
,for_each
,dynamic
block or etc is not supported.