Skip to content

SFI: More ROPC work #42687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ services:
- "5433:1433"
```

[!INCLUDE [managed-identities](../../../framework/includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

This docker-compose.yml file is a simplified and merged version. It contains static configuration data for each container (like the name of the custom image), which is always required, and configuration information that might depend on the deployment environment, like the connection string. In later sections, you will learn how to split the docker-compose.yml configuration into multiple docker-compose files and override values depending on the environment and execution type (debug or release).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ builder.Services.AddDbContext<CatalogContext>(options =>
});
```

[!INCLUDE [managed-identities](../../../framework/includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

## Execution strategies and explicit transactions using BeginTransaction and multiple DbContexts

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public class SqlConnectionHealthCheck : IHealthCheck
}
```

[!INCLUDE [managed-identities](../../../framework/includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

Note that in the previous code, `Select 1` is the query used to check the Health of the database. To monitor the availability of your microservices, orchestrators like Kubernetes periodically perform health checks by sending requests to test the microservices. It's important to keep your database queries efficient so that these operations are quick and don’t result in a higher utilization of resources.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ services:
- ConnectionString=${ESHOP_AZURE_COSMOSDB:-mongodb://nosqldata}
```

[!INCLUDE [managed-identities](../../../framework/includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

The `ConnectionString` environment variable is resolved this way: If the `ESHOP_AZURE_COSMOSDB` global variable is defined in the `.env` file with the Azure Cosmos DB connection string, it will use it to access the Azure Cosmos DB database in the cloud. If it’s not defined, it will take the `mongodb://nosqldata` value and use the development MongoDB container.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ builder.Services.AddDbContext<CatalogContext>(options =>
});
```

[!INCLUDE [managed-identities](../../../framework/includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

### Additional resources

Expand Down Expand Up @@ -256,7 +256,7 @@ catalog-api:
- "5101:80"
```

[!INCLUDE [managed-identities](../../../framework/includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

The docker-compose.yml files at the solution level are not only more flexible than configuration files at the project or microservice level, but also more secure if you override the environment variables declared at the docker-compose files with values set from your deployment tools, like from Azure DevOps Services Docker deployment tasks.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ services:
- "27017:27017"
```

[!INCLUDE [managed-identities](../../../framework/includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

So, to run the functional/integration tests you must first run this command, from the solution test folder:

Expand Down
2 changes: 1 addition & 1 deletion docs/core/extensions/configuration-providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ When an environment variable is discovered and loaded into configuration with an
| `SQLAZURECONNSTR_{KEY}` | `ConnectionStrings:{KEY}` | Key: `ConnectionStrings:{KEY}_ProviderName`:<br>Value: `System.Data.SqlClient` |
| `SQLCONNSTR_{KEY}` | `ConnectionStrings:{KEY}` | Key: `ConnectionStrings:{KEY}_ProviderName`:<br>Value: `System.Data.SqlClient` |

[!INCLUDE [managed-identities](../../framework/includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../includes/managed-identities.md)]

### Environment variables set in launchSettings.json

Expand Down
4 changes: 2 additions & 2 deletions docs/framework/data/adonet/ado-net-code-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The following code listings demonstrate how to retrieve data from a database usi

The code in this example assumes that you can connect to the `Northwind` sample database on Microsoft SQL Server. The code creates a <xref:System.Data.SqlClient.SqlCommand> to select rows from the Products table, adding a <xref:System.Data.SqlClient.SqlParameter> to restrict the results to rows with a UnitPrice greater than the specified parameter value, in this case 5. The <xref:System.Data.SqlClient.SqlConnection> is opened inside a `using` block, which ensures that resources are closed and disposed when the code exits. The code executes the command by using a <xref:System.Data.SqlClient.SqlDataReader>, and displays the results in the console window. If you're using `System.Data.SqlClient`, you should consider upgrading to `Microsoft.Data.SqlClient` as it's where future investments and new feature developments are being made. For more information, see [Introducing the new Microsoft.Data.SqlClient](https://devblogs.microsoft.com/dotnet/introducing-the-new-microsoftdatasqlclient).

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

[!code-csharp[DataWorks SampleApp.SqlClient#1](../../../../samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SampleApp.SqlClient/CS/source.cs#1)]
[!code-vb[DataWorks SampleApp.SqlClient#1](../../../../samples/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SampleApp.SqlClient/VB/source.vb#1)]
Expand All @@ -62,7 +62,7 @@ The code in this example assumes that you can connect to the Microsoft Access No

The code in this example assumes a connection to DEMO.CUSTOMER on an Oracle server. You must also add a reference to the System.Data.OracleClient.dll. The code returns the data in an <xref:System.Data.OracleClient.OracleDataReader>.

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

[!code-csharp[DataWorks SampleApp.Oracle#1](../../../../samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks SampleApp.Oracle/CS/source.cs#1)]
[!code-vb[DataWorks SampleApp.Oracle#1](../../../../samples/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks SampleApp.Oracle/VB/source.vb#1)]
Expand Down
4 changes: 2 additions & 2 deletions docs/framework/data/adonet/asynchronous-programming.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class A {
}
```

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

### Use SQL transactions and the new asynchronous feature

Expand Down Expand Up @@ -322,7 +322,7 @@ class Program {
}
```

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

### Cancel an asynchronous operation

Expand Down
12 changes: 6 additions & 6 deletions docs/framework/data/adonet/code-access-security.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ To determine whether code is authorized to access a resource or perform an opera
</connectionStrings>
```

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

#### KeyRestrictions syntax

Expand All @@ -107,7 +107,7 @@ To determine whether code is authorized to access a resource or perform an opera
</connectionStrings>
```

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

#### KeyRestrictionBehavior with PreventUsage syntax

Expand All @@ -123,7 +123,7 @@ To determine whether code is authorized to access a resource or perform an opera
</connectionStrings>
```

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

#### KeyRestrictionBehavior with AllowOnly syntax

Expand All @@ -147,7 +147,7 @@ To determine whether code is authorized to access a resource or perform an opera
</connectionStrings>
```

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

### Enable partial trust with a custom permission set

Expand Down Expand Up @@ -175,7 +175,7 @@ AllowBlankPassword="False">
</PermissionSet>
```

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

## Verify ADO.NET code access using security permissions

Expand Down Expand Up @@ -209,7 +209,7 @@ Connection opened, as expected.
Failed, as expected: Request failed.
```

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

## Interoperability with unmanaged code

Expand Down
2 changes: 1 addition & 1 deletion docs/framework/data/adonet/connection-string-builders.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ builder["Initial Catalog"] = "AdventureWorks;NewValue=Bad";
Console.WriteLine(builder.ConnectionString);
```

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

The output shows that the <xref:System.Data.SqlClient.SqlConnectionStringBuilder> handled this correctly by escaping the extra value in double quotation marks instead of appending it to the connection string as a new key/value pair.

Expand Down
12 changes: 6 additions & 6 deletions docs/framework/data/adonet/connection-string-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Windows Authentication (sometimes referred to as *integrated security*) can be u
> [!NOTE]
> `Integrated Security=true` throws an exception when used with the `OleDb` provider.

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

## SqlClient connection strings

Expand All @@ -61,7 +61,7 @@ The syntax for a <xref:System.Data.SqlClient.SqlConnection> connection string is
database=AdventureWorks;server=(local)"
```

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

### SQL Server authentication with SqlClient

Expand All @@ -76,7 +76,7 @@ When you connect to Azure SQL Database or to Azure SQL Data Warehouse and provid
> [!NOTE]
> Windows authentication takes precedence over SQL Server logins. If you specify both `Integrated Security=true` as well as a user name and password, the user name and password are ignored and Windows authentication is used.

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

### Connect to a named instance of SQL Server

Expand Down Expand Up @@ -150,7 +150,7 @@ Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\Northwind.mdb;Jet OLEDB:System D
> [!IMPORTANT]
> It is possible to supply connection information for an **OleDbConnection** in a Universal Data Link (UDL) file; however you should avoid doing so. UDL files are not encrypted, and expose connection string information in clear text. Because a UDL file is an external file-based resource to your application, it cannot be secured using .NET Framework. UDL files are not supported for **SqlClient**.

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

### Use DataDirectory to connect to Access/Jet

Expand Down Expand Up @@ -183,7 +183,7 @@ Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\MyExcel.xls;Extended Properties=
"Provider=MSDataShape;Data Provider=SQLOLEDB;Data Source=(local);Initial Catalog=pubs;Integrated Security=SSPI;"
```

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

## Odbc connection strings

Expand All @@ -205,7 +205,7 @@ Data Source=Oracle9i;User ID=*****;Password=*****;

For more information on ODBC connection string syntax, see <xref:System.Data.OracleClient.OracleConnection.ConnectionString%2A>.

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

## See also

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dev_langs:

Embedding connection strings in your application's code can lead to security vulnerabilities and maintenance problems. Unencrypted connection strings compiled into an application's source code can be viewed using the [Ildasm.exe (IL Disassembler)](../../tools/ildasm-exe-il-disassembler.md) tool. Moreover, if the connection string ever changes, your application must be recompiled. For these reasons, we recommend storing connection strings in an application configuration file.

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

## Application Configuration Files

Expand Down Expand Up @@ -163,7 +163,7 @@ Embedding connection strings in your application's code can lead to security vul

You must add a reference to `System.Configuration.dll` in your project for the code to run.

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

[!code-csharp[DataWorks ConnectionStrings.Encrypt#1](../../../../samples/snippets/csharp/VS_Snippets_ADO.NET/DataWorks ConnectionStrings.Encrypt/CS/source.cs#1)]
[!code-vb[DataWorks ConnectionStrings.Encrypt#1](../../../../samples/snippets/visualbasic/VS_Snippets_ADO.NET/DataWorks ConnectionStrings.Encrypt/VB/source.vb#1)]
Expand Down
2 changes: 1 addition & 1 deletion docs/framework/data/adonet/connection-strings.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Typing mistakes can cause errors. For example, `Integrated Security=true` is val

Connection strings constructed manually at run time from unvalidated user input are vulnerable to string-injection attacks and jeopardize security at the data source. To address these problems, *ADO.NET* 2.0 introduced [connection string builders](connection-string-builders.md) for each *.NET Framework* data provider. These connection string builders expose parameters as strongly typed properties and make it possible to validate the connection string before it's sent to the data source.

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

## In this section

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ The process of obtaining a <xref:System.Data.Common.DbProviderFactory> involves
</configuration>
```

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

### Retrieve a Connection String by Provider Name

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The .NET Framework Data Provider for OLE DB automatically pools connections usin
Provider=SQLOLEDB;OLE DB Services=-4;Data Source=localhost;Integrated Security=SSPI;
```

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

We recommend that you always close or dispose of a connection when you're finished using it in order to return the connection to the pool. Connections that aren't explicitly closed might not get returned to the pool. For example, a connection that has gone out of scope but that has not been explicitly closed will only be returned to the connection pool if the maximum pool size is reached and the connection is still valid.

Expand Down
2 changes: 1 addition & 1 deletion docs/framework/data/adonet/performance-counters.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ ADO.NET 2.0 introduced expanded support for performance counters that includes s

When using Windows Authentication (integrated security), you must monitor both the `NumberOfActiveConnectionPoolGroups` and `NumberOfActiveConnectionPools` performance counters. The reason is that connection pool groups map to unique connection strings. When integrated security is used, connection pools map to connection strings and additionally create separate pools for individual Windows identities. For example, if Fred and Julie, each within the same AppDomain, both use the connection string `"Data Source=MySqlServer;Integrated Security=true"`, a connection pool group is created for the connection string, and two additional pools are created, one for Fred and one for Julie. If John and Martha use a connection string with an identical SQL Server login, `"Data Source=MySqlServer;User Id=lowPrivUser;Password=[PLACEHOLDER]"`, then only a single pool is created for the **lowPrivUser** identity.

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

### Activating Off-By-Default Counters

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Protecting access to your data source is one of the most important goals when se

Security vulnerabilities involving connection strings can arise based on the type of authentication used, how connection strings are persisted in memory and on disk, and the techniques used to construct them at run time.

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

## Use Windows Authentication

Expand Down
2 changes: 1 addition & 1 deletion docs/framework/data/adonet/secure-data-access.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ To write secure ADO.NET code, you have to understand the security mechanisms ava

When connecting to Microsoft SQL Server, you can use Windows Authentication, also known as Integrated Security, which uses the identity of the current active Windows user rather than passing a user ID and password. Using Windows Authentication is recommended for on-premises databases because user credentials aren't exposed in the connection string. If you can't use Windows Authentication to connect to SQL Server, then consider creating connection strings at run time using the <xref:System.Data.SqlClient.SqlConnectionStringBuilder>.

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

The credentials used for authentication need to be handled differently based on the type of application. For example, in a Windows Forms application, the user can be prompted to supply authentication information, or the user's Windows credentials can be used. However, a Web application often accesses data using credentials supplied by the application itself rather than by the user.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ using (SqlConnection connection = new SqlConnection(
}
```

[!INCLUDE [managed-identities](../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]

If `Min Pool Size` is either not specified in the connection string or is specified as zero, the connections in the pool will be closed after a period of inactivity. However, if the specified `Min Pool Size` is greater than zero, the connection pool is not destroyed until the `AppDomain` is unloaded and the process ends. Maintenance of inactive or empty pools involves minimal system overhead.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ In this connection string:
> [!NOTE]
> You can also use the <xref:System.Data.SqlClient.SqlConnectionStringBuilder.UserInstance?displayProperty=nameWithType> and <xref:System.Data.SqlClient.SqlConnectionStringBuilder.AttachDBFilename?displayProperty=nameWithType> properties to build a connection string at run time.

[!INCLUDE [managed-identities](../../../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../../../includes/managed-identities.md)]

### Using the &#124;DataDirectory&#124; Substitution String

Expand Down
2 changes: 1 addition & 1 deletion docs/framework/whats-new/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -711,7 +711,7 @@ ASP.NET processes requests in a predefined pipeline that includes 23 events. ASP

In .NET Framework 4.7 and earlier versions, ASP.NET allowed developers to store user credentials with hashed passwords in configuration files using either MD5 or SHA1. Starting with .NET Framework 4.7.1, ASP.NET also supports new secure SHA-2 hash options such as SHA256, SHA384, and SHA512. SHA1 remains the default, and a non-default hash algorithm can be defined in the web configuration file.

[!INCLUDE [managed-identities](../includes/managed-identities.md)]
[!INCLUDE [managed-identities](../../includes/managed-identities.md)]

## What's new in .NET Framework 4.7

Expand Down
Loading
Loading