Skip to content

Commit 6a74dbf

Browse files
Merge pull request #228 from catenax-ng/TRACEFOSS-953_cypress-docker-config-improvements-KICS
TRACEFOSS-953 chr: cypress docker configuration improvements - KICS
2 parents 31578cb + f67c520 commit 6a74dbf

File tree

4 files changed

+33
-5
lines changed

4 files changed

+33
-5
lines changed

.github/workflows/kics.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
name: "KICS"
22

33
on:
4+
workflow_dispatch:
45
push:
56
branches: [main, master]
67
# pull_request:
@@ -29,6 +30,10 @@ jobs:
2930
with:
3031
# Scanning directory .
3132
path: "."
33+
# Excluded paths:
34+
# - docker-compose.yml - used only on local env
35+
# - in cypress dir docker related files used only on local env
36+
exclude_paths: "docker-compose.yml,cypress/docker-compose.yml,cypress/Dockerfile"
3237
# Fail on HIGH severity results
3338
fail_on: high
3439
# Disable secrets detection - we use GitGuardian

cypress/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# DISCLAIMER!
2+
# purpose of this file is to run cypress E2E tests locally, we don't use it in other env
3+
# because of statement above, we don't need to change settings to comply with some KICS requirements
4+
15

26
# if you need to change image please make sure use the same version in all places
37
# (here and in .github/workflows/e2e-tests.yml)
@@ -8,6 +12,7 @@
812
# but cypress/included:12.3.0 version base on cypress/browsers:node16.16.0-chrome107-ff107-edge
913
FROM cypress/included:12.3.0
1014

15+
USER root
1116
RUN mkdir /ng-app
1217
WORKDIR /ng-app
1318

@@ -18,4 +23,3 @@ COPY yarn.lock /ng-app/yarn.lock
1823
RUN yarn install
1924
# https://docs.cypress.io/guides/guides/launching-browsers#Linux-Dependencies
2025
RUN npx playwright install --with-deps webkit
21-

cypress/docker-compose.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,29 @@
1+
# DISCLAIMER!
2+
# purpose of this file is to run cypress E2E tests locally, we don't use it in other env
3+
# because of statement above, we don't need to change settings to comply with some KICS requirements
4+
15
version: "3.9"
26
services:
37
cypress:
48
build:
59
context: ../
610
dockerfile: cypress/Dockerfile
11+
712
volumes:
813
- ../:/ng-app/
914
- /ng-app/node_modules/ # we don't want to override it by host machine
15+
security_opt:
16+
- label:user:testuser
17+
- no-new-privileges:true
1018
network_mode: host # important to be able to connect to localhost url on host machine
11-
12-
13-
networks:
14-
TRACE_X_FE:
19+
# to comply with KICS requirement:
20+
# [MEDIUM] Memory Not Limited
21+
# Memory limits should be defined for each container. This prevents potential resource exhaustion by ensuring that containers consume not more than the designated amount of memory
22+
deploy:
23+
resources:
24+
limits:
25+
cpus: "4"
26+
memory: "1024M"
27+
reservations:
28+
cpus: "2"
29+
memory: "512M"

docker-compose.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# DISCLAIMER!
2+
# purpose of this file is to run services locally, we don't use it in other env
3+
# because of statement above, we don't need to change settings to comply with some KICS requirements
4+
15
version: "3.9"
26
services:
37
keycloak:

0 commit comments

Comments
 (0)