Coder Social home page Coder Social logo

aad-app-credential-tools's Introduction

Credential health assessment and update procedures for Azure Automation, Azure Migrate, Azure Site Recovery and Azure AD applications

The following doc walks through various options and process of assessment and rotation of keyCredentials (certificates) for applications and service principal objects (Apps/SPs) created by services such as Azure Automation, Azure Migrate, Azure Site Recovery. Applications created via other mechanisms might need to rotate their credentials if your tenant admin identified a credential on your application as needing attention.

Azure AD application needing credential rotation could have been created by Azure Automation Service, Azure Migrate Service, Azure Site Recovery or manually using the Azure portal. To pick the right remediation guidance, you must pick the assessment script for the one of these services. If one or more of these services are used in your organization, you will need to run through the assessment script for each of the services. This will ensure you are able to pick the right guidance and avoid downtime for your app/service. The following table can help identify the type of service that created the Azure AD application.

Service type Ways to identify app association
Azure Automation Service For Automation, the signInUrl in manifest has the URL to automation account which signifies the application is associated with an Automation account. You can find your application manifest under the App registration section in Azure portal.
Azure Migrate Service Under the App registration section in Azure AD portal, the applications associated with Azure Migrate contain one of the following suffixes: resourceaccessaadapp,agentauthaadapp,authandaccessaadapp
Azure Site Recovery For Site Recovery, applications in Azure portal under the App registration section Azure AD app would have one of the following suffix - agentauthaadapp, marsauthaadapp, failbackagentauthaadapp, discoveryauthaadapp

Note

For Azure AD applications or service principals not created by one of the above services, following the assessment and remediation guide for Azure AD applications and Service principals listed below.

Assessment and remediation

Product/Service Assessment guide
Azure Automation Azure Automate credential assessment and remediation guidance
Azure Migrate Azure Migrate credential assessment and remediation guide
Azure Site Recovery Azure Site Recovery credential assessment and remediation guide
Azure AD Applications and Service principals Azure AD Application/Service principal assessment and remediation guide

Disclaimer

Guidance in these documents applies only in relation to the mitigation steps necessary for the issue disclosed in the CVE and detailed in Microsoft Security Response Center blog. Do not use this guidance as general credential rotation procedure.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

aad-app-credential-tools's People

Contributors

madansr7 avatar microsoftopensource avatar sideeksh avatar vikram-m avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

aad-app-credential-tools's Issues

AadCertRollover.ps1 syntax error - critical script breaking issue

Issue on: https://github.com/microsoft/aad-app-credential-tools/blob/main/azure-site-recovery/AadCertRollover.ps1

Line 569 reads as follows:

Import-PFXCertificate -CertStoreLocation Cert:\localmachine\My �Exportable -FilePath $newPFXCertLocation

Note that there is an unrecognized character before the Exportable parameter flag.

It should be

Import-PFXCertificate -CertStoreLocation Cert:\localmachine\My -Exportable -FilePath $newPFXCertLocation

(A dash before Exportable)

This was breaking the script code execution and hence halting the rollover process.

I get "No appliances registered under Migrate project PROJECTNAME details..Aborting..." in all environments

Hello team. I have Azure Migrate running in some Tenants, in all of them I get "No appliances registered under Migrate project PROJECTNAME details..Aborting..." for the Mitigration-Script, although the assessment script shows one affected App (Azure Migrate). What should I do? I guess it is because of multiple Subscriptions where the Azure Migrate project is in a different Subscription then the default one.

Unable to authenticate with CAE-enabled tenant

When authenticating to an Azure AD tenant with Continuous Access Evaluation enabled, an "InvalidAuthenticationToken" error occurs. This makes it impossible to see the affected apps.
image

Since I am not a native English speaker, I use a machine translation tool. I apologize if the text is difficult to understand.

Issue with multiple subscription tenant

Hi there,

I am working with multiple Azure tenants and trying to run this module. For the tenants without multiple subscriptions, it works great. For the tenant with the multiples it throws an error:

PS C:\WINDOWS\system32> Get-AffectedKeyCredentials -tenantID -ObjectClass application -ScanAll
WARNING: Are you sure you want to run the commandlet for all applications in your tenant? The commandlet may take a
long time to run, and requests for a large number of applications could be throttled.

Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): A
WARNING: This script requires the powershell module 'Az.Accounts' to installed.
WARNING: If this is not installed, you will be asked to install the module.
WARNING: Please refer: https://docs.microsoft.com/en-us/powershell/azure/install-az-ps?view=azps-6.5.0

Connecting to AAD tenant...
WARNING: TenantId '' contains more than one active subscription. First one will be
selected for further use. To select another subscription, use Set-AzContext.
Connected to

Invoke-RestMethod : The remote server returned an error: (401) Unauthorized.
At C:\Program Files\WindowsPowerShell\Modules\AffectedKeyCredentials\0.2\AffectedKeyCredentials.psm1:139 char:29

  • ... jectCount = Invoke-RestMethod -Uri $url -Headers $authHeader -Method ...
  •             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
      eption
    • FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

Do you know of any issues when working with this scenario?

Script for CVE-2021-42306 appears to be Windows only

The script (https://github.com/microsoft/aad-app-credential-tools/blob/main/azure-automation/CVE-2021-42306-AutomationAssessAndMitigate.ps1) used to determine if Automation accounts are vulnerable to CVE-2021-42306 and mitigate the issue appears to be Windows only.

Running it with PowerShell 7.2 and PowerShell Core gives the error below.

./CVE-2021-42306-AutomationAssessAndMitigate.ps1: The script 'CVE-2021-42306-AutomationAssessAndMitigate.ps1' cannot be run because it contained a "#requires" statement for PowerShell editions 'Desktop'. The edition of PowerShell that is required by the script does not match the currently running PowerShell Core edition.

Please can a cross-platform version of the script be provided.

Unable to looping through multiple subscriptions without getting prompted by credentials window?

Hi Team,

From this cmdlet example: https://github.com/microsoft/aad-app-credential-tools/blob/main/azuread/azuread-application-credential-assessment-powershell-guide.md#examples

I always get prompted with the 'Sign-in to your account' when I loop through the command for each of my Azure subscriptions.

Is this a bug or am I missing something here to make the code loop through multiple Azure subscriptions without a prompt?

Support enforcing a specific AAD tenant

For users with multiple AAD-tenants the scripts are very noisy (lots of warnings when trying to iterate over stuff not in the currently authenticated tenant) or do not work properly at all. Adding a parameter to enforce using a specific tenant should mitigate this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.