Skip to content

Commit d521c49

Browse files
authored
Merge pull request #1060 from vexx32/ccm-connnection-strings
(#1057) Add connection string info and update dependency information for CCM 0.13.0
2 parents 7bcbb77 + 31dc062 commit d521c49

File tree

7 files changed

+60
-52
lines changed

7 files changed

+60
-52
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/index.mdx

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,9 @@ Chocolatey Central Management has specific needs that are mostly handled by pack
4646

4747
|Chocolatey Central Management|Chocolatey Agent|Chocolatey Licensed Extension|Chocolatey|
4848
|-----------------------------|----------------|-----------------------------|----------|
49-
|0.10.0 |1.1.0+ | 4.2.0+ | 1.1.0+ |
50-
|0.9.0 |1.0.0+ | 4.1.1+ | 1.1.0+ |
51-
|0.8.0 |0.13.0+ | 3.2.0+ | 0.12.0+ |
52-
|0.7.0 |0.11.0+ | 2.1.0+ | 0.10.15+ |
53-
|0.6.x |0.11.0+ | 2.1.0+ | 0.10.15+ |
54-
|0.5.x |0.11.0+ | 2.1.0+ | 0.10.15+ |
55-
|0.4.0 |0.11.0+ | 2.1.0+ | 0.10.15+ |
56-
|0.3.x |0.11.0+ | 2.1.0+ | 0.10.15+ |
57-
|0.2.x |0.10.x | 2.1.0+ | 0.10.15+ |
58-
|0.1.1 |0.9.x | 2.0.3+ | 0.10.15+ |
59-
|0.1.0 |0.9.x | 2.0.0+ | 0.10.12+ |
49+
|0.13.0 |1.1.0+ | 4.2.0+ | 1.1.0+ |
50+
|0.12.1 |1.1.0+ | 4.2.0+ | 1.1.0+ |
51+
|0.12.0 |1.1.0+ | 4.2.0+ | 1.1.0+ |
6052

6153
## Getting Chocolatey Central Management
6254

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

Lines changed: 13 additions & 10 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

@@ -25,7 +26,7 @@ At the end of this, we should have a fully ready to go SQL Server:
2526
## Step 1: Complete Prerequisites
2627

2728
* <Xref title="High-level Requirements" value="ccm-setup" anchor="high-level-requirements" />
28-
* SQL Server 2012 or later.
29+
* SQL Server 2016 or later.
2930

3031
<Callout type="info">
3132
While we'd like to support different database engines at some point in the distant future, currently only SQL Server is supported.
@@ -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/index.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ choco download dotnet4.5.2 dotnetfx --force --internalize --internalize-all-urls
6868
choco download $_ --force --internalize --internalize-all-urls --append-use-original-location --source="'https://community.chocolatey.org/api/v2/'" --output-directory="'C:\packages'"
6969
}
7070
71-
# We must use the 6.x.x versions of these packages, so we need to download/internalize these specific items. At the time of publishing, the most recent version of this package is 6.0.5, but later package versions (within the 6.x.x release) are expected to work.
72-
@('dotnet-6.0-runtime', 'dotnet-6.0-aspnetruntime') | Foreach-Object {
73-
choco download $_ --version 6.0.5 --force --internalize --internalize-all-urls --append-use-original-location --source="'https://community.chocolatey.org/api/v2/'" --output-directory="'C:\packages'"
71+
# We must use the 8.x.x versions of these packages, so we need to download/internalize these specific items. At the time of publishing, the most recent version of this package is 8.0.8, but later package versions (within the 8.x.x release) are expected to work.
72+
@('dotnet-8.0-runtime', 'dotnet-8.0-aspnetruntime') | Foreach-Object {
73+
choco download $_ --version 8.0.8 --force --internalize --internalize-all-urls --append-use-original-location --source="'https://community.chocolatey.org/api/v2/'" --output-directory="'C:\packages'"
7474
}
7575
76-
# Starting with v0.9.0 of the CCM Website package, it uses dotnet-aspnetcoremodule-v2. At the time of publishing, the most recent version of this package 16.0.22108, but later package versions (within the 17.x.x release) are expected to work
77-
choco download dotnet-aspnetcoremodule-v2 --version 16.0.22108 --force --internalize --internalize-all-urls --append-use-original-location --source="'https://community.chocolatey.org/api/v2/'" --output-directory="'C:\packages'"
76+
# Starting with v0.9.0 of the CCM Website package, it uses dotnet-aspnetcoremodule-v2. At the time of publishing, the most recent version of this package 18.0.24201, but later package versions (within the 18.x.x release) are expected to work
77+
choco download dotnet-aspnetcoremodule-v2 --version 18.0.24201 --force --internalize --internalize-all-urls --append-use-original-location --source="'https://community.chocolatey.org/api/v2/'" --output-directory="'C:\packages'"
7878
7979
# Download Licensed Packages
8080
## DO NOT RUN WITH `--internalize` and `--internalize-all-urls` - see https://github.com/chocolatey/chocolatey-licensed-issues/issues/155

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

Lines changed: 10 additions & 14 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
}
@@ -602,11 +606,3 @@ You are attempting to set up a user that is not in the local Administrators grou
602606
Please refer to the <Xref title="Chocolatey Central Management Service Windows Account Considerations" value="ccm-service" anchor="chocolatey-central-management-service-windows-account-considerations" /> and select an option that works best for your organization.
603607

604608
<Xref title="Central Management Setup" value="ccm-setup" /> | <Xref title="Chocolatey Central Management" value="central-management" />
605-
606-
### Error 1053: The service did not respond to the start or control request in a timely fashion.
607-
608-
If the Chocolatey Central Management Service is not able to be started due to "Error 1053: The service did not respond to the start or control request in a timely fashion.", it is likely caused due to no compatible versions of dotnet aspnetruntime not being installed.
609-
610-
The installed runtimes can be listed with `dotnet --list-runtimes`. Ensure that a 6.x.x version of Microsoft.AspNetCore.App is listed. If there is not a version listed, reinstall `dotnet-6.0-aspnetruntime`.
611-
612-
There is a known issue with the aspnetcoremodule-v2 installer that will uninstall the aspnetruntime on upgrade, which may be the root cause for this missing runtime. https://github.com/dotnetcore-chocolatey/dotnetcore-chocolateypackages/issues/64

0 commit comments

Comments
 (0)