Require use of proven security features, languages, & frameworks
This practice focuses on ensuring development teams use well established and proven security solutions. This is important because secure solutions require a solid foundation, and experience has taught us that attempting to invent new solutions is challenging and almost always results in increased security risk and wasted time and effort.
Additionally, some aspects of software design and development are too important to leave undefined and areas such as authentication and authorization and the associated and necessary logging for auditing are foundational controls, that many other security controls are built upon, and organizations should standardize on an approach, that provides clear consistent guidance with guardrails and means to verify their implementation to the required standard.
Additionally, you should define and publish a list of approved tools and their associated security checks, such as compiler/linker options and warnings. Engineers should strive to use the latest version of approved tools, such as compiler versions, and to take advantage of new security analysis functionality and protections.
2.1 Identity - Ensure users are using strong authentication and only have the level of permissions suitable to their needs (least privilege). See Practice 6.1 Take a Zero Trust Approach for more information.
Managed Identities (instead of SAS tokens) - Managed Identities for Azure.
- Microsoft Learn: What are managed identities for Azure resources
- Microsoft DevBlogs: Managing secrets securely in the cloud
Secure Credential Storage (KeyVault / HSM)- Implement a mechanism to inventory, monitor, maintain, and update all stored secrets. Encrypt and store application secrets and eliminate the need to include secrets and other sensitive configuration information in code or configuration files of the code. Never store passwords or other sensitive data in source code or configuration files or in plaintext files (documents, spreadsheets) stored in unprotected locations. Production secrets should not be used for development or testing.
- Microsoft Learn: Azure Key Vault
- Microsoft Learn: Safe storage of app secrets in development in ASP.NET Core
Use Standard Identity Libraries (MSAL): The Microsoft Authentication Library (MSAL) enables developers to acquire security tokens from the Microsoft identity platform to authenticate users and access secured web APIs. It can be used to provide secure access to Microsoft Graph, other Microsoft APIs, third-party web APIs, or your own web API.
- Microsoft Learn: Overview of the Microsoft Authentication Library (MSAL)
- Microsoft Learn: Public client and confidential client applications
- Microsoft Learn: Acquire and cache tokens using the Microsoft Authentication Library (MSAL)
Enforce Least Privilege: For the workload, each account type and component of the system should have only the minimum necessary privileges to perform the required operations. Provide control and management of sensitive accounts and grant access only as needed. It’s important to restrict and minimize the number of people in privileged roles who have access to secured information or resources. This reduces the chance of a malicious user getting that access, or an authorized user inadvertently compromising a sensitive resource. However, users still need to carry out privileged operations on a service and there is a need to understand what those operations are and to separate those roles such that there’s no easy opportunity for privilege escalation. The principle of “just enough administration” should be adopted to constrain the elevated privilege only to those functions the administrator requires to complete the task at hand and only on a "just-in-time" (JIT) basis and only for the minimum practical period.
- Microsoft Learn: What is Microsoft Entra Privileged Identity Management
- Microsoft Learn: Azure RBAC documentation
- Microsoft Learn: Just Enough Administration
- Microsoft Learn: What's Microsoft Entra Permissions Management
2.2 AI safety and security - Review the specific guidance for anyone building or integrating AI solutions:
- Microsoft Learn: Securing the future of artificial intelligence and machine learning at Microsoft
- Microsoft Learn: What is Azure AI Content Safety
- Microsoft Tech Community: Azure AI announces Prompt Shields for Jailbreak and Indirect prompt injection attacks
- Microsoft Build: AI safety - see Build event session BRK231 [link when available]
2.3 Data protection: Securing content used in apps - Secure implementation and connection to databases, storage accounts, unstructured documents, and more.
- Microsoft Learn: Azure customer data protection
- Microsoft Learn: Azure data security and encryption best practices
- Microsoft Build: Data considerations for AI adoption: see Build event session BRK226 [link when available]
2.4 Logging and telemetry - Provides valuable insights into the behavior and performance of systems and applications. Security logging must be enabled and retained to assist with any post-incident investigations. Telemetry helps guide developer feedback on user interaction, feature popularity, and performance metrics.
- Microsoft Learn: Monitoring and Analyzing Telemetry
- Microsoft Learn: Data Collection Basics of Azure Monitor Application Insights
- Microsoft Learn: .NET observability with OpenTelemetry
2.5 Use approved tools - Define and publish a list of approved tools and their associated security checks, such as compiler/linker options and warnings. Engineers should strive to use the latest version of approved tools, such as compiler versions, and to take advantage of new security analysis functionality and protections.
- Microsoft: SDL Tools
- GitHub: Microsoft DevSkim
A framework of IDE extensions and language analyzers that provide inline security analysis in the dev environment as the developer writes code. - Visual Studio Marketplace: Plugins for Visual Studio and more