Showing posts with label security. Show all posts
Showing posts with label security. Show all posts

Monday, November 20, 2023

D365 Solution for Cloud Dev machine show error ' The remote certificate is invalid according to the validation procedure. '

 

You are getting 'The remote certificate is invalid according to the validation procedure.'Error show with all reports and  tired Rotate SSL Certificate but not complete.




will require applying the below steps and if still the same issue after this so you will need to redeploy this environment.
  1. Navigate to Lifecycle Services.

  2. In the Shared Asset library, click the Model

  3. Download the Renew WinRM certificate folder

  4. RDP to the environment

  5. Extract the zip file to a local folder

  6. Open mmc.exe and add Certificate snap-in (Computer)

  7. Open Personal\Certificates and locate the certificate with your VMs name which should have the expiration date passed

  8. Browse to the RenewWinRMCertificate folder that was previously created from extracting the zip file

  9. Select File > Open Windows PowerShell with elevated privileges (Run as Administrator)

  10. Run .\VirtualMachine-RegenerateWinRMCertificate.ps1 from the folder

  11. Refresh the Certificates console and confirm the Certificate has been created and the expiration date is now valid. (Optional: Delete expired certificate to avoid confusion)

  12. Restart the Environment from LCS (Stop \ Start)

  13. In LCS select Maintain > Rotate secrets

  14. Select 'Rotate the SSL certificates'

How to update the WinRM SSL certificate on environments deployed in your subscription - Microsoft Dynamics 365 Blog

Rotate the expired or nearly expired SSL certificate on your subscription's one-box environments - Microsoft Dynamics 365 Blog



in case when running step number 10  (Run .\VirtualMachine-RegenerateWinRMCertificate.ps1 from the folder ) and show below error 


1: Configure Network Security Rules>Go to Network Security Group of the Azure VM and change 'powershell-remote-rule' from Deny to Allow (this is just temporary; we will change it back after completing the rotation). 

Then run script It should work fine.




Sunday, January 22, 2023

D365FO - SQL get security details (such as Security roles, duties and privileges)

 SQL Query to get security details (such as Security roles, duties and privileges)

 Today, I will sharing out the list of queries which can used to get the security details.


It will cover following combinations of data.





Security roles

Security roles to duties

Security roles with privileges

Security role and duty combination along with privileges

Following list of tables are used in it.

SECURITYROLES

SECURITYOBJECTCHILDREREFERENCES

SECURITYDUTY

SECURITYPRIVILEGE

-- Get the list  of all security roles 

Select Name as SecurityRoleName FROM SecurityRole;


-- Get the list of all security roles to duties

SELECT T2.Name as SecurityRole, T3.NAME as Duty 

FROM SECURITYOBJECTCHILDREREFERENCES T1 

JOIN SECURITYROLE T2 ON T1.IDENTIFIER = T2.AOTNAME 

JOIN SECURITYDUTY T3 ON T1.CHILDIDENTIFIER = T3.IDENTIFIER

WHERE T1.OBJECTTYPE = 0 AND T1.CHILDOBJECTTYPE = 1 ;


-- Get the ;ist of all security roles with privileges 

SELECT T2.Name as SecurityRole, T3.NAME as Privileges

FROM SECURITYOBJECTCHILDREREFERENCES T1 

JOIN SECURITYROLE T2 ON T1.IDENTIFIER = T2.AOTNAME 

JOIN SECURITYPRIVILEGE T3 ON T1.CHILDIDENTIFIER = T3.IDENTIFIER

WHERE T1.OBJECTTYPE = 0 AND T1.CHILDOBJECTTYPE = 2 ;



-- Get the list of all role-duty combination with privilege 

SELECT T2.Name as SecurityRole, T2.AOTNAME as RoleSystemName,  T3.NAME AS Duty, T3.IDENTIFIER as DutySystemName, T5.NAME as Privilege, T5.IDENTIFIER as PrivilegeSystemName

FROM SECURITYOBJECTCHILDREREFERENCES T1 

JOIN SECURITYROLE T2 ON T1.IDENTIFIER = T2.AOTNAME 

JOIN SECURITYDUTY T3 ON T1.CHILDIDENTIFIER = T3.IDENTIFIER

JOIN SECURITYOBJECTCHILDREREFERENCES T4 on T4.IDENTIFIER = T3.IDENTIFIER

JOIN SECURITYPRIVILEGE T5 on T4.CHILDIDENTIFIER = T5.IDENTIFIER

WHERE T1.OBJECTTYPE = 0 AND T1.CHILDOBJECTTYPE = 1 

AND T4.OBJECTTYPE = 1 AND T4.CHILDOBJECTTYPE = 2;



Ref