Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
72 changes: 55 additions & 17 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@

pipeline {

agent any

agent {
docker {
image 'securityuniversal/jenkins-pipeline-agent:latest'
args '--group-add 999'
}
}

stages {
stage('Initialize Config') {
Expand Down Expand Up @@ -45,6 +49,11 @@ pipeline {
}

stage('Unit Testing') {
agent {
docker {
image 'securityuniversal/jenkins-python-agent:latest'
}
}
when {
expression {
def config = jslReadYamlConfig('unitTesting')
Expand All @@ -64,6 +73,11 @@ pipeline {
}

stage('Secret Scanning') {
agent {
docker {
image 'securityuniversal/jenkins-secret-agent:latest'
}
}
when {
expression {
def config = jslReadYamlConfig('secretScanning')
Expand All @@ -83,6 +97,11 @@ pipeline {
}

stage('Software Composition Analysis') {
agent {
docker {
image 'securityuniversal/jenkins-codetesting-agent:latest'
}
}
when {
expression {
def config = jslReadYamlConfig('sca')
Expand All @@ -106,6 +125,11 @@ pipeline {
}

stage('Static Application Security Testing') {
agent {
docker {
image 'securityuniversal/jenkins-codetesting-agent:latest'
}
}
when {
expression {
def config = jslReadYamlConfig('sast')
Expand All @@ -129,6 +153,12 @@ pipeline {
}

stage('Infrastructure-as-Code Security Testing') {
agent {
docker {
image 'securityuniversal/jenkins-iac-agent:latest'
args '--group-add 999'
}
}
when {
expression {
def config = jslReadYamlConfig('iac')
Expand All @@ -148,6 +178,12 @@ pipeline {
}

stage('Build Docker Service') {
agent {
docker {
image 'securityuniversal/jenkins-iac-agent:latest'
args '--group-add 999'
}
}
when {
expression {
def config = jslReadYamlConfig('buildDocker')
Expand All @@ -171,6 +207,12 @@ pipeline {
}

stage('Docker Container Scanning') {
agent {
docker {
image 'securityuniversal/jenkins-iac-agent:latest'
args '--group-add 999'
}
}
when {
expression {
def config = jslReadYamlConfig('containerScan')
Expand All @@ -195,6 +237,11 @@ pipeline {
}

stage('Release to Test') {
agent {
docker {
image 'securityuniversal/jenkins-deploy-agent:latest'
}
}
when {
expression {
def config = jslReadYamlConfig('releaseToTest')
Expand Down Expand Up @@ -266,6 +313,11 @@ pipeline {

////////// Deploy to Production //////////
stage('Deploy') {
agent {
docker {
image 'securityuniversal/jenkins-deploy-agent:latest'
}
}
when {
anyOf {
// Condition for the PROD branch
Expand Down Expand Up @@ -299,21 +351,7 @@ pipeline {
post {
always {
script {
def reportProcessor = new PipelineReportProcessor(this)
reportProcessor.processReport('pipeline_stage_report.json')

def reportFile = 'pipeline_stage_report.json'
archiveArtifacts artifacts: reportFile, allowEmptyArchive: true

def stageConfig = jslReadYamlConfig('post')
def recipientEmails = stageConfig?.recipientEmails
def recipientTeamsChannels = stageConfig?.recipientTeamsChannels

jslSendMicrosoftTeamsPipelineReportMessage(recipientTeamsChannels)
jslSendMicrosoftTeamsMessage(recipientTeamsChannels)
jslSendPipelineStageReportEmail(recipientEmails)
jslSendSecurityReportEmail(recipientEmails)
jslSendPipelineReport()
jslPipelineReporter()
}
}
}
Expand Down
4 changes: 3 additions & 1 deletion ci_cd/unit_tests/web_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,9 @@ def test_edit_application_post(self):
'regulations': 1,
}
response = self._post_test_handler(route, data_dict)
assert response.status_code == 200
match = _three_o_two_handler(response.headers, f"/edit_application/{app.ID}")
assert response.status_code == 302
assert match

def test_contacts_get(self):
app = BusinessApplications.query.filter_by(ApplicationName=TEST_APP_NAME).first()
Expand Down
Loading