You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+13-33
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@
19
19
-[Login to Azure US Government cloud](#login-to-azure-us-government-cloud)
20
20
-[Login to Azure Stack Hub](#login-to-azure-stack-hub)
21
21
-[Login without subscription](#login-without-subscription)
22
-
-[Az logout and security hardening](#az-logout-and-security-hardening)
22
+
-[Security hardening](#security-hardening)
23
23
-[Azure CLI dependency](#azure-cli-dependency)
24
24
-[Reference](#reference)
25
25
-[GitHub Action](#github-action)
@@ -190,7 +190,7 @@ jobs:
190
190
runs-on: ubuntu-latest
191
191
steps:
192
192
- name: Azure login
193
-
uses: azure/login@v1
193
+
uses: azure/login@v2
194
194
with:
195
195
client-id: ${{ secrets.AZURE_CLIENT_ID }}
196
196
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
@@ -220,7 +220,7 @@ jobs:
220
220
runs-on: ubuntu-latest
221
221
steps:
222
222
- name: Azure login
223
-
uses: azure/login@v1
223
+
uses: azure/login@v2
224
224
with:
225
225
client-id: ${{ secrets.AZURE_CLIENT_ID }}
226
226
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
@@ -282,7 +282,7 @@ jobs:
282
282
runs-on: ubuntu-latest
283
283
steps:
284
284
285
-
- uses: azure/login@v1
285
+
- uses: azure/login@v2
286
286
with:
287
287
creds: ${{ secrets.AZURE_CREDENTIALS }}
288
288
@@ -310,7 +310,7 @@ jobs:
310
310
runs-on: ubuntu-latest
311
311
steps:
312
312
313
-
- uses: azure/login@v1
313
+
- uses: azure/login@v2
314
314
with:
315
315
creds: ${{ secrets.AZURE_CREDENTIALS }}
316
316
enable-AzPSSession: true
@@ -333,7 +333,7 @@ jobs:
333
333
If you want to pass subscription ID, tenant ID, client ID, and client secret as individual parameters instead of bundling them in a single JSON object to address the [security concerns](https://docs.github.com/actions/security-guides/encrypted-secrets), below snippet can help with the same.
This action doesn't implement ```az logout``` by default at the end of execution. However, there is no way to tamper with the credentials or account information because the GitHub-hosted runner is on a VM that will get re-imaged for every customer run, which deletes everything. But if the runner is self-hosted (not provided by GitHub), it is recommended to manually log out at the end of the workflow, as shown below. More details on security of the runners can be found [here](https://docs.github.com/actions/learn-github-actions/security-hardening-for-github-actions#hardening-for-self-hosted-runners).
559
+
## Security hardening
562
560
563
561
> [!WARNING]
564
-
> When using self hosted runners it is possible to have multiple runners on a single VM. Currently if your runners share a single user on the VM each runner will share the same credentials. That means in detail that each runner is able to change the permissions of another run. As a workaround we propose to use one single VM user per runner. If you start the runner as a service, do not forget to add the [optional user argument](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/configuring-the-self-hosted-runner-application-as-a-service#installing-the-service)
565
-
566
-
```yaml
567
-
- name: Azure CLI script
568
-
uses: azure/CLI@v1
569
-
with:
570
-
inlineScript: |
571
-
az logout
572
-
az cache purge
573
-
az account clear
574
-
575
-
- name: Azure PowerShell script
576
-
uses: azure/powershell@v1
577
-
with:
578
-
azPSVersion: "latest"
579
-
inlineScript: |
580
-
Clear-AzContext -Scope Process
581
-
Clear-AzContext -Scope CurrentUser
582
-
```
562
+
> When using self hosted runners it is possible to have multiple runners on a single VM. Currently if your runners share a single user on the VM each runner will share the same credentials. That means in detail that each runner is able to change the permissions of another run. As a workaround we propose to use one single VM user per runner. If you start the runner as a service, do not forget to add the [optional user argument](https://docs.github.com/actions/hosting-your-own-runners/managing-self-hosted-runners/configuring-the-self-hosted-runner-application-as-a-service#installing-the-service)
0 commit comments