-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Addressing Well Architected Framework gaps (#149)
* first cut of WAF rule gaps * introducing capturing of azcmds to file * updating ResourceGroup Name in UI * path problem and cmd replace * oops. token mistake * shifting to complete mode deployment * adding conditions to cover forks * Making full deployment optional in a manual run * Excluding Azure.AppGw.UseHTTPS rule as AGIC managed * More WAF param tweaks for better coverage * shifted disableLocalAccounts to param * param metadata * changing default of AksDisableLocalAccounts to false. * added ui and playwrite test for disabledlocalaccounts * disabling local accounts for basic cluster * removing the use of admin local account login * using aks-se * download kubelogin binary * Kubelogin * Changing RG used by Publish actions to be dedicated. * setting aksDisableLocalAccounts for the WAF param config * bumping template version in web app * case issue with aksDisableLocalAccounts * implementing keiths suggestion of default value cover on the new param. * removing invalid inputProps from TextFields * fixing != !== issue i spotted in the jscode * fixed up playwright test to be better * userauth cspell dictionary update
- Loading branch information
Gordon Byers
authored
Dec 7, 2021
1 parent
bc1b204
commit c77d8a1
Showing
25 changed files
with
432 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,9 +17,17 @@ on: | |
- "helper/**" | ||
|
||
workflow_dispatch: | ||
inputs: | ||
doAzCmdDeployment: | ||
description: 'Test AZ Cmd by deploying to an Azure subscription' | ||
default: 'false' | ||
type: boolean | ||
required: false | ||
|
||
env: | ||
templateRelease: 0.3.3 | ||
templateRelease: 0.3.4-preview | ||
AZCLIVERSION: 2.30.0 #2.29.2 #2.26.0 #latest | ||
RG: "Automation-Actions-AksPublishCI" | ||
|
||
jobs: | ||
|
||
|
@@ -81,12 +89,73 @@ jobs: | |
- name: Playwright - Run stable helper tests | ||
env: | ||
filenamewordmatch: 'helper' | ||
filenamewordmatch: 'helper-test' | ||
filenamewordexclude: 'fragile' | ||
run: | | ||
cd helper | ||
npx playwright test --browser chromium .playwrighttests/ -g '${{ env.filenamewordmatch }}' --grep-invert '${{ env.filenamewordexclude }}' --reporter list | ||
- name: Playwright - Grab Az Commands | ||
env: | ||
filenamewordmatch: 'helper-export' | ||
run: | | ||
cd helper | ||
npx playwright test --browser chromium .playwrighttests/ -g '${{ env.filenamewordmatch }}' --reporter list | ||
- name: Persist exported Az Commands for visibility | ||
if: ${{ github.event.pull_request.head.repo.fork }} | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: AzCmds | ||
path: helper/azcmd-*.sh | ||
|
||
- name: Azure Login | ||
if: ${{ !github.event.pull_request.head.repo.fork }} | ||
uses: Azure/login@v1 | ||
with: | ||
creds: ${{ secrets.AZURE_CREDENTIALS }} | ||
enable-AzPSSession: true | ||
environment: azurecloud | ||
allow-no-subscriptions: false | ||
|
||
#TODO: If/When we capture more AZ CMD's, then we'll want to iterate over files beginning with "azcmd" | ||
- name: Verify AZ Commands | ||
if: ${{ !github.event.pull_request.head.repo.fork }} | ||
uses: Azure/[email protected] | ||
env: | ||
azcmdpath: "helper/azcmd-managed-private.sh" | ||
with: | ||
azcliversion: ${{ env.AZCLIVERSION }} | ||
inlineScript: | | ||
#Change the Create to a Validate statement | ||
sed -i 's/az deployment group create/az deployment group validate/' $azcmdpath | ||
#Debug | ||
cat $azcmdpath | ||
#Run the script | ||
sh $azcmdpath | ||
- name: Full deploy test AZ Commands | ||
if: ${{ !github.event.pull_request.head.repo.fork && github.event.inputs.doAzCmdDeployment == 'true' }} | ||
uses: Azure/[email protected] | ||
env: | ||
azcmdpath: "helper/azcmd-managed-private.sh" | ||
with: | ||
azcliversion: ${{ env.AZCLIVERSION }} | ||
inlineScript: | | ||
#Change the Create to a Validate statement | ||
sed -i 's/az deployment group validate/az deployment group create --mode Complete --name ghpages/' $azcmdpath | ||
#Debug | ||
cat $azcmdpath | ||
#Run the script | ||
sh $azcmdpath | ||
#Cleanup | ||
#az deploymentg group delete -n ghpages -g $RG | ||
- name: Persist test failure screengrabs as artifacts | ||
uses: actions/upload-artifact@v2 | ||
if: failure() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,6 +69,8 @@ jobs: | |
echo "RG is: $RG" | ||
echo "Param dir path is: ${{ env.ParamDir }}" | ||
echo "Param file is ${{ matrix.files }}" | ||
echo "Input path is ${{ env.ParamDir }}${{ matrix.files }}" | ||
echo "Do PS Rule is ${{ steps.paramfile.outputs.DOPSRULE }}" | ||
- name: Arm Parameter file check | ||
shell: pwsh | ||
|
@@ -130,10 +132,14 @@ jobs: | |
RG='${{ env.RG }}' | ||
az deployment group validate -f bicep/main.bicep -g $RG -p ${{ env.ParamDir }}${{ matrix.files }} | ||
- name: Debug | ||
run: | | ||
echo "Input path is ${{ env.ParamDir }}${{ matrix.files }}" | ||
echo "Do PS Rule is ${{ steps.paramfile.outputs.DOPSRULE }}" | ||
- name: WhatIf Infrastructure deployment | ||
if: steps.paramfile.outputs.DOPSRULE == 'true' | ||
uses: Azure/[email protected] | ||
with: | ||
azcliversion: ${{ env.AZCLIVERSION }} | ||
inlineScript: | | ||
RG='${{ env.RG }}' | ||
az deployment group what-if -f bicep/main.bicep -g $RG -p ${{ env.ParamDir }}${{ matrix.files }} | ||
# PSRule does this cool thing where it traverse the parameter file through to the arm template | ||
# PSRule performs IaC recommendations of the template. | ||
|
@@ -145,5 +151,14 @@ jobs: | |
with: | ||
modules: 'PSRule.Rules.Azure' | ||
inputPath: "${{ env.ParamDir }}${{ matrix.files }}" | ||
prerelease: false | ||
baseline: 'Azure.Preview' | ||
#prerelease: false | ||
baseline: 'Azure.Default' #'Azure.Preview' | ||
|
||
- name: PSRule - Analyze Azure parameter file including Preview feature rulesets | ||
if: steps.paramfile.outputs.DOPSRULE == 'true' | ||
uses: Microsoft/ps-rule@main | ||
continue-on-error: true #Preview feature checking means we need to suppress errors | ||
with: | ||
modules: 'PSRule.Rules.Azure' | ||
inputPath: "${{ env.ParamDir }}${{ matrix.files }}" | ||
baseline: 'Azure.All' #All includes preview and internal rules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
*/node_modules | ||
localdebug/* | ||
helper/*screengrabs/* | ||
helper/*screengrabs/* | ||
helper/azcmd*.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.