Skip to content

testing workflow changes #5849

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 46 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
c93be6d
Use IHttpMessageHandlerFactory For HTTP Communication
tangowithfoxtrot Apr 23, 2025
3e48c63
feat: allow custom app-id.json location for rootless
tangowithfoxtrot Apr 23, 2025
5d7025d
fix: new build context wont allow copying git context
tangowithfoxtrot Apr 23, 2025
5bd7d2f
feat: allow images to run as non-root user
tangowithfoxtrot Apr 23, 2025
761e794
Merge branch 'main' into feat/pm-14496-non-root-self-hosted-images
tangowithfoxtrot Apr 30, 2025
3e46394
fix: build failures caused by bad merge
tangowithfoxtrot Apr 30, 2025
32c2f62
build: we don't need to copy the `.git` dir
tangowithfoxtrot Apr 30, 2025
7a99f5d
Revert "build: we don't need to copy the `.git` dir"
tangowithfoxtrot Apr 30, 2025
284501a
Use `IHttpClientFactory` in more places
justindbaur May 1, 2025
192b058
update build workflow
tangowithfoxtrot May 1, 2025
948a799
fix: compatibility with the existin run.sh script
tangowithfoxtrot May 2, 2025
b30edc5
fix: compatibility with existing run.sh script
tangowithfoxtrot May 2, 2025
4bbf003
Merge branch 'main' into feat/pm-14496-non-root-self-hosted-images
tangowithfoxtrot May 2, 2025
69082ba
Add SelfHosted GlobalSettings for Setup
justindbaur May 2, 2025
49ad409
Fix my build error
justindbaur May 2, 2025
acae594
Add other services
justindbaur May 3, 2025
2ec4315
Add IConfiguration
justindbaur May 5, 2025
0ad1f2f
fix: missing gosu command for rootful mode
tangowithfoxtrot May 5, 2025
b6322dd
fix: try using .net core certificate handling
tangowithfoxtrot May 6, 2025
30e38a7
Merge branch 'main' into feat/pm-14496-non-root-self-hosted-images
tangowithfoxtrot May 6, 2025
05e58cb
fix: add `SSL_CERT_DIR` to remaining images
tangowithfoxtrot May 6, 2025
b1efa88
Remove X509ChainCustomization activation code
justindbaur May 6, 2025
5909f6e
Revert "Use IHttpMessageHandlerFactory For HTTP Communication"
justindbaur May 7, 2025
4fe99ab
Revert "fix: build failures caused by bad merge"
justindbaur May 7, 2025
5fedad9
Revert "Use `IHttpClientFactory` in more places"
justindbaur May 7, 2025
e2da4cc
remove unused code
tangowithfoxtrot May 7, 2025
50e2db7
re-add error log for installation id
tangowithfoxtrot May 7, 2025
136f32e
remove missing error message in log
tangowithfoxtrot May 7, 2025
a246d54
build: remove duplicate docker+qemu setup steps
tangowithfoxtrot May 13, 2025
30369d9
build: optimize for simpler builds over caching
tangowithfoxtrot May 19, 2025
9d4a96b
build: restore previous method for getting the GIT_HASH
tangowithfoxtrot May 19, 2025
50df44b
fix: add missing build args to remaining images
tangowithfoxtrot May 19, 2025
54f3d6b
fix: rm extraneous source revision id arg
tangowithfoxtrot May 19, 2025
8e399b8
fmt: apply consistent spacing and rm redundant WORKDIR directive
tangowithfoxtrot May 19, 2025
6d9739f
build: update migrator to use simpler build; apply consistent spacing
tangowithfoxtrot May 19, 2025
88159d1
Merge branch 'main' into test-container-workflow-changes
tangowithfoxtrot May 21, 2025
fbfd8bf
fix: docker build context
tangowithfoxtrot May 21, 2025
d62a599
build: simplify workflow changes
tangowithfoxtrot May 21, 2025
b304e5f
fix: only build when dotnet is true
tangowithfoxtrot May 21, 2025
6eb6cb9
build: only upload artifects when dotnet is true
tangowithfoxtrot May 21, 2025
6dd615e
chore: rename build-docker to build-artifacts
tangowithfoxtrot May 21, 2025
a13c680
Update build.yml
tangowithfoxtrot May 21, 2025
c1a143e
Merge branch 'main' into test-container-workflow-changes
tangowithfoxtrot May 21, 2025
3f7b695
add 'check branch' back
tangowithfoxtrot May 21, 2025
11aa37d
Update build.yml
tangowithfoxtrot May 21, 2025
26e1882
Update build.yml
tangowithfoxtrot May 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
157 changes: 57 additions & 100 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,46 +33,62 @@ jobs:
run: dotnet format --verify-no-changes

build-artifacts:
name: Build artifacts
name: Build Docker images
runs-on: ubuntu-22.04
needs:
- lint
outputs:
has_secrets: ${{ steps.check-secrets.outputs.has_secrets }}
permissions:
security-events: write
id-token: write
strategy:
fail-fast: false
matrix:
include:
- project_name: Admin
base_path: ./src
dotnet: true
node: true
- project_name: Api
base_path: ./src
dotnet: true
- project_name: Attachments
base_path: ./util
- project_name: Billing
base_path: ./src
dotnet: true
- project_name: Events
base_path: ./src
dotnet: true
- project_name: EventsProcessor
base_path: ./src
dotnet: true
- project_name: Icons
base_path: ./src
dotnet: true
- project_name: Identity
base_path: ./src
dotnet: true
- project_name: MsSql
base_path: ./util
- project_name: MsSqlMigratorUtility
base_path: ./util
dotnet: true
- project_name: Nginx
base_path: ./util
- project_name: Notifications
base_path: ./src
dotnet: true
- project_name: Scim
base_path: ./bitwarden_license/src
dotnet: true
- project_name: Server
base_path: ./util
- project_name: Setup
base_path: ./util
dotnet: true
- project_name: Sso
base_path: ./bitwarden_license/src
node: true
dotnet: true
steps:
- name: Check secrets
id: check-secrets
Expand All @@ -87,6 +103,19 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Check branch to publish
env:
PUBLISH_BRANCHES: "main,rc,hotfix-rc"
id: publish-branch-check
run: |
IFS="," read -a publish_branches <<< $PUBLISH_BRANCHES

if [[ " ${publish_branches[*]} " =~ " ${GITHUB_REF:11} " ]]; then
echo "is_publish_branch=true" >> $GITHUB_ENV
else
echo "is_publish_branch=false" >> $GITHUB_ENV
fi

- name: Set up .NET
uses: actions/setup-dotnet@87b7050bc53ea08284295505d98d2aa94301e852 # v4.2.0

Expand Down Expand Up @@ -115,6 +144,7 @@ jobs:

- name: Publish project
working-directory: ${{ matrix.base_path }}/${{ matrix.project_name }}
if: ${{ matrix.dotnet }}
run: |
echo "Publish"
dotnet publish -c "Release" -o obj/build-output/publish
Expand All @@ -128,87 +158,18 @@ jobs:

- name: Upload project artifact
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
if: ${{ matrix.dotnet }}
with:
name: ${{ matrix.project_name }}.zip
path: ${{ matrix.base_path }}/${{ matrix.project_name }}/${{ matrix.project_name }}.zip
if-no-files-found: error

build-docker:
name: Build Docker images
runs-on: ubuntu-22.04
permissions:
security-events: write
id-token: write
needs:
- build-artifacts
if: ${{ needs.build-artifacts.outputs.has_secrets == 'true' }}
strategy:
fail-fast: false
matrix:
include:
- project_name: Admin
base_path: ./src
dotnet: true
- project_name: Api
base_path: ./src
dotnet: true
- project_name: Attachments
base_path: ./util
- project_name: Billing
base_path: ./src
dotnet: true
- project_name: Events
base_path: ./src
dotnet: true
- project_name: EventsProcessor
base_path: ./src
dotnet: true
- project_name: Icons
base_path: ./src
dotnet: true
- project_name: Identity
base_path: ./src
dotnet: true
- project_name: MsSql
base_path: ./util
- project_name: MsSqlMigratorUtility
base_path: ./util
dotnet: true
- project_name: Nginx
base_path: ./util
- project_name: Notifications
base_path: ./src
dotnet: true
- project_name: Scim
base_path: ./bitwarden_license/src
dotnet: true
- project_name: Server
base_path: ./util
dotnet: true
- project_name: Setup
base_path: ./util
dotnet: true
- project_name: Sso
base_path: ./bitwarden_license/src
dotnet: true
steps:
- name: Check out repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
ref: ${{ github.event.pull_request.head.sha }}
########## Set up Docker ##########
- name: Set up QEMU emulators
uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0

- name: Check branch to publish
env:
PUBLISH_BRANCHES: "main,rc,hotfix-rc"
id: publish-branch-check
run: |
IFS="," read -a publish_branches <<< $PUBLISH_BRANCHES

if [[ " ${publish_branches[*]} " =~ " ${GITHUB_REF:11} " ]]; then
echo "is_publish_branch=true" >> $GITHUB_ENV
else
echo "is_publish_branch=false" >> $GITHUB_ENV
fi
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0

########## ACRs ##########
- name: Log in to Azure - production subscription
Expand Down Expand Up @@ -277,26 +238,24 @@ jobs:
fi
echo "tags=$TAGS" >> $GITHUB_OUTPUT

- name: Get build artifact
if: ${{ matrix.dotnet }}
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: ${{ matrix.project_name }}.zip

- name: Set up build artifact
if: ${{ matrix.dotnet }}
run: |
mkdir -p ${{ matrix.base_path}}/${{ matrix.project_name }}/obj/build-output/publish
unzip ${{ matrix.project_name }}.zip \
-d ${{ matrix.base_path }}/${{ matrix.project_name }}/obj/build-output/publish
- name: Generate image full name
id: cache-name
env:
PROJECT_NAME: ${{ steps.setup.outputs.project_name }}
run: echo "name=${_AZ_REGISTRY}/${PROJECT_NAME}:buildcache" >> $GITHUB_OUTPUT

- name: Build Docker image
id: build-docker
id: build-artifacts
uses: docker/build-push-action@67a2d409c0a876cbe6b11854e3e25193efe4e62d # v6.12.0
with:
context: ${{ matrix.base_path }}/${{ matrix.project_name }}
cache-from: type=registry,ref=${{ steps.cache-name.outputs.name }}
cache-to: type=registry,ref=${{ steps.cache-name.outputs.name}},mode=max
context: .
file: ${{ matrix.base_path }}/${{ matrix.project_name }}/Dockerfile
platforms: linux/amd64
platforms: |
linux/amd64,
linux/arm/v7,
linux/arm64
push: true
tags: ${{ steps.image-tags.outputs.tags }}
secrets: |
Expand All @@ -309,7 +268,7 @@ jobs:
- name: Sign image with Cosign
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
env:
DIGEST: ${{ steps.build-docker.outputs.digest }}
DIGEST: ${{ steps.build-artifacts.outputs.digest }}
TAGS: ${{ steps.image-tags.outputs.tags }}
run: |
IFS="," read -a tags <<< "${TAGS}"
Expand Down Expand Up @@ -337,7 +296,7 @@ jobs:
upload:
name: Upload
runs-on: ubuntu-22.04
needs: build-docker
needs: build-artifacts
steps:
- name: Check out repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
Expand Down Expand Up @@ -570,7 +529,7 @@ jobs:
&& (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix-rc')
runs-on: ubuntu-22.04
needs:
- build-docker
- build-artifacts
steps:
- name: Log in to Azure - CI subscription
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
Expand Down Expand Up @@ -604,7 +563,7 @@ jobs:
if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main'
runs-on: ubuntu-22.04
needs:
- build-docker
- build-artifacts
steps:
- name: Log in to Azure - CI subscription
uses: Azure/login@e15b166166a8746d1a47596803bd8c1b595455cf # v1.6.0
Expand Down Expand Up @@ -638,7 +597,6 @@ jobs:
name: Setup Ephemeral Environment
needs:
- build-artifacts
- build-docker
if: |
needs.build-artifacts.outputs.has_secrets == 'true'
&& github.event_name == 'pull_request'
Expand All @@ -656,7 +614,6 @@ jobs:
needs:
- lint
- build-artifacts
- build-docker
- upload
- build-mssqlmigratorutility
- self-host-build
Expand Down
3 changes: 1 addition & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,4 @@
</AssemblyAttribute>
</ItemGroup>
</Target>

</Project>
</Project>
4 changes: 0 additions & 4 deletions bitwarden_license/src/Scim/.dockerignore

This file was deleted.

51 changes: 47 additions & 4 deletions bitwarden_license/src/Scim/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,50 @@
###############################################

Check failure

Code scanning / Checkmarx One

(CVE-2024-2379) Critical

(CVE-2024-2379)

Check failure

Code scanning / Checkmarx One

(CVE-2024-2379) Critical

(CVE-2024-2379)

Check failure

Code scanning / Checkmarx One

(CVE-2011-4116) High

(CVE-2011-4116)

Check failure

Code scanning / Checkmarx One

(CVE-2011-4116) High

(CVE-2011-4116)

Check failure

Code scanning / Checkmarx One

(CVE-2011-4116) High

(CVE-2011-4116)

Check failure

Code scanning / Checkmarx One

(CVE-2011-4116) High

(CVE-2011-4116)

Check failure

Code scanning / Checkmarx One

(CVE-2011-4116) High

(CVE-2011-4116)

Check failure

Code scanning / Checkmarx One

(CVE-2015-3276) High

(CVE-2015-3276)

Check failure

Code scanning / Checkmarx One

(CVE-2015-3276) High

(CVE-2015-3276)

Check failure

Code scanning / Checkmarx One

(CVE-2017-17740) High

(CVE-2017-17740)

Check failure

Code scanning / Checkmarx One

(CVE-2017-17740) High

(CVE-2017-17740)

Check failure

Code scanning / Checkmarx One

(CVE-2018-20796) High

(CVE-2018-20796)

Check failure

Code scanning / Checkmarx One

(CVE-2018-20796) High

(CVE-2018-20796)

Check failure

Code scanning / Checkmarx One

(CVE-2018-20796) High

(CVE-2018-20796)

Check failure

Code scanning / Checkmarx One

(CVE-2018-20796) High

(CVE-2018-20796)

Check failure

Code scanning / Checkmarx One

(CVE-2018-5709) High

(CVE-2018-5709)

Check failure

Code scanning / Checkmarx One

(CVE-2018-5709) High

(CVE-2018-5709)

Check failure

Code scanning / Checkmarx One

(CVE-2018-6829) High

(CVE-2018-6829)

Check failure

Code scanning / Checkmarx One

(CVE-2018-6829) High

(CVE-2018-6829)

Check failure

Code scanning / Checkmarx One

(CVE-2019-9192) High

(CVE-2019-9192)

Check failure

Code scanning / Checkmarx One

(CVE-2019-9192) High

(CVE-2019-9192)

Check failure

Code scanning / Checkmarx One

(CVE-2019-9192) High

(CVE-2019-9192)

Check failure

Code scanning / Checkmarx One

(CVE-2019-9192) High

(CVE-2019-9192)

Check failure

Code scanning / Checkmarx One

(CVE-2022-24975) High

(CVE-2022-24975)

Check failure

Code scanning / Checkmarx One

(CVE-2022-24975) High

(CVE-2022-24975)

Check failure

Code scanning / Checkmarx One

(CVE-2023-2953) High

(CVE-2023-2953)

Check failure

Code scanning / Checkmarx One

(CVE-2023-2953) High

(CVE-2023-2953)

Check failure

Code scanning / Checkmarx One

(CVE-2023-31484) High

(CVE-2023-31484)

Check failure

Code scanning / Checkmarx One

(CVE-2023-31484) High

(CVE-2023-31484)

Check failure

Code scanning / Checkmarx One

(CVE-2023-31484) High

(CVE-2023-31484)

Check failure

Code scanning / Checkmarx One

(CVE-2023-31484) High

(CVE-2023-31484)

Check failure

Code scanning / Checkmarx One

(CVE-2023-31484) High

(CVE-2023-31484)

Check failure

Code scanning / Checkmarx One

(CVE-2023-31486) High

(CVE-2023-31486)

Check failure

Code scanning / Checkmarx One

(CVE-2023-31486) High

(CVE-2023-31486)

Check failure

Code scanning / Checkmarx One

(CVE-2023-31486) High

(CVE-2023-31486)

Check failure

Code scanning / Checkmarx One

(CVE-2023-31486) High

(CVE-2023-31486)

Check failure

Code scanning / Checkmarx One

(CVE-2023-31486) High

(CVE-2023-31486)

Check failure

Code scanning / Checkmarx One

(CVE-2023-45918) High

(CVE-2023-45918)

Check failure

Code scanning / Checkmarx One

(CVE-2023-45918) High

(CVE-2023-45918)

Check failure

Code scanning / Checkmarx One

(CVE-2023-45918) High

(CVE-2023-45918)

Check failure

Code scanning / Checkmarx One

(CVE-2023-45918) High

(CVE-2023-45918)

Check failure

Code scanning / Checkmarx One

(CVE-2023-52425) High

(CVE-2023-52425)

Check failure

Code scanning / Checkmarx One

(CVE-2023-52425) High

(CVE-2023-52425)

Check failure

Code scanning / Checkmarx One

(CVE-2024-10963) High

(CVE-2024-10963)

Check failure

Code scanning / Checkmarx One

(CVE-2024-10963) High

(CVE-2024-10963)

Check failure

Code scanning / Checkmarx One

(CVE-2024-10963) High

(CVE-2024-10963)

Check failure

Code scanning / Checkmarx One

(CVE-2024-10963) High

(CVE-2024-10963)

Check failure

Code scanning / Checkmarx One

(CVE-2024-26458) High

(CVE-2024-26458)

Check failure

Code scanning / Checkmarx One

(CVE-2024-26458) High

(CVE-2024-26458)

Check failure

Code scanning / Checkmarx One

(CVE-2024-26461) High

(CVE-2024-26461)

Check failure

Code scanning / Checkmarx One

(CVE-2024-26461) High

(CVE-2024-26461)

Check failure

Code scanning / Checkmarx One

(CVE-2024-52005) High

(CVE-2024-52005)

Check failure

Code scanning / Checkmarx One

(CVE-2024-52005) High

(CVE-2024-52005)

Check failure

Code scanning / Checkmarx One

(CVE-2025-0725) High

(CVE-2025-0725)

Check failure

Code scanning / Checkmarx One

(CVE-2025-0725) High

(CVE-2025-0725)

Check warning

Code scanning / Checkmarx One

(CVE-2007-5686) Medium

(CVE-2007-5686)

Check warning

Code scanning / Checkmarx One

(CVE-2007-5686) Medium

(CVE-2007-5686)

Check warning

Code scanning / Checkmarx One

(CVE-2007-5686) Medium

(CVE-2007-5686)

Check warning

Code scanning / Checkmarx One

(CVE-2007-5686) Medium

(CVE-2007-5686)

Check warning

Code scanning / Checkmarx One

(CVE-2007-5686) Medium

(CVE-2007-5686)

Check warning

Code scanning / Checkmarx One

(CVE-2007-5686) Medium

(CVE-2007-5686)

Check warning

Code scanning / Checkmarx One

(CVE-2010-4756) Medium

(CVE-2010-4756)

Check warning

Code scanning / Checkmarx One

(CVE-2010-4756) Medium

(CVE-2010-4756)

Check warning

Code scanning / Checkmarx One

(CVE-2010-4756) Medium

(CVE-2010-4756)

Check warning

Code scanning / Checkmarx One

(CVE-2010-4756) Medium

(CVE-2010-4756)

Check warning

Code scanning / Checkmarx One

(CVE-2011-3389) Medium

(CVE-2011-3389)

Check warning

Code scanning / Checkmarx One

(CVE-2011-3389) Medium

(CVE-2011-3389)

Check warning

Code scanning / Checkmarx One

(CVE-2011-3389) Medium

(CVE-2011-3389)

Check warning

Code scanning / Checkmarx One

(CVE-2011-3389) Medium

(CVE-2011-3389)

Check warning

Code scanning / Checkmarx One

(CVE-2016-2781) Medium

(CVE-2016-2781)

Check warning

Code scanning / Checkmarx One

(CVE-2016-2781) Medium

(CVE-2016-2781)

Check warning

Code scanning / Checkmarx One

(CVE-2017-14159) Medium

(CVE-2017-14159)

Check warning

Code scanning / Checkmarx One

(CVE-2017-14159) Medium

(CVE-2017-14159)

Check warning

Code scanning / Checkmarx One

(CVE-2017-18018) Medium

(CVE-2017-18018)

Check warning

Code scanning / Checkmarx One

(CVE-2017-18018) Medium

(CVE-2017-18018)

Check warning

Code scanning / Checkmarx One

(CVE-2018-1000021) Medium

(CVE-2018-1000021)

Check warning

Code scanning / Checkmarx One

(CVE-2018-1000021) Medium

(CVE-2018-1000021)

Check warning

Code scanning / Checkmarx One

(CVE-2019-1010023) Medium

(CVE-2019-1010023)

Check warning

Code scanning / Checkmarx One

(CVE-2019-1010023) Medium

(CVE-2019-1010023)

Check warning

Code scanning / Checkmarx One

(CVE-2019-1010023) Medium

(CVE-2019-1010023)

Check warning

Code scanning / Checkmarx One

(CVE-2019-1010023) Medium

(CVE-2019-1010023)

Check warning

Code scanning / Checkmarx One

(CVE-2019-1010024) Medium

(CVE-2019-1010024)

Check warning

Code scanning / Checkmarx One

(CVE-2019-1010024) Medium

(CVE-2019-1010024)

Check warning

Code scanning / Checkmarx One

(CVE-2019-1010024) Medium

(CVE-2019-1010024)

Check warning

Code scanning / Checkmarx One

(CVE-2019-1010024) Medium

(CVE-2019-1010024)

Check failure

Code scanning / Checkmarx One

(CVE-2024-8176) High

(CVE-2024-8176)

Check failure

Code scanning / Checkmarx One

(CVE-2024-28757) High

(CVE-2024-28757)

Check failure

Code scanning / Checkmarx One

(CVE-2024-28757) High

(CVE-2024-28757)

Check failure

Code scanning / Checkmarx One

(CVE-2023-45918) High

(CVE-2023-45918)

Check failure

Code scanning / Checkmarx One

(CVE-2023-45918) High

(CVE-2023-45918)

Check failure

Code scanning / Checkmarx One

(CVE-2018-20796) High

(CVE-2018-20796)

Check failure

Code scanning / Checkmarx One

(CVE-2018-20796) High

(CVE-2018-20796)

Check failure

Code scanning / Checkmarx One

(CVE-2018-5709) High

(CVE-2018-5709)

Check failure

Code scanning / Checkmarx One

(CVE-2019-9192) High

(CVE-2019-9192)

Check failure

Code scanning / Checkmarx One

(CVE-2019-9192) High

(CVE-2019-9192)

Check failure

Code scanning / Checkmarx One

(CVE-2024-26458) High

(CVE-2024-26458)

Check failure

Code scanning / Checkmarx One

(CVE-2024-26461) High

(CVE-2024-26461)

Check failure

Code scanning / Checkmarx One

(CVE-2024-8176) High

(CVE-2024-8176)

Check warning

Code scanning / Checkmarx One

(CVE-2010-4756) Medium

(CVE-2010-4756)

Check warning

Code scanning / Checkmarx One

(CVE-2010-4756) Medium

(CVE-2010-4756)
# Build stage #
###############################################
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS build

# Docker buildx supplies the value for this arg
ARG TARGETPLATFORM

# Determine proper runtime value for .NET
# We put the value in a file to be read by later layers.
RUN if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
RID=linux-x64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
RID=linux-arm64 ; \
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
RID=linux-arm ; \
fi \
&& echo "RID=$RID" > /tmp/rid.txt

# Copy required project files
WORKDIR /source
COPY . ./

# Restore project dependencies and tools
WORKDIR /source/bitwarden_license/src/Scim
RUN . /tmp/rid.txt && dotnet restore -r $RID

# Build project
RUN . /tmp/rid.txt && dotnet publish \
-c release \
--no-restore \
--self-contained \
/p:PublishSingleFile=true \
-r $RID \
-o out

###############################################
# App stage #
###############################################
FROM mcr.microsoft.com/dotnet/aspnet:8.0

ARG TARGETPLATFORM
LABEL com.bitwarden.product="bitwarden"
ENV ASPNETCORE_ENVIRONMENT=Production
ENV ASPNETCORE_URLS=http://+:5000
ENV SSL_CERT_DIR=/etc/bitwarden/ca-certificates
EXPOSE 5000

RUN apt-get update \
&& apt-get install -y --no-install-recommends \
Expand All @@ -9,11 +53,10 @@
krb5-user \
&& rm -rf /var/lib/apt/lists/*

ENV ASPNETCORE_URLS http://+:5000
# Copy app from the build stage
WORKDIR /app
EXPOSE 5000
COPY obj/build-output/publish .
COPY entrypoint.sh /
COPY --from=build /source/bitwarden_license/src/Scim/out /app
COPY ./bitwarden_license/src/Scim/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh

HEALTHCHECK CMD curl -f http://localhost:5000/alive || exit 1
Expand Down
Loading
Loading