Skip to content

Commit 5659ca2

Browse files
author
Vitaly Korolev
committed
update scripts and readme to switch to using hardened image with 11.3 builds
1 parent ecc665a commit 5659ca2

11 files changed

+73
-406
lines changed

Jenkinsfile

+13-15
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ void copyRPMs() {
157157
RPMsuffix = ".nightly-rhel"
158158
}
159159
RPMbranch = "b11"
160-
RPMversion = "11.4"
160+
RPMversion = "11.3"
161161
}
162162
else if (marklogicVersion == "12") {
163163
//if dockerImageType contains "ubi9" then use nightly-rhel9 suffix
@@ -338,27 +338,25 @@ pipeline {
338338
skipStagesAfterUnstable()
339339
}
340340
triggers {
341-
parameterizedCron( env.BRANCH_NAME == 'develop' ? '''00 02 * * * % marklogicVersion=11;dockerImageType=ubi
342-
00 02 * * * % marklogicVersion=11;dockerImageType=ubi-rootless
343-
00 02 * * * % marklogicVersion=11;dockerImageType=ubi-rootless-hardened;SCAP_SCAN=true
344-
30 02 * * * % marklogicVersion=10;dockerImageType=ubi
345-
30 02 * * * % marklogicVersion=10;dockerImageType=ubi-rootless
346-
30 02 * * * % marklogicVersion=10;dockerImageType=ubi-rootless-hardened;SCAP_SCAN=true
347-
00 03 * * * % marklogicVersion=12;dockerImageType=ubi
348-
00 03 * * * % marklogicVersion=12;dockerImageType=ubi-rootless
349-
00 03 * * * % marklogicVersion=12;dockerImageType=ubi-rootless-hardened;SCAP_SCAN=true
350-
30 03 * * * % marklogicVersion=11;dockerImageType=ubi9
351-
30 03 * * * % marklogicVersion=11;dockerImageType=ubi9-rootless
352-
30 03 * * * % marklogicVersion=11;dockerImageType=ubi9-rootless-hardened;SCAP_SCAN=true''' : '')
341+
parameterizedCron( env.BRANCH_NAME == 'develop' ? '''00 02 * * * % marklogicVersion=10;dockerImageType=ubi
342+
00 02 * * * % marklogicVersion=10;dockerImageType=ubi-rootless;SCAP_SCAN=true
343+
00 02 * * * % marklogicVersion=11;dockerImageType=ubi
344+
30 02 * * * % marklogicVersion=11;dockerImageType=ubi-rootless;SCAP_SCAN=true
345+
30 02 * * * % marklogicVersion=12;dockerImageType=ubi
346+
30 02 * * * % marklogicVersion=12;dockerImageType=ubi-rootless;SCAP_SCAN=true
347+
00 03 * * * % marklogicVersion=11;dockerImageType=ubi9
348+
00 03 * * * % marklogicVersion=11;dockerImageType=ubi9-rootless;SCAP_SCAN=true
349+
00 03 * * * % marklogicVersion=12;dockerImageType=ubi9
350+
00 03 * * * % marklogicVersion=12;dockerImageType=ubi9-rootless;SCAP_SCAN=true''' : '')
353351
}
354352
environment {
355353
QA_LICENSE_KEY = credentials('QA_LICENSE_KEY')
356354
}
357355

358356
parameters {
359357
string(name: 'emailList', defaultValue: emailList, description: 'List of email for build notification', trim: true)
360-
string(name: 'dockerVersion', defaultValue: '2.0.1', description: 'ML Docker version. This version along with ML rpm package version will be the image tag as {ML_Version}_{dockerVersion}', trim: true)
361-
choice(name: 'dockerImageType', choices: 'ubi-rootless\nubi\nubi-rootless-hardened\nubi9-rootless\nubi9\nubi9-rootless-hardened\ncentos', description: 'Platform type for Docker image. Will be made part of the docker image tag')
358+
string(name: 'dockerVersion', defaultValue: '2.1.0', description: 'ML Docker version. This version along with ML rpm package version will be the image tag as {ML_Version}_{dockerVersion}', trim: true)
359+
choice(name: 'dockerImageType', choices: 'ubi-rootless\nubi\nubi9-rootless\nubi9', description: 'Platform type for Docker image. Will be made part of the docker image tag')
362360
string(name: 'upgradeDockerImage', defaultValue: '', description: 'Docker image for testing upgrades. Defaults to ubi image if left blank.\n Currently upgrading to ubi-rotless is not supported hence the test is skipped when ubi-rootless image is provided.', trim: true)
363361
choice(name: 'marklogicVersion', choices: '11\n12\n10', description: 'MarkLogic Server Branch. used to pick appropriate rpm')
364362
string(name: 'ML_RPM', defaultValue: '', description: 'URL for RPM to be used for Image creation. \n If left blank nightly ML rpm will be used.\n Please provide Jenkins accessible path e.g. /project/engineering or /project/qa', trim: true)

Makefile

+5-14
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,17 @@ build:
1717
cp NOTICE.txt src/NOTICE.txt
1818

1919
# rootless images use the same dependencies as ubi image so we copy the file
20-
ifeq ($(docker_image_type),ubi-rootless)
21-
cp dockerFiles/marklogic-deps-ubi\:base dockerFiles/marklogic-deps-ubi-rootless\:base
22-
endif
23-
ifeq ($(docker_image_type),ubi-rootless-hardened)
24-
cp dockerFiles/marklogic-deps-ubi\:base dockerFiles/marklogic-deps-ubi-rootless-hardened\:base
25-
endif
2620
ifeq ($(docker_image_type),ubi9)
2721
cp dockerFiles/marklogic-server-ubi\:base dockerFiles/marklogic-server-ubi9\:base
2822
endif
29-
ifeq ($(docker_image_type),ubi9-rootless)
23+
ifeq ($(findstring rootless,$(docker_image_type)),rootless)
24+
cp dockerFiles/marklogic-deps-ubi\:base dockerFiles/marklogic-deps-ubi-rootless\:base
3025
cp dockerFiles/marklogic-deps-ubi9\:base dockerFiles/marklogic-deps-ubi9-rootless\:base
3126
cp dockerFiles/marklogic-server-ubi-rootless\:base dockerFiles/marklogic-server-ubi9-rootless\:base
3227
endif
33-
ifeq ($(docker_image_type),ubi9-rootless-hardened)
34-
cp dockerFiles/marklogic-deps-ubi9\:base dockerFiles/marklogic-deps-ubi9-rootless-hardened\:base
35-
cp dockerFiles/marklogic-server-ubi-rootless-hardened\:base dockerFiles/marklogic-server-ubi9-rootless-hardened\:base
36-
endif
3728

3829
# retrieve and copy open scap hardening script
39-
ifeq ($(findstring hardened,$(docker_image_type)),hardened)
30+
ifeq ($(findstring rootless,$(docker_image_type)),rootless)
4031
[ -f scap-security-guide-${open_scap_version}.zip ] || curl -Lo scap-security-guide-${open_scap_version}.zip https://github.com/ComplianceAsCode/content/releases/download/v${open_scap_version}/scap-security-guide-${open_scap_version}.zip
4132
#UBI9 needs a different version of the remediation script
4233
ifeq ($(findstring ubi9,$(docker_image_type)),ubi9)
@@ -49,10 +40,10 @@ endif
4940

5041
# build the image
5142
cd src/; docker build ${docker_build_options} -t "${repo_dir}/marklogic-deps-${docker_image_type}:${dockerTag}" -f ../dockerFiles/marklogic-deps-${docker_image_type}:base .
52-
cd src/; docker build ${docker_build_options} -t "${repo_dir}/marklogic-server-${docker_image_type}:${dockerTag}" --build-arg BASE_IMAGE=${repo_dir}/marklogic-deps-${docker_image_type}:${dockerTag} --build-arg ML_RPM=${package} --build-arg ML_USER=marklogic_user --build-arg ML_DOCKER_VERSION=${dockerVersion} --build-arg ML_VERSION=${marklogicVersion} --build-arg ML_CONVERTERS=${converters} --build-arg BUILD_BRANCH=${build_branch} -f ../dockerFiles/marklogic-server-${docker_image_type}:base .
43+
cd src/; docker build ${docker_build_options} -t "${repo_dir}/marklogic-server-${docker_image_type}:${dockerTag}" --build-arg BASE_IMAGE=${repo_dir}/marklogic-deps-${docker_image_type}:${dockerTag} --build-arg ML_RPM=${package} --build-arg ML_USER=marklogic_user --build-arg ML_DOCKER_VERSION=${dockerVersion} --build-arg ML_VERSION=${marklogicVersion} --build-arg ML_CONVERTERS=${converters} --build-arg BUILD_BRANCH=${build_branch} --build-arg ML_DOCKER_TYPE=${docker_image_type} -f ../dockerFiles/marklogic-server-${docker_image_type}:base .
5344

5445
# remove temporary files
55-
rm -f dockerFiles/marklogic-deps-ubi-rootless\:base dockerFiles/marklogic-deps-ubi-rootless-hardened\:base dockerFiles/marklogic-deps-ubi9-rootless\:base dockerFiles/marklogic-deps-ubi9-rootless-hardened\:base dockerFiles/marklogic-server-ubi9-rootless-hardened\:base src/NOTICE.txt src/rhel-script-cis.sh
46+
rm -f dockerFiles/marklogic-deps-ubi-rootless\:base dockerFiles/marklogic-deps-ubi9-rootless\:base dockerFiles/marklogic-server-ubi9-rootless\:base dockerFiles/marklogic-server-ubi9\:base src/NOTICE.txt src/rhel-script-cis.sh
5647

5748
#***************************************************************************
5849
# strcture test docker images

README.md

+9-20
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Docker images are maintained by MarkLogic. Send feedback to the MarkLogic Docker
4646

4747
Supported Docker architectures: x86_64
4848

49-
Base OS: UBI, UBI-rootless and CentOS
49+
Base OS: UBI and UBI9 with rootless variants.
5050

5151
Published image artifact details: https://github.com/marklogic/marklogic-docker, https://hub.docker.com/r/progressofficial/marklogic-db
5252

@@ -205,8 +205,6 @@ The following environment variables are only useful when building and extending
205205
| MARKLOGIC_PID_FILE | /var/run/MarkLogic.pid | no| n/a | The process ID file |
206206
| MARKLOGIC_UMASK | 022 | no | n/a | The permissions granted to MarkLogic through umask |
207207

208-
**IMPORTANT:** The use of [Docker secrets](https://docs.docker.com/engine/swarm/secrets/) is supported in the MarkLogic Docker image progressofficial/marklogic-db:10.0-7.3-centos-1.0.0-ea onwards and will not work with older versions of the Docker EA image. The Docker compose examples that follow use secrets. If you want to use these examples with an older version of the image, you need to update the examples to use environment variables instead of secrets.
209-
210208
## Configuring swap space
211209

212210
MarkLogic recommends that swap space be configured for production deployments to reduce the possibility of ‘out of memory’ errors. For more details, see [MarkLogic recommendations for swap space](https://help.marklogic.com/knowledgebase/article/View/21/19/swap-space-requirements) and [configuring "swappiness"](https://help.marklogic.com/Knowledgebase/Article/View/linux-swappiness).
@@ -986,9 +984,10 @@ The `marklogic` image tags allow the user to pin their applications to images fo
986984

987985
This tag points to the exact version of MarkLogic Server and the base OS. This allows an application to pin to a very specific version of the image and base OS (platform).
988986

989-
Platform can be `centos`, `ubi` (RedHat Universal Base Image) or `ubi-rootless` (RedHat Universal Base Image for rootless containers). When `latest` tag is used, the platform will default to `ubi-rootless`.
987+
Platform can be `ubi`/`ubi9` (RedHat Universal Base Image) or `ubi-rootless`/`ubi9-rootless` (RedHat Universal Base Image for rootless containers). When `latest` tag is used, the platform will default to `ubi-rootless`.
988+
990989

991-
e.g. `11.2.0-centos` is the MarkLogic Server 11.2.0 release and CentOS base OS.
990+
e.g. `11.2.0-ubi9` is the MarkLogic Server 11.2.0 release and UBI9 base OS.
992991

993992
## `latest-xx.x`
994993

@@ -1045,24 +1044,14 @@ Where is calculated as described in the [Configuring HugePages](https://github.c
10451044

10461045
# Known Issues and Limitations
10471046

1048-
## CentOS base docker image
1049-
1050-
1. The image must be run in privileged mode. At the moment if the image isn't run as privileged many calls that use `sudo` during the supporting script will fail due to lack of required permissions as the image will not be able to create a user with the required permissions.
1051-
2. Using the "leave" button in the Admin interface to remove a node from a cluster may not succeed, depending on your network configuration. Use the Management API to remove a node from a cluster. See: [https://docs.marklogic.com/REST/DELETE/admin/v1/host-config](https://docs.marklogic.com/REST/DELETE/admin/v1/host-config).
1052-
3. Rejoining a node to a cluster, that had previously left that cluster, may not succeed.
1053-
4. MarkLogic Server will default to the UTC timezone.
1054-
5. The latest released version of CentOS 7 has known security vulnerabilities with respect to glib2 (CVE-2015-8387, CVE-2015-8390, CVE-2015-8394), glibc (CVE-2019-1010022), pcre (CVE-2015-8380, CVE-2015-8387, CVE-2015-8390, CVE-2015-8393, CVE-2015-8394), SQLite (CVE-2019-5827), nss (CVE-2014-3566), and bind-license (CVE-2023-6516, CVE-2023-5679, CVE-2023-5517, CVE-2023-50868, CVE-2023-50387, CVE-2023-4408). These libraries are included in the CentOS base image but, to-date, no fixes have been made available. Even though these libraries may be present in the base image that is used by MarkLogic Server, they are not used by MarkLogic Server itself, hence there is no impact or mitigation required.
1055-
10561047
## RedHat UBI base docker image
10571048

10581049
1. The image must be run in privileged mode. If the image isn't run as privileged, the calls that use `sudo` in the startup script will fail due to lack of required permissions as the image will not be able to create a user with the required permissions. To run in non-privileged mode, use one of the “rootless” image options.
10591050
2. Using the "leave" button in the Admin interface to remove a node from a cluster may not succeed, depending on your network configuration. Use the Management API to remove a node from a cluster. See: [https://docs.marklogic.com/REST/DELETE/admin/v1/host-config](https://docs.marklogic.com/REST/DELETE/admin/v1/host-config).
10601051
3. Rejoining a node to a cluster, that had previously left that cluster, may not succeed.
10611052
4. MarkLogic Server will default to the UTC timezone.
1062-
5. The latest released version of RedHat UBI 8 has known security vulnerabilities :
1063-
- glibc (CVE-2019-1010022) for which RedHat does not consider to be a vulnerability.
1064-
- kernel-headers (CVE-2023-6546).
1065-
- pip (GHSA-gpvv-69j7-gwj8) and setuptools (GHSA-r9hx-vwmv-q579).
1066-
- less (CVE-2024-32487).
1067-
1068-
These libraries are included in the RedHat UBI 8 base image but, to-date, no fixes have been made available. Even though these libraries may be present in the base image that is used by MarkLogic Server, they are not used by MarkLogic Server itself, hence there is no impact or mitigation required.
1053+
5. The latest released version of RedHat UBI images have known security vulnerabilities.
1054+
- UBI8: CVE-2024-6602, CVE-2024-34397, CVE-2024-2236, CVE-2023-7207, CVE-2023-51764, CVE-2023-37920, CVE-2023-32636, CVE-2023-29499, CVE-2023-2650, CVE-2022-4899, CVE-2021-42694, CVE-2021-3997, CVE-2020-35512, CVE-2020-15945, CVE-2019-9937, CVE-2019-9936, CVE-2019-9705, CVE-2019-19244, CVE-2019-17543, CVE-2019-12904, CVE-2019-12900, CVE-2018-20839
1055+
- UBI9: CVE-2024-6602, CVE-2024-6119, CVE-2024-26462, CVE-2024-2236, CVE-2023-7207, CVE-2023-37920, CVE-2023-2953, CVE-2022-4899, CVE-2021-3997
1056+
These libraries are included in the RedHat UBI base images but, to-date, no fixes have been made available. Even though these libraries may be present in the base image that is used by MarkLogic Server, they are not used by MarkLogic Server itself, hence there is no impact or mitigation required.
1057+
6. As part of the hardening process, the following packages are removed from the image: `vim-minimal`, `cups-client`, `cups-libs`, `tar`, `python3-pip-wheel`, `platform-python`, `python3-libs`, `platform-python-setuptools`, `avahi-libs`, `binutils`, `expat`, `libarchive`, `python3`, `python3-libs`, `python-unversioned-command`. These packages are not required for the operation of MarkLogic Server and are removed to reduce the attack surface of the image. If you require any of these packages, you can install them in your own Dockerfile.

dockerFiles/marklogic-deps-centos:base

-17
This file was deleted.

0 commit comments

Comments
 (0)