Skip to content
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

Release 2.1.0 #319

Open
wants to merge 62 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
d51cc14
Update Jenkinsfile
vitalykorolev Jul 2, 2024
36871c7
Merge pull request #299 from vitalykorolev/MLE-14838_remove-centos-bu…
vitalykorolev Jul 2, 2024
8eff18f
Synchronize develop with master (#300)
vitalykorolev Jul 9, 2024
df52185
update ML version to 11.4
vitalykorolev Jul 9, 2024
e405662
Merge pull request #301 from vitalykorolev/MLE-15484_update-versions
vitalykorolev Jul 9, 2024
62b5eb7
update email list
vitalykorolev Jul 9, 2024
b05035b
Merge pull request #302 from vitalykorolev/MLE-15484_update-email-list
vitalykorolev Jul 9, 2024
6d17840
imrpve cleanup steps
Aug 21, 2024
6482af7
Merge pull request #303 from vitalykorolev/MLE-15754_better-cleanup
vitalykorolev Aug 21, 2024
06e8adb
update rpm version and improve download steps
vitalykorolev Aug 27, 2024
567c97f
Add docker file for hardened image
Aug 27, 2024
02bd903
suppress scan output
Aug 27, 2024
5a41784
update report publishing
Aug 28, 2024
2187d55
Merge pull request #305 from marklogic/MLE-16127_dependency-fix
vitalykorolev Aug 28, 2024
900c56f
move converters install passed remediation script
Aug 29, 2024
e18d114
add report links to email
Aug 29, 2024
876daea
add message for skipped reports and update mail list
Sep 2, 2024
b9787d7
Merge pull request #304 from vitalykorolev/MLE-14548_docker-hardening
vitalykorolev Sep 2, 2024
c65e009
add fixes for failing rules
Sep 13, 2024
9d52f2c
add resolution comments
Sep 13, 2024
0e7cd6e
add base dependency dockerfile for UBI9
Sep 16, 2024
734c069
handle UBI9 image type
Sep 16, 2024
7149402
update startup to handle systemd startup
Sep 16, 2024
8572a28
add ubi9 option to jenkinsfile
Sep 16, 2024
551274d
improve image scan output
Sep 16, 2024
c03e8c3
add end-of-scan string to vulnerability report for clarity
Sep 16, 2024
0b5f206
add ubi9 to scheduled builds
Sep 23, 2024
2abbafe
remove ml12 ubi9 builds as there are no regular builds
Sep 23, 2024
d321809
Merge pull request #307 from vitalykorolev/MLE-15790
vitalykorolev Sep 23, 2024
c20c16a
update libnsl
Sep 24, 2024
58ddc72
removed skipped rule
vitalykorolev Sep 25, 2024
27739f2
Merge pull request #308 from vitalykorolev/MLE-17082_fix-libnsl
vitalykorolev Sep 25, 2024
a659885
Merge branch 'develop' into MLE-16256_scap-fix and resolve conflict
Sep 25, 2024
70465d8
Update Makefile
vitalykorolev Sep 25, 2024
b104431
Merge pull request #306 from vitalykorolev/MLE-16256_scap-fix
vitalykorolev Sep 25, 2024
15380d2
add cleanup step to resolve repeated run issue on jenkins
vitalykorolev Sep 25, 2024
c8428a8
Merge pull request #309 from vitalykorolev/MLE-16256_cleanup-issue
vitalykorolev Sep 25, 2024
6070beb
remove scan filter and make the report prettier
Sep 30, 2024
fe59702
update scan folder permission for jenkins
Sep 30, 2024
ea4c27a
add report link to email
Sep 30, 2024
83831bf
Merge pull request #310 from vitalykorolev/MLE-17055_scan-filter
vitalykorolev Oct 1, 2024
23611f5
Update marklogic-deps-ubi:base
vitalykorolev Oct 1, 2024
254c5f5
Update marklogic-deps-ubi9:base
vitalykorolev Oct 1, 2024
1a131b1
add FIPS compliancy
rwinieski Oct 2, 2024
0a5b1be
Update marklogic-deps-ubi9:base
vitalykorolev Oct 2, 2024
b31eacf
Merge pull request #312 from vitalykorolev/MLE-17152_update-base-images
vitalykorolev Oct 2, 2024
ffb3242
set NOTICE permissions and verification
Oct 5, 2024
8c67e7c
Merge pull request #313 from marklogic/MLE-15553/FIPS-Compliance
rwinieski Oct 9, 2024
5a5bfaa
Merge pull request #314 from vitalykorolev/MLE-17200_fix-notices-perms
vitalykorolev Oct 9, 2024
7f90b85
- Remove optional packages that have known vulnerabilites
Oct 12, 2024
a175251
remove additional package for UBI9
Oct 15, 2024
ee0bbe9
scap fix
Oct 15, 2024
ecc665a
Merge pull request #315 from vitalykorolev/MLE-17162_enhancements
vitalykorolev Oct 15, 2024
5659ca2
update scripts and readme to switch to using hardened image with 11.3…
Oct 18, 2024
c07cb19
fix tests
Oct 18, 2024
808da9f
update ubi label for clarity
Oct 19, 2024
11d5423
Update notices file
Oct 21, 2024
5f07bce
Merge pull request #316 from vitalykorolev/MLE-16553_combined-hardene…
vitalykorolev Oct 23, 2024
8c183d8
Update README.md
vitalykorolev Oct 23, 2024
90de21d
Merge pull request #317 from marklogic/MLE-16553_fix-formatting
vitalykorolev Oct 23, 2024
80a6478
Update README.md
vitalykorolev Oct 25, 2024
12ddd9b
Merge pull request #318 from vitalykorolev/MLE-17518_add-cve
vitalykorolev Oct 25, 2024
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
140 changes: 105 additions & 35 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import groovy.json.JsonSlurperClassic

// email list for scheduled builds (includes security vulnerability)
emailList = '[email protected], [email protected], Fayez.Saliba@progress.com, Sumanth.Ravipati@progress.com, Peng.Zhou@progress.com'
emailList = '[email protected], [email protected], Sumanth.Ravipati@progress.com, Peng.Zhou@progress.com, romain.winieski@progress.com'
// email list for security vulnerabilities only
emailSecList = '[email protected], [email protected]'
gitCredID = 'marklogic-builder-github'
Expand Down Expand Up @@ -104,17 +104,43 @@ void resultNotification(message) {
} else {
emailList = params.emailList
}
jira_link = "https://progresssoftware.atlassian.net/browse/${JIRA_ID}"
email_body = "<b>Jenkins pipeline for</b> ${env.JOB_NAME} <br><b>Build Number: </b>${env.BUILD_NUMBER} <b><br><br>Lint Output: <br></b><pre><code>${LINT_OUTPUT}</code></pre><br><b>Vulnerabilities: </b><pre><code>${SCAN_OUTPUT}</code></pre> <br><b>Image Size: <br></b>${IMAGE_SIZE} <br><pre><code>docker pull ${dockerRegistry}/${latestTag}</code></pre><br><br><b>Build URL: </b><br><a href='${env.BUILD_URL}'>${env.BUILD_URL}</a>"
jira_email_body = "${email_body} <br><br><b>Jira URL: </b><br><a href='${jira_link}'>${jira_link}</a>"


email_body = "<b>Build URL: </b><a href='${env.BUILD_URL}'>${env.BUILD_URL}</a><br/>" +
"<b>Image type: </b>${env.dockerImageType}<br/><br/>" +
"<b>Lint Output: </b><br/>" +
"<pre><code>${LINT_OUTPUT}</code></pre><br/>" +
"<b>Vulnerabilities: </b><pre><code>${SCAN_OUTPUT}</code></pre><br/>" +
"<b><a href='${env.BUILD_URL}artifact/scan/report-${env.dockerImageType}.json'>Full scan report.</a></b><br/>" +
"<b>Image Size: <br/></b>${IMAGE_SIZE} <br/>" +
"<pre><code>docker pull ${dockerRegistry}/${latestTag}</code></pre><br/><br/>"
if (params.DOCKER_TESTS) {
email_body = "${email_body} <b><a href='${env.BUILD_URL}Docker_20Tests_20Report'>Docker Tests Report</a></b><br/>"
} else {
email_body = "${email_body} <b>Docker Tests Skipped</b><br/>"
}
if (params.SCAP_SCAN) {
email_body = "${email_body} <b><a href='${env.BUILD_URL}Open_20SCAP_20Report'>SCAP Scan Report</a></b><br/>"
if ( BRANCH_NAME == 'develop' ) {
emailList = emailList+','+emailSecList
}
} else {
email_body = "${email_body} <b>SCAP Scan Skipped</b><br/>"
}

// If Jira ID is available, add comment to the ticket and add link to email.
if (JIRA_ID) {
def jira_link = "https://progresssoftware.atlassian.net/browse/${JIRA_ID}"
def comment = [ body: "Jenkins pipeline build result: ${message}" ]
jiraAddComment site: 'JIRA', idOrKey: JIRA_ID, failOnError: false, input: comment
mail charset: 'UTF-8', mimeType: 'text/html', to: "${emailList}", body: "${jira_email_body}", subject: "${message}: ${env.JOB_NAME} #${env.BUILD_NUMBER} - ${JIRA_ID}"
} else {
mail charset: 'UTF-8', mimeType: 'text/html', to: "${emailList}", body: "${email_body}", subject: "${message}: ${env.JOB_NAME} #${env.BUILD_NUMBER}"
jiraAddComment site: 'JIRA',
input: comment,
idOrKey: JIRA_ID,
failOnError: false
email_body = "${email_body} <br/><br/><b>Jira URL: </b><br/><a href='${jira_link}'>${jira_link}</a>"
}
mail to: "${emailList}",
body: "${email_body}",
subject: "${message}: ${env.JOB_NAME} #${env.BUILD_NUMBER}",
charset: 'UTF-8', mimeType: 'text/html'
}

void copyRPMs() {
Expand All @@ -124,12 +150,22 @@ void copyRPMs() {
RPMversion = "10.0"
}
else if (marklogicVersion == "11") {
RPMsuffix = ".nightly-rhel"
//if dockerImageType contains "ubi9" then use nightly-rhel9 suffix
if (dockerImageType.contains("ubi9")) {
RPMsuffix = ".nightly-rhel9"
} else {
RPMsuffix = ".nightly-rhel"
}
RPMbranch = "b11"
RPMversion = "11.3"
}
else if (marklogicVersion == "12") {
RPMsuffix = ".nightly-rhel"
//if dockerImageType contains "ubi9" then use nightly-rhel9 suffix
if (dockerImageType.contains("ubi9")) {
RPMsuffix = ".nightly-rhel9"
} else {
RPMsuffix = ".nightly-rhel"
}
RPMbranch = "b12"
RPMversion = "12.0"
}
Expand Down Expand Up @@ -168,7 +204,7 @@ void buildDockerImage() {
}

void pullUpgradeDockerImage() {
if (dockerImageType == "ubi-rootless" ) {
if (dockerImageType == "ubi-rootless" && params.DOCKER_TESTS != "true") {
sh """
echo 'dockerImageType is set to ubi-rootless, skipping this stage and Docker upgrade test.'
"""
Expand Down Expand Up @@ -217,16 +253,14 @@ void lint() {

void vulnerabilityScan() {
sh """
make scan current_image=marklogic/marklogic-server-${dockerImageType}:${marklogicVersion}-${env.dockerImageType}-${env.dockerVersion} Jenkins=true
grep \'High\\|Critical\' scan-server-image.txt
make scan current_image=marklogic/marklogic-server-${dockerImageType}:${marklogicVersion}-${env.dockerImageType}-${env.dockerVersion} docker_image_type=${dockerImageType} Jenkins=true
"""

SCAN_OUTPUT = sh(returnStdout: true, script: 'grep \'High\\|Critical\' scan-server-image.txt')
SCAN_OUTPUT = sh(returnStdout: true, script: "cat scan/report-${env.dockerImageType}.txt")
sh 'echo "SCAN_OUTPUT: ${SCAN_OUTPUT}"'
if (SCAN_OUTPUT.size()) {
mail charset: 'UTF-8', mimeType: 'text/html', to: "${emailSecList}", body: "<br>Jenkins pipeline for ${env.JOB_NAME} <br>Build Number: ${env.BUILD_NUMBER} <br>Vulnerabilities: <pre><code>${SCAN_OUTPUT}</code></pre>", subject: "Critical or High Security Vulnerabilities Found: ${env.JOB_NAME} #${env.BUILD_NUMBER}"
mail charset: 'UTF-8', mimeType: 'text/html', to: "${emailSecList}", body: "<br/>Jenkins pipeline for ${env.JOB_NAME} <br/>Build Number: ${env.BUILD_NUMBER} <br/>Vulnerabilities: <pre><code>${SCAN_OUTPUT}</code></pre>", subject: "Critical or High Security Vulnerabilities Found: ${env.JOB_NAME} #${env.BUILD_NUMBER}"
}

sh '''rm -f scan-server-image.txt'''
archiveArtifacts artifacts: 'scan/*', onlyIfSuccessful: true
}

void publishToInternalRegistry() {
Expand Down Expand Up @@ -265,7 +299,31 @@ void publishToInternalRegistry() {

void publishTestResults() {
junit allowEmptyResults:true, testResults: '**/test_results/docker-tests.xml,**/container-structure-test.xml'
publishHTML allowMissing: true, alwaysLinkToLastBuild: true, keepAll: true, reportDir: 'test/test_results', reportFiles: 'report.html', reportName: 'Docker Tests Report', reportTitles: ''
if (params.DOCKER_TESTS) {
echo 'Publishing Docker results..'
publishHTML allowMissing: false,
alwaysLinkToLastBuild: true,
keepAll: true,
reportDir: 'test/test_results',
reportFiles: 'report.html',
reportName: 'Docker Tests Report',
reportTitles: "Build ${env.BUILD_NUMBER}"
}
if (params.SCAP_SCAN) {
echo 'Publishing SCAP scan results..'
publishHTML allowMissing: false,
alwaysLinkToLastBuild: true,
keepAll: true, reportDir: 'scap',
reportFiles: 'scap_scan_report.html',
reportName: 'Open SCAP Report',
reportTitles: "Build ${env.BUILD_NUMBER}"
}
}

void scapScan() {
sh """
make scap-scan current_image=marklogic/marklogic-server-${dockerImageType}:${marklogicVersion}-${env.dockerImageType}-${env.dockerVersion}
"""
}

pipeline {
Expand All @@ -280,31 +338,33 @@ pipeline {
skipStagesAfterUnstable()
}
triggers {
parameterizedCron( env.BRANCH_NAME == 'develop' ? '''00 02 * * * % marklogicVersion=11;dockerImageType=centos
parameterizedCron( env.BRANCH_NAME == 'develop' ? '''00 02 * * * % marklogicVersion=10;dockerImageType=ubi
00 02 * * * % marklogicVersion=10;dockerImageType=ubi-rootless;SCAP_SCAN=true
00 02 * * * % marklogicVersion=11;dockerImageType=ubi
00 02 * * * % marklogicVersion=11;dockerImageType=ubi-rootless
30 02 * * * % marklogicVersion=10;dockerImageType=centos
30 02 * * * % marklogicVersion=10;dockerImageType=ubi
30 02 * * * % marklogicVersion=10;dockerImageType=ubi-rootless
00 03 * * * % marklogicVersion=12;dockerImageType=centos
00 03 * * * % marklogicVersion=12;dockerImageType=ubi
00 03 * * * % marklogicVersion=12;dockerImageType=ubi-rootless''' : '')
30 02 * * * % marklogicVersion=11;dockerImageType=ubi-rootless;SCAP_SCAN=true
30 02 * * * % marklogicVersion=12;dockerImageType=ubi
30 02 * * * % marklogicVersion=12;dockerImageType=ubi-rootless;SCAP_SCAN=true
00 03 * * * % marklogicVersion=11;dockerImageType=ubi9
00 03 * * * % marklogicVersion=11;dockerImageType=ubi9-rootless;SCAP_SCAN=true
00 03 * * * % marklogicVersion=12;dockerImageType=ubi9
00 03 * * * % marklogicVersion=12;dockerImageType=ubi9-rootless;SCAP_SCAN=true''' : '')
}
environment {
QA_LICENSE_KEY = credentials('QA_LICENSE_KEY')
}

parameters {
string(name: 'emailList', defaultValue: emailList, description: 'List of email for build notification', trim: true)
string(name: 'dockerVersion', defaultValue: '2.0.0', description: 'ML Docker version. This version along with ML rpm package version will be the image tag as {ML_Version}_{dockerVersion}', trim: true)
choice(name: 'dockerImageType', choices: 'ubi-rootless\nubi\ncentos', description: 'Platform type for Docker image. Will be made part of the docker image tag')
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)
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')
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)
choice(name: 'marklogicVersion', choices: '11\n12\n10', description: 'MarkLogic Server Branch. used to pick appropriate rpm')
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)
string(name: 'ML_CONVERTERS', defaultValue: '', description: 'URL for the converters RPM to be included in the image creation \n If left blank the nightly ML Converters Package will be used.', trim: true)
booleanParam(name: 'PUBLISH_IMAGE', defaultValue: false, description: 'Publish image to internal registry')
booleanParam(name: 'TEST_STRUCTURE', defaultValue: true, description: 'Run container structure tests')
booleanParam(name: 'DOCKER_TESTS', defaultValue: true, description: 'Run docker tests')
booleanParam(name: 'SCAP_SCAN', defaultValue: false, description: 'Run Open SCAP scan on the image.')
}

stages {
Expand Down Expand Up @@ -344,6 +404,15 @@ pipeline {
}
}

stage('SCAP-Scan') {
when {
expression { return params.SCAP_SCAN }
}
steps {
scapScan()
}
}

stage('Structure-Tests') {
when {
expression { return params.TEST_STRUCTURE }
Expand Down Expand Up @@ -374,17 +443,18 @@ pipeline {
build job: 'MarkLogic-Docker-Kubernetes/docker/docker-nightly-builds-qa', wait: false, parameters: [string(name: 'dockerImageType', value: "${dockerImageType}"), string(name: 'marklogicVersion', value: "${RPMversion}")]
}
}

}

post {
always {
sh '''
cd src
rm -rf *.rpm
docker rm -f $(docker ps -a -q) || true
docker system prune --force --filter "until=720h"
docker volume prune --force
docker image prune --force --all
rm -rf *.rpm NOTICE.txt
docker stop $(docker ps -a -q) || true
docker system prune --force --all
docker volume prune --force --all
docker system df
'''
publishTestResults()
}
Expand Down
Loading