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

Sonar qube and Nmap #46

Open
wants to merge 272 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
272 commits
Select commit Hold shift + click to select a range
6e4c5fb
aaa
a-efstathiou Sep 9, 2024
e28e721
a
a-efstathiou Sep 9, 2024
6121a63
A
a-efstathiou Sep 9, 2024
0d541d0
a
a-efstathiou Sep 9, 2024
dd00bd9
a
a-efstathiou Sep 9, 2024
6733d82
a
a-efstathiou Sep 9, 2024
5b76ee7
tried to make trufflehog run locally
a-efstathiou Sep 9, 2024
1fe16d7
added checkout scm stage
a-efstathiou Sep 9, 2024
2a3be9e
fixed checkout stage
a-efstathiou Sep 9, 2024
e4c07a8
docker trufflehog
a-efstathiou Sep 10, 2024
2c7bc59
trufflehog git option
a-efstathiou Sep 10, 2024
a4dd84d
docker testing in container
a-efstathiou Sep 10, 2024
f7e37bd
changed docker-compose to allow sockets
a-efstathiou Sep 10, 2024
020b346
test
a-efstathiou Sep 10, 2024
d78dc7c
TEST 2
nikolas2000 Sep 10, 2024
879815f
added docker agent
a-efstathiou Sep 10, 2024
6cc26f9
removed mount socket
a-efstathiou Sep 10, 2024
f9e618d
added docker agent node
a-efstathiou Sep 10, 2024
5b8dd81
fix agent label (?)
a-efstathiou Sep 10, 2024
3b25c82
test docker
a-efstathiou Sep 10, 2024
b5462ed
test 2 agent
a-efstathiou Sep 10, 2024
9613e4c
added jenkins user to docker group
a-efstathiou Sep 10, 2024
8b610b4
fixed docker problem + added trufflehog to scan the repo
a-efstathiou Sep 11, 2024
aebc17d
test commit
a-efstathiou Sep 11, 2024
9d64909
fixed trufflehog
a-efstathiou Sep 11, 2024
ce9c25f
removed -it tag on trufflehog
a-efstathiou Sep 11, 2024
0aaa1d5
check if pipelines triggers on commit
a-efstathiou Sep 11, 2024
d449506
added forgotten password keys.txt
a-efstathiou Sep 11, 2024
b9cc8a7
test key detection
a-efstathiou Sep 11, 2024
42f824f
test
a-efstathiou Sep 11, 2024
6e85263
tests to check git status
a-efstathiou Sep 11, 2024
e5130cd
test
a-efstathiou Sep 11, 2024
d34c99f
a
a-efstathiou Sep 11, 2024
b6dbc5e
a
a-efstathiou Sep 11, 2024
bac3d12
a
a-efstathiou Sep 11, 2024
1a536ed
a
a-efstathiou Sep 11, 2024
2719285
fixed workspace in git
a-efstathiou Sep 11, 2024
00cddef
test with workspace
a-efstathiou Sep 11, 2024
99b42dc
fix
a-efstathiou Sep 11, 2024
9833b5f
fix 2
a-efstathiou Sep 11, 2024
94c5a87
a
a-efstathiou Sep 11, 2024
afeeb57
fix
a-efstathiou Sep 11, 2024
8777052
fix
a-efstathiou Sep 11, 2024
a59d15c
a
a-efstathiou Sep 11, 2024
4e85175
fix ?
a-efstathiou Sep 11, 2024
23a6cb9
final fix ?
a-efstathiou Sep 11, 2024
16fdfda
a
a-efstathiou Sep 11, 2024
8d6b443
test key trufflehog detection
a-efstathiou Sep 11, 2024
dca6f6b
TEST 3
nikolas2000 Sep 11, 2024
d57c42c
TEST 3
nikolas2000 Sep 11, 2024
7a960c2
TEST 3
nikolas2000 Sep 11, 2024
09645f4
TEST 3
nikolas2000 Sep 11, 2024
f495f92
TEST 3
nikolas2000 Sep 11, 2024
2d3d89a
TEST 5
nikolas2000 Sep 11, 2024
5368da0
TEST 5
nikolas2000 Sep 11, 2024
18c24a4
a
a-efstathiou Sep 11, 2024
2ffe40e
test key detection commit
a-efstathiou Sep 11, 2024
8b5d3fe
new commit
a-efstathiou Sep 11, 2024
e0f8e84
TEST Semgrep
nikolas2000 Sep 11, 2024
4756192
TEST Semgrep
nikolas2000 Sep 11, 2024
a8db439
TEST Semgrep
nikolas2000 Sep 11, 2024
8b904e3
TEST Semgrep
nikolas2000 Sep 11, 2024
134bdf5
TEST Semgrep
nikolas2000 Sep 11, 2024
0a4e947
TEST Semgrep
nikolas2000 Sep 11, 2024
5c2b496
TEST Semgrep
nikolas2000 Sep 11, 2024
460e2ef
TEST Semgrep
nikolas2000 Sep 11, 2024
3043078
finished trufflehog hopefully
a-efstathiou Sep 11, 2024
4aa1351
finished trufflehog
a-efstathiou Sep 11, 2024
52c175a
final test commit (?)
a-efstathiou Sep 11, 2024
4108222
final final trufflehog
a-efstathiou Sep 11, 2024
df1c7e7
final final test commit
a-efstathiou Sep 11, 2024
c968df1
final commit ???
a-efstathiou Sep 11, 2024
7bd8464
truly final commit
a-efstathiou Sep 11, 2024
7c16874
removed commented lines on docker compose
a-efstathiou Sep 11, 2024
01107e1
keys copy for testing
a-efstathiou Sep 11, 2024
fbacd4f
jenkinsfile
a-efstathiou Sep 12, 2024
f9b188a
a
a-efstathiou Sep 12, 2024
3329ca6
fixed some things
a-efstathiou Sep 12, 2024
09a7238
a
a-efstathiou Sep 12, 2024
e2fb99c
trufflehog with local commits
a-efstathiou Sep 12, 2024
f8e6256
changed key file to check if pipeline works
a-efstathiou Sep 12, 2024
91cfabd
fixed some issues
a-efstathiou Sep 12, 2024
e77b2b2
change in key.txt to check if pipeline works
a-efstathiou Sep 12, 2024
198a67d
TEST Sonarqube
nikolas2000 Sep 12, 2024
92ba564
TEST Sonarqube
nikolas2000 Sep 12, 2024
3cc30aa
TEST Sonarqube
nikolas2000 Sep 12, 2024
bbb7ea9
a
a-efstathiou Sep 12, 2024
a1aa721
a
a-efstathiou Sep 12, 2024
976bacf
a
a-efstathiou Sep 12, 2024
a945abb
try with HEAD
a-efstathiou Sep 12, 2024
04eb122
test commit for secret scanning
a-efstathiou Sep 12, 2024
d487b55
change 2
a-efstathiou Sep 12, 2024
9303d82
without branch option
a-efstathiou Sep 12, 2024
aa4089b
a
a-efstathiou Sep 12, 2024
c1d543c
tried something else
a-efstathiou Sep 12, 2024
181e849
test
a-efstathiou Sep 12, 2024
aa121ef
TEST Sonarqube
nikolas2000 Sep 12, 2024
84fc5e4
TEST Sonarqube
nikolas2000 Sep 12, 2024
682ba0c
TEST Sonarqube
nikolas2000 Sep 12, 2024
07487bc
TEST Sonarqube
nikolas2000 Sep 12, 2024
9f65073
TEST Sonarqube
nikolas2000 Sep 12, 2024
c5faad9
a
a-efstathiou Sep 12, 2024
f875f60
TEST Sonarqube
nikolas2000 Sep 12, 2024
acaa37b
TEST Sonarqube
nikolas2000 Sep 12, 2024
4ed6adf
TEST Sonarqube
nikolas2000 Sep 12, 2024
48bd90f
TEST Sonarqube
nikolas2000 Sep 12, 2024
a221261
TEST Sonarqube
nikolas2000 Sep 12, 2024
3773d88
fixed jenkinsfile
a-efstathiou Sep 12, 2024
b2536c2
test commit
a-efstathiou Sep 12, 2024
8c81ac9
fixed?
a-efstathiou Sep 12, 2024
70ec886
test
a-efstathiou Sep 12, 2024
5fd9d07
final commit on secrets
a-efstathiou Sep 12, 2024
9e16379
Merge pull request #1 from a-efstathiou/secret-scanning
a-efstathiou Sep 13, 2024
82aee74
TEST Sonarqube
nikolas2000 Sep 13, 2024
8c2ef17
TEST Sonarqube
nikolas2000 Sep 13, 2024
97c119c
TEST Sonarqube
nikolas2000 Sep 13, 2024
5c8fd83
TEST Sonarqube
nikolas2000 Sep 13, 2024
3e65738
TEST Sonarqube
nikolas2000 Sep 13, 2024
e9574ae
TEST Sonarqube
nikolas2000 Sep 13, 2024
18b457e
TEST Sonarqube
nikolas2000 Sep 13, 2024
31e9c91
TEST Sonarqube
nikolas2000 Sep 13, 2024
e45ee75
TEST Sonarqube
nikolas2000 Sep 13, 2024
783d036
Add a static code error
nikolas2000 Sep 13, 2024
2baecd1
Add a static code error 2
nikolas2000 Sep 13, 2024
e6550c1
Add a static code error 2
nikolas2000 Sep 13, 2024
16de43b
Add a static code error 2
nikolas2000 Sep 14, 2024
8cf8792
Add a static code error 3
nikolas2000 Sep 14, 2024
671382e
Add a static code error 4
nikolas2000 Sep 14, 2024
022dc5a
Add a static code error 4
nikolas2000 Sep 14, 2024
51a5ef2
Add a static code error 6
nikolas2000 Sep 14, 2024
778c187
Add a static code error 6
nikolas2000 Sep 14, 2024
ac795b5
Add a static code error 6
nikolas2000 Sep 14, 2024
4db3cb0
Add a static code error 7
nikolas2000 Sep 14, 2024
3e6585d
Add a static code error 7
nikolas2000 Sep 14, 2024
7370193
Add a static code error 7
nikolas2000 Sep 14, 2024
8ed0de5
Add a static code error 7
nikolas2000 Sep 14, 2024
baec11b
Add a static code error 7
nikolas2000 Sep 14, 2024
5f4b70e
Add a static code error 88
nikolas2000 Sep 14, 2024
071a2d4
Add a static code error 88
nikolas2000 Sep 14, 2024
82d4385
Add a static code error 88 Test
nikolas2000 Sep 14, 2024
d0f34fe
Add static code analyzer test to Comment class
nikolas2000 Sep 14, 2024
c01f4c7
Add static code analyzer test to Comment class 2
nikolas2000 Sep 14, 2024
17eeb83
Add static code analyzer test to Comment class 2
nikolas2000 Sep 14, 2024
3843386
Add static code analyzer test to Comment class 3
nikolas2000 Sep 14, 2024
3444428
Add static code analyzer test to Comment class 3
nikolas2000 Sep 14, 2024
950860c
Add lINTERS test to Comment class 5
nikolas2000 Sep 14, 2024
3359dce
Add lINTERS test to Comment class 6
nikolas2000 Sep 14, 2024
d913f66
Add lINTERS test to Comment class 6
nikolas2000 Sep 14, 2024
eb48b5f
Add lINTERS test to Comment class 6
nikolas2000 Sep 14, 2024
434a5e4
Add lINTERS test to Comment class 6
nikolas2000 Sep 14, 2024
3f8d571
Add lINTERS test to Comment class 7
nikolas2000 Sep 15, 2024
76c6cb9
Add lINTERS test to Comment class 7
nikolas2000 Sep 15, 2024
5d393e6
Add lINTERS test to Comment class 7
nikolas2000 Sep 15, 2024
3f4e6b5
Add lINTERS test to Comment class 7
nikolas2000 Sep 15, 2024
7b777ab
Add nmap 1
nikolas2000 Sep 15, 2024
116565e
Add nmap 2
nikolas2000 Sep 15, 2024
369e3d0
Add nmap 2
nikolas2000 Sep 15, 2024
5622dfa
Add nmap 2
nikolas2000 Sep 15, 2024
acd8ccc
Add nmap 2
nikolas2000 Sep 15, 2024
04969e0
Add nmap 2
nikolas2000 Sep 15, 2024
1ae407c
Add nmap 3
nikolas2000 Sep 15, 2024
895771b
Add nmap 3
nikolas2000 Sep 15, 2024
251e071
Add nmap 3
nikolas2000 Sep 15, 2024
296ad44
Add nmap 3
nikolas2000 Sep 15, 2024
3c4fe5b
Add nmap 3
nikolas2000 Sep 15, 2024
0ff4383
Add nmap 4
nikolas2000 Sep 15, 2024
0d4f06f
Add nmap 4
nikolas2000 Sep 15, 2024
4d9143e
Add nmap 4
nikolas2000 Sep 15, 2024
1766940
Add nmap 4
nikolas2000 Sep 15, 2024
20d500c
Add nmap 5
nikolas2000 Sep 15, 2024
50449c1
Add nmap 5
nikolas2000 Sep 15, 2024
c07ca01
Add nmap 5
nikolas2000 Sep 15, 2024
1fb3906
Add nmap 5
nikolas2000 Sep 15, 2024
f958c59
Add nmap 67
nikolas2000 Sep 15, 2024
6013139
Add nmap 677
nikolas2000 Sep 15, 2024
ec673ec
Add nmap 6734
nikolas2000 Sep 15, 2024
eade09b
Add nmap 6736
nikolas2000 Sep 15, 2024
b25266b
snyk + sqlmap
a-efstathiou Sep 15, 2024
86be415
a
a-efstathiou Sep 15, 2024
d4c48e5
fix
a-efstathiou Sep 15, 2024
4396e99
a
a-efstathiou Sep 15, 2024
3ce0096
a
a-efstathiou Sep 15, 2024
543c92c
a
a-efstathiou Sep 15, 2024
a6e5669
a
a-efstathiou Sep 15, 2024
7873d82
Add nmap 673635
nikolas2000 Sep 15, 2024
12bd7de
a
a-efstathiou Sep 15, 2024
d2ce6b7
a
a-efstathiou Sep 15, 2024
256c15c
fix
a-efstathiou Sep 15, 2024
751e7fe
a
a-efstathiou Sep 15, 2024
aedd32d
Add nmap TEST 1
nikolas2000 Sep 15, 2024
e5e1d6e
Add nmap TEST 2
nikolas2000 Sep 15, 2024
aa08636
Add nmap TEST 3
nikolas2000 Sep 15, 2024
dba8a25
Add nmap TEST 4
nikolas2000 Sep 15, 2024
75e467f
Add nmap TEST 5
nikolas2000 Sep 15, 2024
57b1386
as
a-efstathiou Sep 15, 2024
6969c65
Add nmap TEST 5
nikolas2000 Sep 15, 2024
e85b023
Add nmap TEST 6
nikolas2000 Sep 15, 2024
2948a48
fix
a-efstathiou Sep 15, 2024
e7c3472
Add nmap TEST 7
nikolas2000 Sep 15, 2024
483380c
Add nmap TEST 8
nikolas2000 Sep 15, 2024
13a202e
Add nmap TEST 9
nikolas2000 Sep 15, 2024
aa8a4c2
final check?
a-efstathiou Sep 15, 2024
a6bee23
test commit
a-efstathiou Sep 15, 2024
14c8f77
test
a-efstathiou Sep 15, 2024
39aaeea
Add nmap TEST 9
nikolas2000 Sep 15, 2024
df61ba4
fix
a-efstathiou Sep 15, 2024
eb4b674
test1
a-efstathiou Sep 15, 2024
2e7d8b7
fix
a-efstathiou Sep 15, 2024
c32f2ab
parallel stages
a-efstathiou Sep 15, 2024
025adc7
test
a-efstathiou Sep 15, 2024
c53e3cb
fix parallel
a-efstathiou Sep 15, 2024
e5f349b
test
a-efstathiou Sep 15, 2024
286067c
Add nmap TEST 9
nikolas2000 Sep 15, 2024
13508e6
fix?
a-efstathiou Sep 15, 2024
d7fb0f5
fix
a-efstathiou Sep 15, 2024
b241423
Add nmap TEST 9
nikolas2000 Sep 15, 2024
24a3442
Add nmap TEST 9
nikolas2000 Sep 15, 2024
92da38e
Add nmap TEST 9
nikolas2000 Sep 15, 2024
a1c8eb5
Add nmap TEST 9
nikolas2000 Sep 15, 2024
a4cf0ee
Add nmap TEST 10
nikolas2000 Sep 15, 2024
23ffc5c
Merge remote-tracking branch 'origin/code-checking' into code-checking
nikolas2000 Sep 15, 2024
4d5638e
sequential again
a-efstathiou Sep 15, 2024
0791e53
Add nmap TEST 10
nikolas2000 Sep 15, 2024
54577f3
test commit
a-efstathiou Sep 15, 2024
df02b70
Add nmap Last
nikolas2000 Sep 15, 2024
de6dd31
completed pipeline kinda
a-efstathiou Sep 15, 2024
ef3fc8f
create branch with finished code
a-efstathiou Sep 15, 2024
8a30c84
Merge pull request #2 from a-efstathiou/finished-pipeline
a-efstathiou Sep 15, 2024
4075d28
check
a-efstathiou Sep 15, 2024
81507d8
fixed
a-efstathiou Sep 15, 2024
af5216c
test 1
a-efstathiou Sep 15, 2024
17ba437
Add nmap Last 1
nikolas2000 Sep 15, 2024
bd5401e
tests
a-efstathiou Sep 15, 2024
3244a9c
print tests in setting environment variables
a-efstathiou Sep 15, 2024
136827a
test
a-efstathiou Sep 15, 2024
d4f612a
fixed parameters
a-efstathiou Sep 15, 2024
7c4aad6
test commit
a-efstathiou Sep 15, 2024
a4e9066
Add nmap Last Ports add
nikolas2000 Sep 15, 2024
678d766
Add nmap Last Ports add 2
nikolas2000 Sep 15, 2024
51755e7
Add nmap Last Ports add 2
nikolas2000 Sep 15, 2024
ba735eb
Add nmap Last Ports add 4
nikolas2000 Sep 15, 2024
f9249d5
tests
a-efstathiou Sep 15, 2024
8efa7cf
fixes
a-efstathiou Sep 15, 2024
09b69cf
Merge pull request #3 from a-efstathiou/tests
a-efstathiou Sep 15, 2024
0205f2d
Merge branch 'master' into code-checking
nikolas2000 Sep 16, 2024
8fa9b87
Add nmap Last Ports add 5
nikolas2000 Sep 16, 2024
c6215fb
Add nmap Last Ports add 5
nikolas2000 Sep 16, 2024
452f84b
Add nmap Last Ports add 5
nikolas2000 Sep 16, 2024
0c8bd17
Add nmap Last Ports add 5
nikolas2000 Sep 16, 2024
8022405
Add nmap Last Ports add 5
nikolas2000 Sep 16, 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
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ services:
vulnado:
build: .
ports:
- 8080:8080
- 8081:8080
links:
- db
- internal_site
Expand Down
18 changes: 18 additions & 0 deletions jenkins/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM jenkins/jenkins:2.462.2-jdk17
USER root
RUN apt-get update && apt-get install -y lsb-release
RUN curl -fsSLo /usr/share/keyrings/docker-archive-keyring.asc \
https://download.docker.com/linux/debian/gpg
RUN echo "deb [arch=$(dpkg --print-architecture) \
signed-by=/usr/share/keyrings/docker-archive-keyring.asc] \
https://download.docker.com/linux/debian \
$(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list
RUN apt-get update && apt-get install -y docker-ce-cli
RUN apt-get install nmap
USER jenkins
RUN jenkins-plugin-cli --plugins "blueocean:1.27.14 \
docker-workflow:580.vc0c340686b_54 \
build-token-root:151.va_e52fe3215fc \
file-parameters:339.v4b_cc83e11455 \
sonar:2.17.2"

193 changes: 193 additions & 0 deletions jenkins/Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,193 @@
pipeline {
agent any
parameters{
string(name: 'dockerComposePath', defaultValue: '', description: 'Path of the docker-compose.yml')
string(name: 'dockerfilePath', defaultValue: '', description: 'Path of the Dockerfile')
string(name: 'endpointsPath', defaultValue: '', description: 'Path of the endpoints to test SQLmap')
}
environment {
REPO_URL = ''
CURR_BRANCH = ''
workspace = ''
relativeWorkspacePath = ''
SNYK_TOKEN = credentials('snyk-token')
images_string = ''
}
stages {
stage ('Checkout SCM')
{
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
script {
checkout scm
workspace = pwd ()
}
}
}
}
stage('Setting Environment Variables') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
script {
echo "Getting git repo info"
// Get the current repository URL
REPO_URL = sh(script: 'git config --get remote.origin.url', returnStdout: true).trim()
CURR_BRANCH = sh(script: 'git rev-parse --abbrev-ref HEAD', returnStdout: true).trim()
}
}
}
}

stage('TruffleHog Secret Scan') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
script {
echo "Running Trufflehog Scan"
sh 'rm -f trufflehog'

sh """
docker run --rm trufflesecurity/trufflehog:latest git ${REPO_URL} --since-commit HEAD --only-verified > trufflehog
"""

def truffle = readFile "trufflehog"

if (truffle.length() == 0) {
echo "Good to go. No secrets found"
}
else {
echo "Warning! Secrets are committed into your git repository."
error("Secrets might be committed into your git repo")
}
}
}
}
}
stage('Sonar Cube Scan') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
withSonarQubeEnv(installationName: 'sonarQube1') {
sh './mvnw clean compile' // Compile the code first
sh './mvnw org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.0.2155:sonar -Dsonar.java.binaries=target/classes' // Run the SonarQube scan
}
}

}
}
stage('Check and build Docker Images') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
script {
def images = []

if (dockerComposePath?.trim()) {
// If dockerComposePath is provided, run docker-compose to build images
echo "Docker Compose file detected. Building images using docker-compose..."
sh """
docker compose -f ${workspace}${params.dockerComposePath} build --parallel
"""

// Get repository and tag of the images created by docker-compose
images = sh(script: """
docker compose -f ${workspace}${params.dockerComposePath} images --format '{{.Repository}}:{{.Tag}}'
""", returnStdout: true).trim().split("\n")

} else if (dockerfilePath?.trim()) {
// If dockerComposePath is NOT provided, build the Docker image using the Dockerfile
echo "Dockerfile detected. Building image using docker build..."

def imageName = "my_image:latest" // You can customize the image name as needed
sh """
docker build -t ${imageName} -f ${params.dockerfilePath} .
"""

echo "Image built from Dockerfile: ${imageName}"
images << imageName
} else {
error "No Dockerfile or Docker Compose file provided. Please provide at least one."
}

// Save images to an environment variable for later stages
images_string = images.join(",")
}
}
}
}
stage('Snyk Docker Image vulnerability scan') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
script {
def images = []
if (${images_string} && ${images_string}.trim()) {
images = ${images_string}.split(",")
}
else {
error "No images to scan with Snyk"
}

for (image in images) {
def sanitizedImageName = image.replaceAll("/", "_").replaceAll(":", "_")

echo "Scanning image: ${image} using Snyk..."

sh "rm -f snyk_${sanitizedImageName}"

sh """
docker run --rm -it --env ${SNYK_TOKEN} -v /var/run/docker.sock:/var/run/docker.sock \
snyk/snyk:docker snyk test --docker ${image} --severity-threshold=critical --fail-on=all > snyk_${sanitizedImageName}
"""
}
}
}
}
}

stage('Version Docker') {
steps {
sh 'docker --version'
}
}


stage('Run Nmap-Vuln Scan-Opened Ports-Vulnerabilites') {
steps {
script {
sh """
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v ${PWD}:/usr/src/myapp -w /usr/src/myapp nikolaskir2000/nmap_image_3:latest -sV --script vuln 192.168.2.11 -p 80,223,8080,8082

"""
}
}
}



stage('SQL map endpoints scan') {
steps {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh """
docker run --rm -v ${PWD}:/usr/src/myapp -w /usr/src/myapp thanosefsta/sqlmap:latest -m ${workspace}${params.endpointsPath} --batch > sqlmap
"""
}

}
}
stage('Run Nmap - Opened Gates') {
steps {
echo "Deliver"
}
}
}

post {
always {
echo 'Cleaning up...'

}
success {
echo 'Pipeline completed successfully.'
}
failure {
echo 'Pipeline failed. Please check the logs.'
}
}
}
58 changes: 58 additions & 0 deletions jenkins/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
services:
jenkins:
build: . # This will build the Docker image from the Dockerfile in the same directory
container_name: jenkins-blueocean
restart: on-failure
networks:
- jenkins
# environment:
# # - DOCKER_HOST=tcp://docker:2376 # Docker host for communication
# # - DOCKER_CERT_PATH=/certs/client # Path to Docker certificates
# # - DOCKER_TLS_VERIFY=1 # Enable TLS verification
volumes:
- jenkins-data:/var/jenkins_home # Persistent Jenkins data
- jenkins-docker-certs:/certs/client:ro # Mount Docker client certs for TLS connection (read-only)
- /var/run/docker.sock:/var/run/docker.sock
ports:
- "8080:8080" # Jenkins web UI
- "50000:50000" # Jenkins agent connections
sonarqube:
image: sonarqube:lts-community
depends_on:
- sonar_db
environment:
SONAR_JDBC_URL: jdbc:postgresql://sonar_db:5432/sonar
SONAR_JDBC_USERNAME: sonar
SONAR_JDBC_PASSWORD: sonar
ports:
- "9000:9000"
volumes:
- sonarqube_conf:/opt/sonarqube/conf
- sonarqube_data:/opt/sonarqube/data
- sonarqube_extensions:/opt/sonarqube/extensions
- sonarqube_logs:/opt/sonarqube/logs
- sonarqube_temp:/opt/sonarqube/temp

sonar_db:
image: postgres:13
environment:
POSTGRES_USER: sonar
POSTGRES_PASSWORD: sonar
POSTGRES_DB: sonar
volumes:
- sonar_db:/var/lib/postgresql
- sonar_db_data:/var/lib/postgresql/data
networks:
jenkins:
driver: bridge # Creates a custom bridge network called 'jenkins'

volumes:
jenkins-data: # Persistent volume for Jenkins home directory
jenkins-docker-certs: # Volume for Docker TLS client certificates
sonarqube_conf:
sonarqube_data:
sonarqube_extensions:
sonarqube_logs:
sonarqube_temp:
sonar_db:
sonar_db_data:
44 changes: 44 additions & 0 deletions jenkins/keys copy.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Basic auth:
test
https://admin:admin@the-internet.herokuapp.com/basic_auth

Private key:
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAABAjNIZuun
xgLkM8KuzfmQuRAAAAEAAAAAEAAAGXAAAAB3NzaC1yc2EAAAADAQABAAABgQDe3Al0EMPz
utVNk5DixaYrGMK56RqUoqGBinke6SWVWmqom1lBcJWzor6HlnMRPPr7YCEsJKL4IpuVwu
inRa5kdtNTyM7yyQTSR2xXCS0fUItNuq8pUktsH8VUggpMeew8hJv7rFA7tnIg3UXCl6iF
OLZKbDA5aa24idpcD8b1I9/RzTOB1fu0of5xd9vgODzGw5JvHQSJ0FaA42aNBMGwrDhDB3
sgnRNdWf6NNIh8KpXXMKJADf3klsyn6He8L2bPMp8a4wwys2YB35p5zQ0JURovsdewlOxH
NT7eP19eVf4dCreibxUmRUaob5DEoHEk8WrxjKWIYUuLeD6AfcW6oXyRU2Yy8Vrt6SqFl5
WAi47VMFTkDZYS/eCvG53q9UBHpCj7Qvb0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niUeLI78W/UsZqb64YQbfRyBzFtI1T/SsCi0B
e0EyKMzbxtSceT1Mb8eJiVIq04Xpwez9fIUt5rSedZD8KPq8P6s0cGsR7Qmw6eXZ/dBR/a
s5vPhfIUmQawmnwAVuWNRdQQ79jUBSn5M+ZRVVTgEG+vFyvxr/bZqOo1JCoq5BmQhLWGRJ
Dk9TolbeFIVFrkuXkcu99a079ux7XSkON64oPzHrcsEzjPA1GPqs9CGBSO16wq/nI3zg+E
kcOCaurc9yHJJPwduem0+8WLX3WoGNfQRKurtQze2ppy8KarEtDhDd96sKkhYaqOg3GOX8
Yx827L4vuWSJSIqKuO2kH6kOCMUNO16piv0z/8u3CJxOGh9+4FZIop81fiFTKLhV3/gwLm
fzFY++KIZrLfZcUjzd80NNEja69F452Eb9HrI5BurN/PznDEi9bzM598Y7beyl4/kd4R2e
S7SW9/LOrGw5UgxtiU+kV8nPz1PdgxO4sRlnntSBEwkQBzMkLOpq2h2BuJ2TlMP/TWuwLQ
sDkv1Yk1pD0roGmtMzbujnURGxqRJ8gUmuIot4hpfyRSssvnRQQZ3lQCQCwHiE+HJxXWf5
c58zOMjW7o21tI8e13uUnbRoQVJM9XYqk1usPXIkYPYL9uOw3AW/Zn+cnDrsXvTK9ZxgGD
/90b1BNwVqMlUK+QggHNwl5qD8eoXK5cDvav66te+E+V7FYFQ06w3tytRVz8SjoaiChN02
muIjvl6G7Hoj1hObM2t/ZheN1EShS11z868hhS6Mx7GvIdtkXuvdiBYMiBLOshJQxB8Mzx
iug9W+Di3upLf0UMC1TqADGphsIHRU7RbmHQ8Rwp7dogswmDfpRSapPt9p0D+6Ad5VBzi3
f3BPXj76UBLMEJCrZR1P28vnAA7AyNHaLvMPlWDMG5v3V/UV+ugyFcoBAOyjiQgYST8F3e
Hx7UPVlTK8dyvk1Z+Yw0nrfNClI=
-----END OPENSSH PRIVATE KEY-----
44 changes: 44 additions & 0 deletions jenkins/keys.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Basic auth:
https://admin:admin@the-internet.herokuapp.com/basic_auth
https://admin:admin@the-internet.herokuapp.com/basic_auth

Private key:
-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1jdHIAAAAGYmNyeXB0AAAAGAAAABAjNIZuun
xgLkM8KuzfmQuRAAAAEAAAAAEAAAGXAAAAB3NzaC1yc2EAAAADAQABAAABgQDe3Al0EMPz
utVNk5DixaYrGMK56RqUoqGBinke6SWVWmqom1lBcJWzor6HlnMRPPr7YCEsJKL4IpuVwu
inRa5kdtNTyM7yyQTSR2xXCS0fUItNuq8pUktsH8VUggpMeew8hJv7rFA7tnIg3UXCl6iF
OLZKbDA5aa24idpcD8b1I9/RzTOB1fu0of5xd9vgODzGw5JvHQSJ0FaA42aNBMGwrDhDB3
sgnRNdWf6NNIh8KpXXMKJADf3klsyn6He8L2bPMp8a4wwys2YB35p5zQ0JURovsdewlOxH
NT7eP19eVf4dCreibxUmRUaob5DEoHEk8WrxjKWIYUuLeD6AfcW6oXyRU2Yy8Vrt6SqFl5
WAi47VMFTkDZYS/eCvG53q9UBHpCj7Qvb0vSkCZXBvBIhlw193F3PX4WvO1IXsMwvQ1D1X
lmomsItbqM0cJyKw6LU18QWiBHvE7BqcphaoL5E08W2ATTSRIMCp6rt4rptM7KyGK8rc6W
UYrCnWt6KlCA8AAAWQXk+lVx6bH5itIKKYmQr6cR/5xtZ2GHAxnYtvlW3xnGhU0MHv+lJ2
uoWlT2RXE5pdMUQj7rNWAMqkwifSKZs9wBfYeo1TaFDmC3nW7yHSN3XTuO78mPIW5JyvmE
Rj5qjsUn7fNmzECoAxnVERhwnF3KqUBEPzIAc6/7v/na9NTiiGaJPco9lvCoPWbVLN08WG
SuyU+0x5zc3ebzuPcYqu5/c5nmiGxhALrIhjIS0OV1mtAAFhvdMjMIHOijOzSKVCC7rRk5
kG9EMLNvOn/DUVSRHamw5gs2V3V+Zq2g5nYWfgq8aDSTB8XlIzOj1cz3Hwf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SW9/LOrGw5UgxtiU+kV8nPz1PdgxO4sRlnntSBEwkQBzMkLOpq2h2BuJ2TlMP/TWuwLQ
sDkv1Yk1pD0roGmtMzbujnURGxqRJ8gUmuIot4hpfyRSssvnRQQZ3lQCQCwHiE+HJxXWf5
c58zOMjW7o21tI8e13uUnbRoQVJM9XYqk1usPXIkYPYL9uOw3AW/Zn+cnDrsXvTK9ZxgGD
/90b1BNwVqMlUK+QggHNwl5qD8eoXK5cDvav66te+E+V7FYFQ06w3tytRVz8SjoaiChN02
muIjvl6G7Hoj1hObM2t/ZheN1EShS11z868hhS6Mx7GvIdtkXuvdiBYMiBLOshJQxB8Mzx
iug9W+Di3upLf0UMC1TqADGphsIHRU7RbmHQ8Rwp7dogswmDfpRSapPt9p0D+6Ad5VBzi3
f3BPXj76UBLMEJCrZR1P28vnAA7AyNHaLvMPlWDMG5v3V/UV+ugyFcoBAOyjiQgYST8F3e
Hx7UPVlTK8dyvk1Z+Yw0nrfNClI=
-----END OPENSSH PRIVATE KEY-----
5 changes: 5 additions & 0 deletions jenkins/nmap/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM alpine:latest
RUN apk update && apk add bash
RUN apk add nmap
RUN apk add nmap-scripts
ENTRYPOINT ["nmap"]
11 changes: 11 additions & 0 deletions jenkins/sqlmap/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM cgr.dev/chainguard/git:latest AS git-clone

WORKDIR /sqlmap

RUN git clone --depth 1 https://github.com/sqlmapproject/sqlmap.git .

FROM cgr.dev/chainguard/python:latest

COPY --from=git-clone /sqlmap .

ENTRYPOINT ["python3", "/sqlmap.py"]
1 change: 1 addition & 0 deletions jenkins/sqlmap/endpoints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
http://testphp.vulnweb.com/artists.php?artist=1
Loading