Skip to content

Commit 7a5a487

Browse files
authored
fix: fix security vulnerabilities; remove npm (#906)
## What ## Why ## Notes
1 parent 438fa9b commit 7a5a487

File tree

6 files changed

+639
-772
lines changed

6 files changed

+639
-772
lines changed

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,18 @@ RUN apk --update add --no-cache \
77
git \
88
jq
99
RUN npm upgrade -g npm
10-
COPY --from=mikefarah/yq:4.50.1 /usr/bin/yq /usr/local/bin/yq
11-
ADD --chmod=775 https://dl.k8s.io/release/v1.35.0/bin/${TARGETPLATFORM}/kubectl /usr/local/bin/kubectl
10+
COPY --from=mikefarah/yq:4.52.4 /usr/bin/yq /usr/local/bin/yq
11+
ADD --chmod=775 https://dl.k8s.io/release/v1.35.1/bin/${TARGETPLATFORM}/kubectl /usr/local/bin/kubectl
1212
WORKDIR /cf-cli
1313
COPY package.json yarn.lock check-version.js run-check-version.js /cf-cli/
1414
RUN yarn install --prod --frozen-lockfile && \
1515
yarn cache clean
1616
COPY . /cf-cli
1717
RUN yarn generate-completion
18+
19+
#purpose of security
20+
RUN npm -g uninstall npm
21+
1822
RUN ln -s $(pwd)/lib/interface/cli/codefresh /usr/local/bin/codefresh
1923
RUN codefresh components update --location components
2024

Dockerfile-debian

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,18 @@ RUN apt update \
1111
jq \
1212
&& ln -s /bin/busybox /usr/bin/[[
1313
RUN npm upgrade -g npm
14-
COPY --from=mikefarah/yq:4.50.1 /usr/bin/yq /usr/local/bin/yq
15-
ADD --chmod=775 https://dl.k8s.io/release/v1.35.0/bin/${TARGETPLATFORM}/kubectl /usr/local/bin/kubectl
14+
COPY --from=mikefarah/yq:4.52.4 /usr/bin/yq /usr/local/bin/yq
15+
ADD --chmod=775 https://dl.k8s.io/release/v1.35.1/bin/${TARGETPLATFORM}/kubectl /usr/local/bin/kubectl
1616
WORKDIR /cf-cli
1717
COPY package.json yarn.lock check-version.js run-check-version.js /cf-cli/
1818
RUN yarn install --prod --frozen-lockfile && \
1919
yarn cache clean
2020
COPY . /cf-cli
2121
RUN yarn generate-completion
22+
23+
#purpose of security
24+
RUN npm -g uninstall npm
25+
2226
RUN ln -s $(pwd)/lib/interface/cli/codefresh /usr/local/bin/codefresh
2327
RUN codefresh components update --location components
2428

Dockerfile-debian-rootless

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,18 @@ RUN apt update \
1010
jq \
1111
&& ln -s /bin/busybox /usr/bin/[[
1212
RUN npm upgrade -g npm
13-
COPY --from=mikefarah/yq:4.50.1 /usr/bin/yq /usr/local/bin/yq
14-
ADD --chmod=775 https://dl.k8s.io/release/v1.35.0/bin/${TARGETPLATFORM}/kubectl /usr/local/bin/kubectl
13+
COPY --from=mikefarah/yq:4.52.4 /usr/bin/yq /usr/local/bin/yq
14+
ADD --chmod=775 https://dl.k8s.io/release/v1.35.1/bin/${TARGETPLATFORM}/kubectl /usr/local/bin/kubectl
1515
WORKDIR /cf-cli
1616
COPY package.json yarn.lock check-version.js run-check-version.js /cf-cli/
1717
RUN yarn install --prod --frozen-lockfile && \
1818
yarn cache clean
1919
COPY . /cf-cli
2020
RUN yarn generate-completion
21+
22+
#purpose of security
23+
RUN npm -g uninstall npm
24+
2125
RUN ln -s $(pwd)/lib/interface/cli/codefresh /usr/local/bin/codefresh
2226
RUN codefresh components update --location components
2327
# we keep /root as home directory because cli by default looks for $HOME/.cfconfig

Dockerfile-rootless

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,18 @@ RUN apk --update add --no-cache \
66
curl \
77
git \
88
jq
9-
RUN npm upgrade -g npm
10-
COPY --from=mikefarah/yq:4.50.1 /usr/bin/yq /usr/local/bin/yq
11-
ADD --chmod=775 https://dl.k8s.io/release/v1.35.0/bin/${TARGETPLATFORM}/kubectl /usr/local/bin/kubectl
9+
COPY --from=mikefarah/yq:4.52.4 /usr/bin/yq /usr/local/bin/yq
10+
ADD --chmod=775 https://dl.k8s.io/release/v1.35.1/bin/${TARGETPLATFORM}/kubectl /usr/local/bin/kubectl
1211
WORKDIR /cf-cli
1312
COPY package.json yarn.lock check-version.js run-check-version.js /cf-cli/
1413
RUN yarn install --prod --frozen-lockfile && \
1514
yarn cache clean
1615
COPY . /cf-cli
1716
RUN yarn generate-completion
17+
18+
#purpose of security
19+
RUN npm -g uninstall npm
20+
1821
RUN ln -s $(pwd)/lib/interface/cli/codefresh /usr/local/bin/codefresh
1922
RUN codefresh components update --location components
2023
# we keep /root as home directory because cli by default looks for $HOME/.cfconfig

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "codefresh",
3-
"version": "1.0.5",
3+
"version": "1.0.6",
44
"description": "Codefresh command line utility",
55
"main": "index.js",
66
"preferGlobal": true,
@@ -45,12 +45,12 @@
4545
"tough-cookie": "^4.1.3",
4646
"openid-client": "^4.9.0",
4747
"**/request/form-data": "^2.5.5",
48-
"**/request/qs": "6.14.1"
48+
"**/request/qs": "6.14.2"
4949
},
5050
"dependencies": {
5151
"@codefresh-io/docker-reference": "^0.0.5",
5252
"adm-zip": "^0.5.5",
53-
"ajv": "^6.12.6",
53+
"ajv": "^6.14.0",
5454
"bluebird": "^3.5.1",
5555
"cf-errors": "^0.1.16",
5656
"chalk": "^4.1.0",

0 commit comments

Comments
 (0)