Skip to content

Commit a245a9b

Browse files
committed
feat(account-service): fips
1 parent 6b871d8 commit a245a9b

5 files changed

Lines changed: 30 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ env:
2323
DOCKER_BUILD_ARCHES_JSON: '["arm64","amd64"]'
2424
DOCKER_BUILD_SERVICES_JSON: '["authorization-service","queue-worker-service","ddp-streamer-service","account-service","presence-service","omnichannel-transcript-service","rocketchat"]'
2525
DOCKER_BUILD_EXTRA_COVERAGE_JSON: '[{"arch":"amd64","service":"rocketchat","type":"coverage"},{"arch":"arm64","service":"rocketchat","type":"coverage"}]'
26-
DOCKER_BUILD_FIPS_SERVICES_JSON: '["authorization-service","queue-worker-service","ddp-streamer-service","presence-service"]'
26+
DOCKER_BUILD_FIPS_SERVICES_JSON: '["authorization-service","queue-worker-service","ddp-streamer-service","account-service","presence-service"]'
2727

2828
jobs:
2929
release-versions:

docker-compose-ci.fips.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
services:
2+
account-service:
3+
build:
4+
target: release-fips
5+
image: ghcr.io/${LOWERCASE_REPOSITORY}/account-service:${DOCKER_TAG}-fips
6+
27
authorization-service:
38
build:
49
target: release-fips

docker-compose-ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ services:
6969
build:
7070
dockerfile: ee/apps/account-service/Dockerfile
7171
context: .
72+
target: release-standard
7273
x-bake:
7374
platforms:
7475
- linux/amd64

ee/apps/account-service/Dockerfile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ WORKDIR /app/ee/apps/${SERVICE}
8888

8989
RUN yarn workspaces focus --production
9090

91-
FROM node:22.16.0-alpine3.21
91+
FROM node:22.16.0-alpine3.21 AS release-standard
9292

9393
ARG SERVICE
9494

@@ -114,3 +114,14 @@ USER rocketchat
114114
EXPOSE 3000 9458
115115

116116
CMD ["node", "src/service.js"]
117+
118+
# FIPS RELEASE STAGE
119+
FROM rocketchatfips140/dhi-node:22-fips AS release-fips
120+
ARG SERVICE
121+
ENV NODE_ENV=production \
122+
PORT=3000
123+
COPY --chown=node:node --from=builder /app /app
124+
WORKDIR /app/ee/apps/${SERVICE}
125+
USER node
126+
EXPOSE 3000 9458
127+
CMD ["node", "--require", "./src/fips.js", "src/service.js"]
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import crypto from 'crypto';
2+
3+
crypto.setFips(true);
4+
5+
if (!crypto.getFips()) {
6+
throw new Error('FIPS mode was not enabled after crypto.setFips(true)');
7+
}
8+
9+
console.log('=========================================');
10+
console.log('FIPS COMPLIANCE CHECK: YES');
11+
console.log('=========================================');

0 commit comments

Comments
 (0)