Skip to content

Commit c9be145

Browse files
committed
(#1057) Add connection string info for CCM 0.13.0
Added a notice to the Database/Service/Web setup pages for CCM informing users about the change to CCM's connection strings, with information on what to do if they want a _completely_ secure connection to the SQL Server instance.
1 parent 54e2820 commit c9be145

File tree

4 files changed

+43
-19
lines changed

4 files changed

+43
-19
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
3+
---
4+
5+
import Callout from '@choco/components/Callout.astro';
6+
7+
<Callout type="warning">
8+
As of Chocolatey Central Management v0.13.0, the SQL connection mode has changed to secure-by-default. By default, all connection strings will assume `Encrypt=true;` and attempt a connection to the SQL Server over SSL. If you wish to disable this, you must pass a complete connection string to the `/ConnectionString` package parameter that contains an explicit `Encrypt=false;` parameter.
9+
10+
To accommodate this new default, the package installation will automatically add the `TrustServerCertificate=True` parameter to the connection string it constructs or receives if the initial connection to the SQL server fails without it.
11+
12+
If you would like to ensure a completely secure SQL connection, you must [install a trusted SSL Certificate on the SQL Server instance](https://learn.microsoft.com/en-us/sql/database-engine/configure-windows/manage-certificates?view=sql-server-ver16) before installing, upgrading, or reinstalling Chocolatey Central Management packages.
13+
If you have already installed v0.13.0 or later versions of Chocolatey Central Management, you will need to explicitly pass the SQL connection package parameters when upgrading or reinstalling in order to ensure the connection is established in a fully secure mode.
14+
</Callout>

src/content/docs/en-us/central-management/setup/database.mdx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Xref from '@components/Xref.astro';
1010
import TabsPane from '@choco/components/tabs/TabsPane.astro';
1111
import TabsPaneContainer from '@choco/components/tabs/TabsPaneContainer.astro';
1212
import TabsTabContainer from '@choco/components/tabs/TabsTabContainer.astro';
13+
import CentralManagementSecureConnectionStrings from '@components/docs/CentralManagementSecureConnectionStrings.mdx';
1314

1415
At the end of this, we should have a fully ready to go SQL Server:
1516

@@ -165,7 +166,7 @@ The Chocolatey Central Management database package will add or update a database
165166

166167
### Package Parameters
167168

168-
* `/ConnectionString:` - The SQL Server database connection string to be used to connect to the Chocolatey Central Management database. Defaults to default or explicit values for `/SqlServiceInstance` and `/Database`, along with Integrated Security (`Server=<LOCAL COMPUTER FQDN NAME>; Database=ChocolateyManagement; Trusted_Connection=True;`). The account should have `db_owner` access to the database ([database owner](https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/database-level-roles#fixed-database-roles)).
169+
* `/ConnectionString:` - The SQL Server database connection string to be used to connect to the Chocolatey Central Management database. By default, this value is constructed from the default or explicit values for `/SqlServiceInstance` and `/Database`, and uses Integrated Security (with all default values, this value will look like the following: `Server=<LOCAL COMPUTER FQDN NAME>; Database=ChocolateyManagement; Trusted_Connection=True; TrustServerCertificate=True;`). The account should have [`db_owner`](https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/database-level-roles#fixed-database-roles) access to the database.
169170
* `/SqlServerInstance:` - Instance name of the SQL Server database to connect to. Alternative to passing full connection string with `/ConnectionString`. Uses `/Database` (below) to build a connection string. Defaults to `<LOCAL COMPUTER FQDN NAME>`.
170171
* `/Database:` - Name of the SQL Server database to use. Alternative to passing full connection string with `/ConnectionString`. Uses `/SqlServerInstance` (above) to build a connection string. Defaults to `ChocolateyManagement`.
171172
* `/SkipDatabasePermissionCheck` - By default, a check will be completed to ensure that the installing user has access to create a new database, based on the provided/computed connection string. If this check isn't required, for example, the database has already been created or permissions will error, this step can be skipped using this parameter. Available with CCM v0.2.0+.
@@ -176,6 +177,8 @@ The Chocolatey Central Management database package will add or update a database
176177

177178
### Database Authentication Scenarios
178179

180+
<CentralManagementSecureConnectionStrings />
181+
179182
* <Xref title="Scenario 1 - Windows Authentication to Local SQL Server" value="ccm-database" anchor="scenario-one" />
180183
* <Xref title="Scenario 2 - Active Directory Authentication to Remote SQL Server" value="ccm-database" anchor="scenario-two" />
181184
* <Xref title="Scenario 3 - SQL Server Authentication to Local SQL Server" value="ccm-database" anchor="scenario-three" />
@@ -241,9 +244,9 @@ export const tabs1 = [
241244
</Callout>
242245

243246
<Callout type="warning">
244-
**Installs**: Please ensure the user running the package installation is able to create databases unless you also pass `/SkipDatabasePermissionCheck` (in that case you simply need `db_owner` to the database being managed if it was pre-created).
245-
246-
**Upgrades**: Please ensure the user running the package installation has been granted `db_owner` access to an existing database.
247+
**Installation**: Please either ensure the user running the package installation is able to create databases or pass `/SkipDatabasePermissionCheck`, if you have `db_owner` permission to the pre-created database.
248+
249+
**Upgrade**: Please ensure the user running the package installation has been granted `db_owner` access to the existing database.
247250
</Callout>
248251
</TabsPane>
249252
<TabsPane content={tabs1[2]}>
@@ -291,9 +294,9 @@ export const tabs1 = [
291294
</Callout>
292295

293296
<Callout type="warning">
294-
**Installs**: Please ensure the login credentials provided are able to create databases unless you also pass `/SkipDatabasePermissionCheck` (in that case you simply need `db_owner` to the database being managed if it was pre-created).
295-
296-
**Upgrades**: Please ensure the login credentials provided have been given `db_owner` access to an existing database.
297+
**Installation**: Please either ensure the user running the package installation is able to create databases or pass `/SkipDatabasePermissionCheck`, if you have `db_owner` permission to the pre-created database.
298+
299+
**Upgrade**: Please ensure the user running the package installation has been granted `db_owner` access to the existing database.
297300
</Callout>
298301
</TabsPane>
299302
</TabsPaneContainer>
@@ -419,12 +422,12 @@ Chocolatey Central Management has specific compatibility requirements with quite
419422

420423
### What is the minimum required configuration for the appsettings.json file?
421424

422-
As of Chocolatey Central Management v0.6.2, the default settings in the `appsettings.json` for the database package are:
425+
As of Chocolatey Central Management v0.13.0, the default settings in the `appsettings.json` for the database package are:
423426

424427
```json
425428
{
426429
"ConnectionStrings": {
427-
"Default": "Server=<HOST_NAME_OF_MACHINE_BEING_INSTALLED_ONTO>; Database=ChocolateyManagement; Trusted_Connection=True;"
430+
"Default": "Server=<HOST_NAME_OF_MACHINE_BEING_INSTALLED_ONTO>; Database=ChocolateyManagement; Trusted_Connection=True; TrustServerCertificate=True;"
428431
}
429432
}
430433
```

src/content/docs/en-us/central-management/setup/service.mdx

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Xref from '@components/Xref.astro';
1010
import TabsPane from '@choco/components/tabs/TabsPane.astro';
1111
import TabsPaneContainer from '@choco/components/tabs/TabsPaneContainer.astro';
1212
import TabsTabContainer from '@choco/components/tabs/TabsTabContainer.astro';
13+
import CentralManagementSecureConnectionStrings from '@components/docs/CentralManagementSecureConnectionStrings.mdx';
1314

1415
This is the service that the agents (`chocolatey-agent`) communicates with. You could install one or more of these depending on the size of your environment (not multiple on one machine though). The FQDN and certificate used determine what the URL will be for the agents to check into Chocolatey Central Management.
1516

@@ -72,7 +73,7 @@ Note items with "`:`" mean a value should be provided. Items without are simply
7273
* `/PortNumber:` - The port the Chocolatey Management Service will listen on. This will automatically create a rule to open the firewall on the port specified. Defaults to `24020`.
7374
* `/CertificateDnsName:` - The DNS name of the self-signed certificate that is generated if no existing certificate thumbprint is provided using the `/CertificateThumbprint` parameter (below). Defaults to `<LOCAL COMPUTER FQDN NAME>`.
7475
* `/CertificateThumbprint:` - Provide the thumbprint of an existing certificate (already installed in `LocalMachine\TrustedPeople` certificate store) to use for secure communication with clients. Defaults to a new self-signed SSL certificate on first installation / reuses existing on upgrades.
75-
* `/ConnectionString:` - The SQL Server database connection string to be used to connect to the Chocolatey Central Management database. Defaults to default or explicit values for `/SqlServiceInstance` and `/Database`, along with Integrated Security (`Server=<LOCAL COMPUTER FQDN NAME>; Database=ChocolateyManagement; Trusted_Connection=True;`). The account should have `db_datareader`/`db_datawriter` access to the database ([data reader / data writer](https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/database-level-roles#fixed-database-roles)).
76+
* `/ConnectionString:` - The SQL Server database connection string to be used to connect to the Chocolatey Central Management database. By default, this value is constructed from the default or explicit values for `/SqlServiceInstance` and `/Database`, and uses Integrated Security (with all default values, this value will look like the following: `Server=<LOCAL COMPUTER FQDN NAME>; Database=ChocolateyManagement; Trusted_Connection=True; TrustServerCertificate=True;`). The account should have [`db_datareader`/`db_datawriter`](https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/database-level-roles#fixed-database-roles) access to the database.
7677
* `/SqlServerInstance:` - Instance name of the SQL Server database to connect to. Alternative to passing full connection string with `/ConnectionString`. Uses `/Database` (below) to build a connection string. Defaults to `<LOCAL COMPUTER FQDN NAME>`.
7778
* `/Database:` - Name of the SQL Server database to use. Alternative to passing full connection string with `/ConnectionString`. Uses `/SqlServerInstance` (above) to build a connection string. Defaults to `ChocolateyManagement`.
7879

@@ -128,6 +129,8 @@ When Chocolatey manages the password for a local Administrator, it creates a ver
128129

129130
### Database Authentication Scenarios
130131

132+
<CentralManagementSecureConnectionStrings />
133+
131134
* <Xref title="Scenario 1 - Windows Authentication to Local SQL Server" value="ccm-service" anchor="scenario-one" />
132135
* <Xref title="Scenario 2 - Active Directory Authentication to Remote SQL Server" value="ccm-service" anchor="scenario-two" />
133136
* <Xref title="Scenario 3 - SQL Server Authentication to Local SQL Server" value="ccm-service" anchor="scenario-three" />
@@ -252,12 +255,12 @@ This situation can occur with any version of Chocolatey Central Management up to
252255

253256
### What is the minimum required configuration for the `appsettings.json` file?
254257

255-
As of Chocolatey Central Management v0.6.2, the default configuration values in the `appsettings.json` for the Chocolatey Central Management service are:
258+
As of Chocolatey Central Management v0.13.0, the default configuration values in the `appsettings.json` for the Chocolatey Central Management service are:
256259

257260
```json
258261
{
259262
"ConnectionStrings": {
260-
"Default": "Server=<HOST_NAME_OF_MACHINE_BEING_INSTALLED_ONTO>; Database=ChocolateyManagement; Trusted_Connection=True;"
263+
"Default": "Server=<HOST_NAME_OF_MACHINE_BEING_INSTALLED_ONTO>; Database=ChocolateyManagement; Trusted_Connection=True; TrustServerCertificate=True;"
261264
},
262265
"CertificateThumbprint": "<THUMBPRINT_OF_CERTIFICATE_FOUND_DURING_INSTALLATION>"
263266
}
@@ -412,7 +415,7 @@ It depends. You can simply go to the `appsettings.json` file and adjust the conn
412415
```json
413416
{
414417
"ConnectionStrings": {
415-
"Default": "Server=<HOST_NAME_OF_MACHINE_BEING_INSTALLED_ONTO>; Database=ChocolateyManagement; Trusted_Connection=True;"
418+
"Default": "Server=<HOST_NAME_OF_MACHINE_BEING_INSTALLED_ONTO>; Database=ChocolateyManagement; Trusted_Connection=True; TrustServerCertificate=True;"
416419
}
417420
}
418421
```
@@ -468,12 +471,13 @@ You may also receive a differently-worded error if the certificate used by the C
468471
Starting in Chocolatey Central Management v0.6.2, the Chocolatey Central Management Service package will attempt to select an appropriate certificate during installation, and store the thumbprint in the `appsettings.json` file.
469472
You can also specify the thumbprint for the certificate to use as the `/CertificateThumbprint` package parameter during installation or upgrade.
470473

471-
If you need to change the certificate you're using after installation, you can modify the entry in the `appsettings.json` file for the Chocolatey Central Management service, shown below.
474+
If you need to change the certificate you're using after installation, you can modify the entry in the `appsettings.json` file for the Chocolatey Central Management service.
475+
Below is a sample of what the `appsettings.json` file looks like by default as of Chocolatey Central Management v0.13.0.
472476

473477
```json
474478
{
475479
"ConnectionStrings": {
476-
"Default": "Server=<HOST_NAME_OF_MACHINE_BEING_INSTALLED_ONTO>; Database=ChocolateyManagement; Trusted_Connection=True;"
480+
"Default": "Server=<HOST_NAME_OF_MACHINE_BEING_INSTALLED_ONTO>; Database=ChocolateyManagement; Trusted_Connection=True; TrustServerCertificate=True;"
477481
},
478482
"CertificateThumbprint": "<THUMBPRINT_OF_CERTIFICATE_FOUND_DURING_INSTALLATION>"
479483
}

src/content/docs/en-us/central-management/setup/website.mdx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import IisWsusChocolatey from '@components/docs/IisWsusChocolatey.mdx';
1111
import TabsPane from '@choco/components/tabs/TabsPane.astro';
1212
import TabsPaneContainer from '@choco/components/tabs/TabsPaneContainer.astro';
1313
import TabsTabContainer from '@choco/components/tabs/TabsTabContainer.astro';
14+
import CentralManagementSecureConnectionStrings from '@components/docs/CentralManagementSecureConnectionStrings.mdx';
1415

1516
This is the Chocolatey Central Management website that gives an API and a web layer to centrally manage information about your environment and manage endpoints with deployment tasks.
1617

@@ -59,7 +60,7 @@ Note items with "`:`" mean a value should be provided. Items without are simply
5960
</Callout>
6061
* `/Password:` - Password for the user. Defaults to a Windows autogenerated secure password for the IIS AppPool.
6162
* `/EnterPassword` - Receive the password at runtime as a secure string. Requires input at runtime whe installing/upgrading the package.
62-
* `/ConnectionString:` - The SQL Server database connection string to be used to connect to the Chocolatey Central Management database. Defaults to default or explicit values for `/SqlServiceInstance` and `/Database`, along with Integrated Security (`Server=<LOCAL COMPUTER FQDN NAME>; Database=ChocolateyManagement; Trusted_Connection=True;`). The account should have `db_datareader`/`db_datawriter` access to the database ([data reader / data writer](https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/database-level-roles#fixed-database-roles)).
63+
* `/ConnectionString:` - The SQL Server database connection string to be used to connect to the Chocolatey Central Management database. By default, this value is constructed from the default or explicit values for `/SqlServiceInstance` and `/Database`, and uses Integrated Security (with all default values, this value will look like the following: `Server=<LOCAL COMPUTER FQDN NAME>; Database=ChocolateyManagement; Trusted_Connection=True; TrustServerCertificate=True;`). The account should have [`db_datareader`/`db_datawriter`](https://docs.microsoft.com/en-us/sql/relational-databases/security/authentication-access/database-level-roles#fixed-database-roles) access to the database.
6364
* `/SqlServerInstance:` - Instance name of the SQL Server database to connect to. Alternative to passing full connection string with `/ConnectionString`. Uses `/Database` (below) to build a connection string. Defaults to `<LOCAL COMPUTER FQDN NAME>`.
6465
* `/Database:` - Name of the SQL Server database to use. Alternative to passing full connection string with `/ConnectionString`. Uses `/SqlServerInstance` (above) to build a connection string. Defaults to `ChocolateyManagement`.
6566

@@ -91,6 +92,8 @@ This includes (but may not be limited to):
9192

9293
### Database Authentication Scenarios
9394

95+
<CentralManagementSecureConnectionStrings />
96+
9497
* <Xref title="Scenario 1 - Windows Authentication to Local SQL Server" value="ccm-website" anchor="scenario-one" />
9598
* <Xref title="Scenario 2 - Active Directory Authentication to Remote SQL Server" value="ccm-website" anchor="scenario-two" />
9699
* <Xref title="Scenario 3 - SQL Server Authentication to Local SQL Server" value="ccm-website" anchor="scenario-three" />
@@ -272,7 +275,7 @@ Here is a copy of items that can be set. They are not required to be encrypted.
272275
```json
273276
{
274277
"ConnectionStrings": {
275-
"Default": "Server=<HOST_NAME_OF_MACHINE_BEING_INSTALLED_ONTO>; Database=ChocolateyManagement; Trusted_Connection=True;"
278+
"Default": "Server=<HOST_NAME_OF_MACHINE_BEING_INSTALLED_ONTO>; Database=ChocolateyManagement; Trusted_Connection=True; TrustServerCertificate=True;"
276279
},
277280
"App": {
278281
"WebSiteRootAddress": "http://<FQDN_OR_BINDING_HERE>"
@@ -311,7 +314,7 @@ As of Chocolatey Central Management v0.6.2, the default settings in the `appsett
311314
```json
312315
{
313316
"ConnectionStrings": {
314-
"Default": "Server=<HOST_NAME_OF_MACHINE_BEING_INSTALLED_ONTO>; Database=ChocolateyManagement; Trusted_Connection=True;"
317+
"Default": "Server=<HOST_NAME_OF_MACHINE_BEING_INSTALLED_ONTO>; Database=ChocolateyManagement; Trusted_Connection=True; TrustServerCertificate=True;"
315318
},
316319
"App": {
317320
"WebSiteRootAddress": "http://<FQDN_OR_BINDING_HERE>"
@@ -351,7 +354,7 @@ It depends. You can simply go to the `appsettings.json` file and adjust the conn
351354
```json
352355
{
353356
"ConnectionStrings": {
354-
"Default": "Server=<HOST_NAME_OF_MACHINE_BEING_INSTALLED_ONTO>; Database=ChocolateyManagement; Trusted_Connection=True;"
357+
"Default": "Server=<HOST_NAME_OF_MACHINE_BEING_INSTALLED_ONTO>; Database=ChocolateyManagement; Trusted_Connection=True; TrustServerCertificate=True;"
355358
},
356359
"App": {
357360
"WebSiteRootAddress": "http://<FQDN_OR_BINDING_HERE>"

0 commit comments

Comments
 (0)