Skip to content

Commit a24a7dc

Browse files
authored
Merge pull request #188 from monte-carlo-data/fbenitez/vuln-597-minor-upgrade-for-libcap2
VULN-597: Upgraded libcap2
2 parents b4331f9 + ee94110 commit a24a7dc

2 files changed

Lines changed: 46 additions & 2 deletions

File tree

Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ RUN . $VENV_DIR/bin/activate && pip install setuptools==75.1.0
3333
# Azure database clients uses pyodbc which requires unixODBC and 'ODBC Driver 17 for SQL Server'
3434
# [VULN-602] update passwd to 1:4.13+dfsg1-1+deb12u1
3535
# [VULN-606] update krb5 (kerberos) to 1.20.1-2+deb12u3
36+
# [VULN-XXX] update libcap2 to 1:2.66-4+deb12u1
3637
RUN apt-get update \
3738
&& apt-get install -y gnupg gnupg2 gnupg1 curl apt-transport-https \
3839
&& curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - \
@@ -41,7 +42,8 @@ RUN apt-get update \
4142
&& apt-get update \
4243
&& ACCEPT_EULA=Y apt-get install -y msodbcsql17 unixodbc unixodbc-dev \
4344
&& apt-get install -y passwd=1:4.13+dfsg1-1+deb12u1 \
44-
&& apt-get install -y libgssapi-krb5-2=1.20.1-2+deb12u3 libkrb5-3=1.20.1-2+deb12u3 libkrb5support0=1.20.1-2+deb12u3
45+
&& apt-get install -y libgssapi-krb5-2=1.20.1-2+deb12u3 libkrb5-3=1.20.1-2+deb12u3 libkrb5support0=1.20.1-2+deb12u3 \
46+
&& apt-get install -y libcap2=1:2.66-4+deb12u1
4547

4648
# copy sources in the last step so we don't install python libraries due to a change in source code
4749
COPY apollo/ ./apollo
@@ -154,7 +156,8 @@ RUN apt-get install -y git wget # VULN-543 upgrade wget
154156
RUN apt-get update \
155157
&& apt-get install -y gnupg gnupg2 gnupg1 curl apt-transport-https libgnutls30 \
156158
&& ACCEPT_EULA=Y apt-get install -y msodbcsql17 odbcinst=2.3.11-2+deb12u1 odbcinst1debian2=2.3.11-2+deb12u1 unixodbc-dev=2.3.11-2+deb12u1 unixodbc=2.3.11-2+deb12u1 \
157-
&& apt-get install -y sqlite3=3.40.1-2+deb12u1 openssl=3.0.16-1~deb12u1 libglib2.0-0
159+
&& apt-get install -y sqlite3=3.40.1-2+deb12u1 openssl=3.0.16-1~deb12u1 libglib2.0-0 \
160+
&& apt-get install -y libcap2=1:2.66-4+deb12u1
158161

159162
# delete this file that includes an old golang version (including vulns) and is not used
160163
RUN rm -rf /opt/startupcmdgen/

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,3 +239,44 @@ invoke the health endpoint using:
239239
```shell
240240
aws lambda invoke --profile <aws_profile> --function-name <lambda_arn> --cli-binary-format raw-in-base64-out --payload '{"path": "/api/v1/test/health", "httpMethod": "GET", "queryStringParameters": {"trace_id": "1234", "full": true}}' /dev/stdout | jq '.body | fromjson'
241241
```
242+
243+
## Fixing Vulnerabilities and Verifying Library Upgrades
244+
245+
### 1. Updating Vulnerable Dependencies
246+
If a vulnerability is reported in a dependency (e.g., via Aikido, Snyk, or another scanner), update the affected package in `requirements.in` to the latest secure version. For example, to update `teradatasql`:
247+
248+
```shell
249+
# Edit requirements.in and set the desired version, e.g.:
250+
teradatasql==20.0.0.30
251+
252+
# Recompile requirements.txt:
253+
pip-compile requirements.in
254+
```
255+
256+
### 2. Rebuilding the Docker Image
257+
After updating dependencies, rebuild the Docker image to ensure the new versions are installed:
258+
259+
```shell
260+
docker build -t local_agent --target generic --platform=linux/amd64 .
261+
```
262+
263+
### 3. Verifying Library Versions in the Image
264+
To verify that the correct library version is installed in the built image, run:
265+
266+
```shell
267+
docker run --rm local_agent pip show teradatasql
268+
```
269+
Or, for system packages (e.g., libcap2):
270+
```shell
271+
docker run --rm local_agent dpkg -l | grep libcap2
272+
```
273+
274+
This will print the installed version, which you can check against the required secure version.
275+
276+
### 4. Running Tests in Docker
277+
You can also run the unit tests in Docker to ensure everything works as expected:
278+
```shell
279+
docker build -t test_agent --target tests --platform=linux/amd64 --build-arg CACHEBUST="`date`" --progress=plain .
280+
```
281+
282+
**Note:** Always review the security advisories and package documentation for any additional upgrade steps or breaking changes.

0 commit comments

Comments
 (0)