{"id":20697400,"url":"https://github.com/epomatti/az-vm-jit","last_synced_at":"2026-01-27T13:32:52.233Z","repository":{"id":206875272,"uuid":"717803459","full_name":"epomatti/az-vm-jit","owner":"epomatti","description":"Azure Virtual Machine (VM) with Just-in-Time access","archived":false,"fork":false,"pushed_at":"2024-11-24T00:50:58.000Z","size":137,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-21T01:50:33.330Z","etag":null,"topics":["azure","azure-pim","azure-security","defender","jit","just-in-time","microsoft-defender","pim","privileged-access-management","terraform","vmaccess"],"latest_commit_sha":null,"homepage":"","language":"HCL","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/epomatti.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-11-12T16:44:17.000Z","updated_at":"2024-12-10T09:11:03.000Z","dependencies_parsed_at":"2024-11-24T02:15:11.257Z","dependency_job_id":null,"html_url":"https://github.com/epomatti/az-vm-jit","commit_stats":null,"previous_names":["epomatti/az-vm-jit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/epomatti/az-vm-jit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epomatti%2Faz-vm-jit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epomatti%2Faz-vm-jit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epomatti%2Faz-vm-jit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epomatti%2Faz-vm-jit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/epomatti","download_url":"https://codeload.github.com/epomatti/az-vm-jit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/epomatti%2Faz-vm-jit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28813539,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T12:25:15.069Z","status":"ssl_error","status_checked_at":"2026-01-27T12:25:05.297Z","response_time":168,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["azure","azure-pim","azure-security","defender","jit","just-in-time","microsoft-defender","pim","privileged-access-management","terraform","vmaccess"],"created_at":"2024-11-17T00:17:51.509Z","updated_at":"2026-01-27T13:32:52.220Z","avatar_url":"https://github.com/epomatti.png","language":"HCL","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Azure VM JIT access\n\nAzure Virtual Machine (VM) with Just-in-Time access.\n\nYou'll need to enable [Microsoft Defender for Servers][1] for the Subscription.\n\n\u003e [!TIP]\n\u003e Entra ID P2 license is also required for PIM\n\nMake sure you enable **Cloud Workload Protection (CWP)** for **Servers**. After that, install the agents using the Portal just for completeness.\n\nCreate the `.auto.tfvars` file and set the required parameters:\n\n```sh\ncp config/template.tfvars .auto.tfvars\n```\n\nCreate the temporary keys:\n\n```sh\nmkdir .keys \u0026\u0026 ssh-keygen -f .keys/temp_rsa\n```\n\nStart by creating the sandbox infrastructure:\n\n```sh\nterraform init\nterraform apply -auto-approve\n```\n\n\u003e [!TIP]\n\u003e If you get the error `'LinuxJITPolicy' is not onboarded to Defender For Servers offering.`, add the server to Defender and apply again to finish the setup.\n\n## JIT\n\nIf everything goes right, the JIT policy will automatically be created to the VM by the Terraform `AzApi` provider.\n\nPermissions required are:\n\n- `Microsoft.Security/locations/jitNetworkAccessPolicies/initiate/action`\n- `Microsoft.Compute/virtualMachines/read`\n\nTo be able to login with Entra ID credentials, users must have one of: \n\n- `Virtual Machine Administrator Login`\n- `Virtual Machine User Login`\n\nDefender should have created the following `Deny` rule:\n\n\u003cimg src=\".assets/az-jit-deny.png\" /\u003e\n\nNow request your JIT access.\n\nDefender should create the following `Allow` rule:\n\n\u003cimg src=\".assets/az-jit-allow.png\" /\u003e\n\n## `VMAccess` extension\n\nIt is possible to extend VM management capabilities using the [VMAccess extension][2].\n\nTo install the extension using Terraform:\n\n```sh\n# VMAccess\ninstall_vmaccess_extension = true\n```\n\nTo check for deployed extensions and the installation status:\n\n```sh\naz vm extension list \\\n    --resource-group \u003cresource-group\u003e \\\n    --vm-name \u003cvm-name\u003e -o table\n```\n\n---\n\n### Clean-up\n\nDon't forget to disable Microsoft Defender if you're only testing.\n\nDestroy the infrastructure:\n\n```sh\nterraform destroy -auto-approve\n```\n\n[1]: https://learn.microsoft.com/en-us/azure/defender-for-cloud/tutorial-enable-servers-plan\n[2]: https://github.com/Azure/azure-linux-extensions/tree/master/VMAccess\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepomatti%2Faz-vm-jit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fepomatti%2Faz-vm-jit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fepomatti%2Faz-vm-jit/lists"}