This is dotnet core application that allows to explore secrets from Azure Key Vaults using key vault's Url, ClientId and ClientSecret. At the end it renders HTML page(s) with all secrets found in key vault(s) (optionally JSON file can be generated, see Features).
This section you can read about features, configuring and runing the app. If you want to publish app to single .exe file - see section below.
Run as usual dotnet core application (using Visual Studio or console command dotnet run)
App works with appconfig.json configuration file. Format of file:
{
"KeyVaultDev": "https://bla-bla-bla-dev.vault.azure.net/",
"DevAppClientId": "bla-bla-bla-id",
"DevAppClientSecret": "bla-bla-bla-secret=",
"DevSortOrder": 1,
"KeyVaultQa": "https://bla-bla-bla-qa.vault.azure.net/",
"QaAppClientId": "bla-bla-bla-id",
"QaAppClientSecret": "bla-bla-bla-secret=",
"QaSortOrder": 2,
"RenderFormat": "Html",
"IsTestRun": true,
"MinifyCss": true,
"ObfuscateJs": true,
"OpenDirectoryOnFinish": true
}For each key vault you want to fetch secrets config should contain at least 3 params: KeyVault, AppClientId, AppClientSecret.
For example if you want to fetch Prod key vault, you should provide 'KeyVaultProd', 'ProdAppClientId', 'ProdAppClientSecret'.
Ordering: you should either specify SortOrder for all key vaults or for none. Values must be distinct!
RenderFormat- parameter to choose format of the result. Possible values:Html,Json- If
IsTestRunis set to true - app will run the test flow (no secrets will be fetched from the real key vaults) MinifyCssandObfuscateJslet you configure the compressing of the assets. Be aware, obfuscation works only for transpiled scriptsOpenDirectoryOnFinishwill open the folder with rendered HTMLs after execution
Rendered HTML example:
Fetched secrets are located in Results folder. This folder is gets cleaned on every run.
Application can be published to single .exe file with appconfig.json file alongside. Two ways to do that:
- Using Visual Studio (Project Right Click → Publish → Select 'SingleExecutable' profile → Publish)
- Run
PublishSingleExecutable.ps1PowerShell script (located in_publishfolder)
Both options will give you the same output.
This solution uses next tools:
- DotLiquid - NuGet package; HTML templating and rendering
- JsonFormatterPlus - NuGet package; JSON formatting
- Toastify - JS and CSS libs; UI notifications (toasts)
- YUICompressor - NuGet package; CSS minification, JS obfuscation
- Bootstrap - CSS lib; UI styles
