Skip to content

Commit

Permalink
Fixed libcurl vulnerability (#1285)
Browse files Browse the repository at this point in the history
* Fixed libcurl vulnerability

* updated test cases

* Update application.yml

* Updated test cases
  • Loading branch information
itsKedar authored Oct 17, 2023
1 parent 4121536 commit 811db07
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 20 deletions.
18 changes: 6 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,55 +1,49 @@
FROM alpine:3.18.2 AS java8
FROM alpine:3.18.4 AS java8

WORKDIR app
RUN apk update && \
apk upgrade && \
apk upgrade
RUN apk add openjdk8=8.372.07-r0 --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
ENV JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk
RUN apk --no-cache add curl
RUN apk add sudo
RUN apk add libstdc++
RUN apk add glib
RUN apk add krb5 pcre
RUN apk add bash
RUN curl -L "https://sca-downloads.s3.amazonaws.com/cli/latest/ScaResolver-musl64.tar.gz" -o "ScaResolver.tar.gz" && tar -vxzf ScaResolver.tar.gz && sudo mv ScaResolver Configuration.yml /app && rm ScaResolver.tar.gz
RUN wget "https://sca-downloads.s3.amazonaws.com/cli/latest/ScaResolver-musl64.tar.gz" -O "ScaResolver.tar.gz" && tar -xvzf ScaResolver.tar.gz && mv ScaResolver Configuration.yml /app && rm ScaResolver.tar.gz
COPY build/libs/*.jar cx-flow.jar
ENTRYPOINT ["java", "-Xms512m", "-Xmx2048m", "-Djava.security.egd=file:/dev/./urandom", "-Dspring.profiles.active=web", "-jar", "cx-flow.jar"]
EXPOSE 8080


FROM alpine:3.18.2 AS java11
FROM alpine:3.18.4 AS java11

WORKDIR app
RUN apk update && \
apk upgrade
RUN apk add openjdk11=11.0.20_p8-r2 --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk
RUN apk --no-cache add curl
RUN apk add sudo
RUN apk add libstdc++
RUN apk add glib
RUN apk add krb5 pcre
RUN apk add bash
RUN curl -L "https://sca-downloads.s3.amazonaws.com/cli/latest/ScaResolver-musl64.tar.gz" -o "ScaResolver.tar.gz" && tar -vxzf ScaResolver.tar.gz && sudo mv ScaResolver Configuration.yml /app && rm ScaResolver.tar.gz
RUN wget "https://sca-downloads.s3.amazonaws.com/cli/latest/ScaResolver-musl64.tar.gz" -O "ScaResolver.tar.gz" && tar -xvzf ScaResolver.tar.gz && mv ScaResolver Configuration.yml /app && rm ScaResolver.tar.gz
COPY build/libs/java11/*.jar cx-flow.jar
ENTRYPOINT ["java", "-Xms512m", "-Xmx2048m","-Djava.security.egd=file:/dev/./urandom", "-Dspring.profiles.active=web", "-jar", "cx-flow.jar"]
EXPOSE 8080

FROM alpine:3.18.2 AS cxgo8
FROM alpine:3.18.4 AS cxgo8

WORKDIR app
RUN apk update && \
apk upgrade
RUN apk add openjdk8=8.302.08-r2 --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
ENV JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk
RUN apk --no-cache add curl
RUN apk add sudo
RUN apk add libstdc++
RUN apk add glib
RUN apk add krb5 pcre
RUN apk add bash
RUN curl -L "https://sca-downloads.s3.amazonaws.com/cli/latest/ScaResolver-musl64.tar.gz" -o "ScaResolver.tar.gz" && tar -vxzf ScaResolver.tar.gz && sudo mv ScaResolver Configuration.yml /app && rm ScaResolver.tar.gz
RUN wget "https://sca-downloads.s3.amazonaws.com/cli/latest/ScaResolver-musl64.tar.gz" -O "ScaResolver.tar.gz" && tar -xvzf ScaResolver.tar.gz && mv ScaResolver Configuration.yml /app && rm ScaResolver.tar.gz
COPY build/libs/cxgo/*.jar cx-flow.jar
ENTRYPOINT ["java", "-Xms512m", "-Xmx2048m", "-Djava.security.egd=file:/dev/./urandom", "-Dspring.profiles.active=cxgo", "-jar", "cx-flow.jar"]
EXPOSE 8080
2 changes: 1 addition & 1 deletion build-11.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ buildscript {
ext {


CxSBSDK = "0.5.63"
CxSBSDK = "0.5.64"
ConfigProviderVersion = "1.0.9"
//cxVersion = "8.90.5"
springBootVersion = '2.7.14'
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
buildscript {
ext {

CxSBSDK = "0.5.63"
CxSBSDK = "0.5.64"
ConfigProviderVersion = "1.0.10"
//cxVersion = "8.90.5"
springBootVersion = '2.7.14'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,15 @@ public void assignPolicyToProject() throws IOException {
.breakBuild(true)
.build();

RuleCondition ruleCondition = RuleCondition.builder()
Conditions ruleCondition = Conditions.builder()
.operator("Equal")
.parameterValue(Collections.singletonList("High"))
.parameter("VulnerabilitySeverity")
.build();

ConditionGroups conditionGroups = ConditionGroups.builder()
.conditions(Collections.singletonList(ruleCondition))
.build();

PolicyRule policyRule = PolicyRule.builder()
.name("No High Severity Rule")
.conditionGroups(Collections.singletonList(conditionGroups))
.conditions(Collections.singletonList(ruleCondition))
.build();

Policy policy = Policy.builder()
Expand Down

0 comments on commit 811db07

Please sign in to comment.