Skip to content

Commit fe0c7c4

Browse files
Merge branch 'main' into anaconda_tqdm_GHSA-g7vv-2v7x-gj9p
2 parents 32c28d0 + 62e39c8 commit fe0c7c4

File tree

3 files changed

+55
-5
lines changed

3 files changed

+55
-5
lines changed

src/anaconda/.devcontainer/apply_security_patches.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
vulnerable_packages=( "pydantic=2.5.3" "joblib=1.3.1" "mistune=3.0.1" "werkzeug=3.0.3" "transformers=4.36.0" "pillow=10.3.0" "aiohttp=3.9.4" \
4-
"cryptography=42.0.4" "gitpython=3.1.41" "jupyter-lsp=2.2.2" "idna=3.7" "jinja2=3.1.4" "scrapy=2.11.2" "black=24.4.2" "tqdm=4.66.4")
4+
"cryptography=42.0.4" "gitpython=3.1.41" "jupyter-lsp=2.2.2" "idna=3.7" "jinja2=3.1.4" "scrapy=2.11.2" "black=24.4.2" "requests=2.32.2" "tqdm=4.66.4")
55

66
# Define the number of rows (based on the length of vulnerable_packages)
77
rows=${#vulnerable_packages[@]}

src/anaconda/test-project/test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ checkPythonPackageVersion "wheel" "0.38.1"
3939
checkPythonPackageVersion "nbconvert" "6.5.1"
4040
checkPythonPackageVersion "werkzeug" "3.0.3"
4141
checkPythonPackageVersion "certifi" "2022.12.07"
42-
checkPythonPackageVersion "requests" "2.31.0"
4342
checkPythonPackageVersion "cryptography" "42.0.4"
4443
checkPythonPackageVersion "transformers" "4.36.0"
4544
checkPythonPackageVersion "mpmath" "1.3.0"
@@ -54,9 +53,10 @@ checkPythonPackageVersion "jupyter-lsp" "2.2.2"
5453
checkPythonPackageVersion "idna" "3.7"
5554
checkPythonPackageVersion "jinja2" "3.1.4"
5655
checkPythonPackageVersion "scrapy" "2.11.2"
56+
checkPythonPackageVersion "requests" "2.32.2"
5757

5858
checkCondaPackageVersion "pyopenssl" "23.2.0"
59-
checkCondaPackageVersion "requests" "2.31.0"
59+
checkCondaPackageVersion "requests" "2.32.2"
6060
checkCondaPackageVersion "pygments" "2.15.1"
6161
checkCondaPackageVersion "mpmath" "1.3.0"
6262
checkCondaPackageVersion "urllib3" "1.26.17"

src/dotnet/README.md

Lines changed: 52 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,61 @@ See [history](history) for information on the contents of each version and [here
3939

4040
Alternatively, you can use the contents of [.devcontainer](.devcontainer) to fully customize your container's contents or to build it for a container host architecture not supported by the image.
4141

42+
### Enabling HTTPS in ASP.NET Core by creating a dev certificate
43+
44+
You can use `dotnet dev-certs https` inside the dev container to create a development HTTPS certificate for ASP.NET Core. However, each time the container is recreated, the development certificate will be lost. To make the development certificate survive container rebuilds, you can use a named volume.
45+
46+
For example, in `devcontainer.json`, add a named volume for the `x509stores` directory inside the `vscode` user's home folder. Also add a lifecycle script, which adds the development certificate to the dev container's trust store.
47+
48+
``` json
49+
"mounts": [
50+
{
51+
"type": "volume",
52+
"source": "x509stores",
53+
"target": "/home/vscode/.dotnet/corefx/cryptography/x509stores"
54+
}
55+
],
56+
"onCreateCommand": "bash .devcontainer/setup-dotnet-dev-cert.sh"
57+
```
58+
59+
The contents of `.devcontainer/setup-dotnet-dev-cert.sh`:
60+
61+
``` bash
62+
#!/usr/bin/env bash
63+
64+
# Change ownership of the .dotnet directory to the vscode user (to avoid permission errors)
65+
sudo chown -R vscode:vscode /home/vscode/.dotnet
66+
67+
# If there is no development certificate, this command will generate a new one
68+
dotnet dev-certs https
69+
70+
# Export the ASP.NET Core HTTPS development certificate to a PEM file
71+
sudo -E dotnet dev-certs https --export-path /usr/local/share/ca-certificates/dotnet-dev-cert.crt --format pem
72+
73+
# Add the PEM file to the trust store
74+
sudo update-ca-certificates
75+
```
76+
77+
You should see the following output when the dev container is created:
78+
79+
``` text
80+
Running the onCreateCommand from devcontainer.json...
81+
82+
The HTTPS developer certificate was generated successfully.
83+
Updating certificates in /etc/ssl/certs...
84+
rehash: warning: skipping ca-certificates.crt,it does not contain exactly one certificate or CRL
85+
1 added, 0 removed; done.
86+
Running hooks in /etc/ca-certificates/update.d...
87+
done.
88+
```
89+
90+
Now this certificate will survive container rebuilds. The certificate will also be trusted by code running inside the container like `System.Net.HttpClient`, or tools like `wget` and `curl`. If needed, you can use Docker Desktop to export the development certificate to a local directory, in case you need to add it to any other trust stores.
91+
4292
### Enabling HTTPS in ASP.NET using your own dev certificate
4393

44-
To enable HTTPS in ASP.NET, you can mount an exported copy of your local dev certificate.
94+
You can mount an exported copy of your local dev certificate for enhanced convenience. This solution is ideal for private projects, but please note that the password will be included in your `devcontainer.json`. Avoid using this method for team projects or open source projects to maintain security best practices.
4595

46-
1. Export it using the following command:
96+
1. Export the local certificate using the following command:
4797

4898
**Windows PowerShell**
4999

0 commit comments

Comments
 (0)