Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
168 commits
Select commit Hold shift + click to select a range
bc18ce6
Commit All
XeniaP Apr 21, 2021
45d2489
Update test.txt
XeniaP Apr 21, 2021
b575291
Merge branch 'master' of https://github.com/XeniaP/scExample
XeniaP Apr 21, 2021
83c45d1
Update Dockerfile
XeniaP Apr 21, 2021
47cdb24
Update Dockerfile
XeniaP Apr 21, 2021
4d47b0a
Merge branch 'master' of https://github.com/XeniaP/scExample
XeniaP Apr 21, 2021
3677161
Update test.txt
XeniaP Apr 23, 2021
3422931
Update Dockerfile
XeniaP Apr 23, 2021
976a87f
Update Dockerfile
XeniaP Apr 23, 2021
eeb6dc7
wtf
XeniaP Apr 23, 2021
191b318
WTF
XeniaP Apr 23, 2021
710e025
Update Dockerfile
XeniaP Apr 23, 2021
eb86251
Fixed to Public
XeniaP May 5, 2021
479c628
Merge branch 'master' of https://github.com/XeniaP/Trend-Micro-Smart-…
XeniaP May 5, 2021
3ff133c
Create dssc-workload.yml
XeniaP Feb 17, 2022
2ef8d54
Update dssc-workload.yml
XeniaP Feb 17, 2022
0a7a60b
Update dssc-workload.yml
XeniaP Feb 17, 2022
28830f8
Update dssc-workload.yml
XeniaP Feb 17, 2022
cf2e12b
Update jenkinsfile
XeniaP Apr 19, 2022
9c69fed
Update jenkinsfile
XeniaP Apr 19, 2022
c76c25b
Update README.md
XeniaP Jul 5, 2022
990692f
Update dssc-workload.yml
XeniaP Jul 5, 2022
2cb8a8e
Update jenkinsfile
XeniaP Jul 17, 2022
b38bf94
Rename jenkinsfile to Jenkinsfile
XeniaP Jul 17, 2022
e28bc36
Update Jenkinsfile
XeniaP Jul 17, 2022
21a4224
Update Jenkinsfile
XeniaP Jul 17, 2022
d7ca6d5
Update Jenkinsfile
XeniaP Jul 17, 2022
2cd67a9
Update Jenkinsfile
XeniaP Jul 17, 2022
e06b2af
Update Jenkinsfile
XeniaP Jul 17, 2022
09a1354
Update Jenkinsfile
XeniaP Jul 17, 2022
3c7626f
Update Jenkinsfile
XeniaP Jul 17, 2022
0c7934e
Update dssc-workload.yml
XeniaP Jul 19, 2022
6697334
Update Jenkinsfile
XeniaP Jul 19, 2022
41dc878
Update Jenkinsfile
XeniaP Jul 19, 2022
335b764
Update dssc-workload.yml
XeniaP Jul 19, 2022
eb1c164
Update dssc-workload.yml
XeniaP Jul 20, 2022
86c0465
Update dssc-workload.yml
XeniaP Jul 21, 2022
da37880
Update dssc-workload.yml
XeniaP Jul 21, 2022
fc36f93
add ScanScript
XeniaP Apr 24, 2023
c630c72
Update SmartcheckScan.py
XeniaP Apr 24, 2023
cb512ab
Create requirements.txt
XeniaP Apr 24, 2023
d918bcc
Create azure-pipelines.yml
XeniaP Apr 24, 2023
94df392
Update dssc-workload.yml
XeniaP May 7, 2023
479763d
Update dssc-workload.yml
XeniaP May 7, 2023
6a8ea1d
Update dssc-workload.yml
XeniaP May 7, 2023
44689d9
Merge branch 'master' of https://github.com/XeniaP/Trend-Micro-Smart-…
XeniaP Jul 22, 2023
89b0c7c
add Artifact Scanner
XeniaP Jul 22, 2023
b44cdb2
update Arifact Scanner Version
XeniaP Jul 22, 2023
dc316a6
Delete AWS ECR Steps
XeniaP Jul 22, 2023
c8fed25
Add Action Variable Configuration
XeniaP Jul 22, 2023
be08ced
Update
XeniaP Jul 22, 2023
f0bf4fd
Addding environment for GithubActions ENV Variab
XeniaP Jul 22, 2023
c90ea4d
add Env variables
XeniaP Jul 22, 2023
d92cb09
update version of aws actions
XeniaP Jul 22, 2023
8474066
Update Permmisions
XeniaP Jul 22, 2023
18aa974
Update AWS Actions Version for Support Nodejs ver
XeniaP Jul 22, 2023
a01b0ba
update version
XeniaP Jul 22, 2023
2ddba60
up
XeniaP Jul 22, 2023
672279b
aws-actions/configure-aws-credentials@v2.2.0
XeniaP Jul 22, 2023
bc348ce
image
XeniaP Jul 22, 2023
bdc3fcc
update Image information
XeniaP Jul 22, 2023
e55f556
comment aws configuration
XeniaP Jul 22, 2023
a328a83
add code for save scanning result
XeniaP Jul 22, 2023
01a267d
add threshold
XeniaP Jul 22, 2023
8393246
.
XeniaP Jul 22, 2023
add3c40
Update requirements.txt
XeniaP Oct 21, 2023
ecba876
Update requirements.txt
XeniaP Oct 21, 2023
b9d2034
Set up CI with Azure Pipelines
XeniaP Dec 13, 2023
c09b96c
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
5e622ac
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
cc439c2
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
efd86d0
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
306e959
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
a2a3e77
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
c2ee2da
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
bc844e5
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
4c04ee4
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
97a6029
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
0881d66
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
dd9cced
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
a8c716b
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
bd2f250
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
e3942ba
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
3d32af8
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
b2e75b9
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
6e50a36
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
eb8e806
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
3e1f18d
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
8f22fb4
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
79c8fac
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
d67903c
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
a5e7ea2
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
fc12d56
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
197874d
Create ArtifactScannerReport.py
XeniaP Dec 13, 2023
dcb03d2
Merge pull request #1 from XeniaP/azure-pipelines
XeniaP Dec 13, 2023
454349c
Update azure-pipelines.yml
XeniaP Dec 13, 2023
fbd6614
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
f0fa436
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
95c577f
Update azure-pipelines.yml
XeniaP Dec 13, 2023
4fcd168
Update azure-pipelines.yml
XeniaP Dec 13, 2023
a10abc0
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
60b9299
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
1b82d9b
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
894eb99
Update azure-pipelines.yml for Azure Pipelines
XeniaP Dec 13, 2023
758640c
Create tmas_workflow
XeniaP Jan 8, 2024
b0e45fe
newPipeline
XeniaP Jan 8, 2024
208dcda
newPipeline
XeniaP Jan 8, 2024
e3c23f1
newPipeline
XeniaP Jan 8, 2024
15db2b8
newPipeline
XeniaP Jan 8, 2024
e781382
newPipeline
XeniaP Jan 8, 2024
893d5b9
newPipeline
XeniaP Jan 8, 2024
cc2b703
newPipeline
XeniaP Jan 8, 2024
3cb6430
Update tmas_workflow.yml
XeniaP Jan 16, 2024
25d83ec
Update tmas_workflow.yml
XeniaP Jan 16, 2024
44149fe
Update tmas_workflow.yml
XeniaP Jan 16, 2024
80e26d4
Update tmas_workflow.yml
XeniaP Jan 16, 2024
0e22ca7
Update tmas_workflow.yml
XeniaP Jan 16, 2024
92511d6
Update tmas_workflow.yml
XeniaP Jan 16, 2024
47b3aeb
Test
XeniaP Jan 16, 2024
6faa8e5
Test
XeniaP Jan 16, 2024
d611850
Test
XeniaP Jan 16, 2024
f330fa7
Test
XeniaP Jan 16, 2024
c31cee0
Test
XeniaP Jan 16, 2024
ce134db
Test
XeniaP Jan 16, 2024
cae18db
Test
XeniaP Jan 16, 2024
f8904c7
Update tmas_workflow.yml
XeniaP Jan 16, 2024
05ea926
Test
XeniaP Jan 16, 2024
9638a00
Test
XeniaP Jan 16, 2024
46daaa3
Test
XeniaP Jan 16, 2024
b9c64af
Test
XeniaP Jan 16, 2024
d525930
Test
XeniaP Jan 16, 2024
de14868
Test
XeniaP Jan 16, 2024
442611c
Test
XeniaP Jan 17, 2024
efa37bb
Update azure-pipelines.yml for Azure Pipelines
XeniaP Jan 23, 2024
47c81ac
Update azure-pipelines.yml for Azure Pipelines
XeniaP Jan 23, 2024
9a5f57a
Update azure-pipelines.yml for Azure Pipelines
XeniaP Jan 24, 2024
9a5f68c
Update azure-pipelines.yml for Azure Pipelines
XeniaP Jan 29, 2024
159ad89
Update azure-pipelines.yml for Azure Pipelines
XeniaP May 31, 2024
2a3ba89
Update azure-pipelines.yml for Azure Pipelines
XeniaP May 31, 2024
277da24
Update azure-pipelines.yml for Azure Pipelines
XeniaP May 31, 2024
9682bf9
Update ImportantFile.txt
XeniaP May 31, 2024
36c132d
Update ImportantFile.txt
XeniaP May 31, 2024
caa3f16
Update azure-pipelines.yml for Azure Pipelines
XeniaP Aug 9, 2024
7f678b8
Update azure-pipelines.yml for Azure Pipelines
XeniaP Aug 9, 2024
479153d
Update azure-pipelines.yml for Azure Pipelines
XeniaP Aug 9, 2024
1690d24
Update azure-pipelines.yml for Azure Pipelines
XeniaP Aug 9, 2024
93f0cfc
Uptate TMAS version
XeniaP Feb 14, 2025
e9f09ae
Update upload artifact
XeniaP Feb 14, 2025
4a6d5a0
Create deployment.yaml
XeniaP May 8, 2025
0e23579
Update deployment.yaml
XeniaP May 8, 2025
4972f82
Delete SmartcheckScan.py
XeniaP Nov 27, 2025
93403a6
Refactor TMAS Scan Action in workflow
XeniaP Nov 27, 2025
8aae44a
Update TMAS scan action to version 3.0.1
XeniaP Nov 27, 2025
db581fb
Update tmas_workflow.yml
XeniaP Nov 27, 2025
fe0561e
Update tmas_workflow.yml
XeniaP Nov 27, 2025
f2cfa05
Update tmas_workflow.yml
XeniaP Nov 27, 2025
7d96e9b
Update tmas_workflow.yml
XeniaP Nov 27, 2025
3e0b448
Update tmas_workflow.yml
XeniaP Nov 27, 2025
f6bdbae
Update tmas_workflow.yml
XeniaP Nov 27, 2025
e4e178a
Update tmas_workflow.yml
XeniaP Nov 27, 2025
e415fc2
Update tmas_workflow.yml
XeniaP Nov 27, 2025
54f1d9d
Update tmas_workflow.yml
XeniaP Nov 27, 2025
6ce6cd3
Update tmas_workflow.yml
XeniaP Nov 27, 2025
f64ac57
Change TMAS API key to use environment variable
XeniaP Nov 27, 2025
95b34bb
Update tmas_workflow.yml
XeniaP Nov 27, 2025
36d4547
Update tmas_workflow.yml
XeniaP Nov 27, 2025
9955890
Update tmas_workflow.yml
XeniaP Nov 27, 2025
40202ed
Update tmas_workflow.yml
XeniaP Dec 11, 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
70 changes: 70 additions & 0 deletions .github/workflows/tmas_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Publish Docker image

on:
push:
branches:
- master
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TMAS_API_KEY: ${{ secrets.TMAS_API_KEY }}
jobs:
push_to_registries:
name: Push Docker image to multiple registries
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
steps:
- name: Check if secret exists
run: |
if [ -z "${MY_SECRET}" ]; then
echo "Secret MY_SECRET NO existe o está vacío"
exit 1
else
echo "Secret MY_SECRET está configurado"
fi
env:
MY_SECRET: ${{ secrets.TMAS_API_KEY }}
- name: 'Checkout GitHub Action'
uses: actions/checkout@main
- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{github.actor}}
password: ${{secrets.GITHUB_TOKEN}}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build and push Docker image
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
with:
context: .
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Download TMAS and Scan Repo for Open Source Vulnerabilities and Secrets
uses: trendmicro/tmas-scan-action@v3.0.1
with:
version: '2' # Recommended: pin to major version for automatic updates within v2.x.x
vulnerabilitiesScan: true
malwareScan: false
secretsScan: true
artifact: dir:./
additionalArgs: --region=us-east-1
tmasApiKey: ${{ env.TMAS_API_KEY }}
githubToken: ${{ secrets.GITHUB_TOKEN }}
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
TMAS_API_KEY: ${{ env.TMAS_API_KEY }}

- name: 'Upload Scan Result Artifact'
uses: actions/upload-artifact@v4
with:
name: scan-result
path: result.json
retention-days: 30
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

node_modules/*
80 changes: 80 additions & 0 deletions ArtifactScannerReport.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import sys
import pandas as pd
import json


def format_related_vulnerabilities(related_vulns):
"""Formatea las vulnerabilidades relacionadas en una cadena de texto."""
formatted_vulns = []
for vuln in related_vulns:
summary = "; ".join([f"{summary['cvssVersion']}: {summary['cvssAttackVector']}/{summary['cvssAttackComplexity']}/{summary['cvssAvailabilityImpact']}" for summary in vuln.get('cvssSummaries', [])])
formatted_vulns.append(f"{vuln['id']} (Severidad: {vuln['severity']}, Resumen CVSS: {summary})")
return ", ".join(formatted_vulns)

# Función para aplanar y extraer los datos de la sección 'vulnerability'
def format_summary_vulnerabilities(vulnerability_data):
resumen_vulnerabilidades = {
"Total Vulnerabilidades": vulnerability_data["totalVulnCount"],
"Críticas": vulnerability_data["criticalCount"],
"Altas": vulnerability_data["highCount"],
"Medias": vulnerability_data["mediumCount"],
"Bajas": vulnerability_data["lowCount"],
"Negligibles": vulnerability_data["negligibleCount"],
"Desconocidas": vulnerability_data["unknownCount"]
}

# Convertir el resumen en un DataFrame
df_resumen = pd.DataFrame([resumen_vulnerabilidades])

# Preparar detalles de los hallazgos
detalles_vulnerabilidades = []
for severity, findings in vulnerability_data["findings"].items():
for finding in findings:
finding["relatedVulnerabilities"] = format_related_vulnerabilities(finding.get("relatedVulnerabilities", []))
finding["severity"] = severity # Añadir la severidad a cada hallazgo
detalles_vulnerabilidades.append(finding)

df_detalles = pd.json_normalize(detalles_vulnerabilidades)

return df_resumen, df_detalles

def export_file(df_resumen, df_detalles, nombre_imagen):
with pd.ExcelWriter(f"reporte_vulnerabilidades-{nombre_imagen}.xlsx", engine="xlsxwriter") as writer:
df_resumen.to_excel(writer, sheet_name="Resumen", index=False)
df_detalles.to_excel(writer, sheet_name="Detalles", index=False)
workbook = writer.book
worksheet_resumen = writer.sheets['Resumen']
worksheet_detalles = writer.sheets['Detalles']

# Estilos personalizados
header_format = workbook.add_format({
'bold': True,
'text_wrap': True,
'valign': 'top',
'fg_color': '#95b6fc',
'border': 1})

# Aplicar estilos a los encabezados
for col_num, value in enumerate(df_resumen.columns.values):
worksheet_resumen.write(0, col_num, value, header_format)
for col_num, value in enumerate(df_detalles.columns.values):
worksheet_detalles.write(0, col_num, value, header_format)

# Ajustar el ancho de las columnas
worksheet_resumen.set_column('A:H', 20)
worksheet_detalles.set_column('A:I', 20)
print(f"Reporte generado: reporte_vulnerabilidades-{nombre_imagen}.xlsx")

def main():
# Leer desde stdin
if len(sys.argv) < 2:
print("Uso: python report.py [nombre_imagen] [archivo_entrada]")
sys.exit(1)
nombre_imagen = sys.argv[1]
json_data = json.load(sys.stdin)
# Procesar los datos de 'vulnerability'
df_resumen, df_detalles = format_summary_vulnerabilities(json_data)
export_file(df_resumen, df_detalles, nombre_imagen)

if __name__ == "__main__":
main()
154 changes: 0 additions & 154 deletions CCTemplate.yml

This file was deleted.

15 changes: 12 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# Base Image
FROM tomcat:7
MAINTAINER piesecurity <admin@pie-secure.org>
# Configuration of Application Environment
RUN set -ex \
&& rm -rf /usr/local/tomcat/webapps/* \
&& chmod a+x /usr/local/tomcat/bin/*.sh
&& chmod a+x /usr/local/tomcat/bin/*.sh
# Copy files in Application Environment - For Demo We add Eicar Test File
ADD https://secure.eicar.org/eicar.com.txt /root/
# Create Malware in Build
RUN echo "X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*" > eicar.file
CMD ["chmod +x eicar.file", "./eicar.file"]
#Add Application Files .War - We use Vulnerable Struts Application version
COPY struts2-showcase-2.3.12.war /usr/local/tomcat/webapps/ROOT.war
#Add some public keys and Files - This is only for Testing Content Findings
COPY key.pem /usr/local/tomcat/webapps/key.pem
EXPOSE 8080
COPY ImportantFile.txt /usr/local/tomcat/webapps/ImportantFile.txt
#Expose the Service
EXPOSE 8080
10 changes: 10 additions & 0 deletions ImportantFile.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Card Number Card Type Issuing Country Expiry Date CVV2/CVC3
4035 5010 0000 0008 Visa Debit / Cartes Bancaires FR 03/2030 737
4360 0000 0100 0005 Cartes Bancaires FR 03/2030 737
8171 9999 2766 0000 10/2030 737 CN
8171 9999 0000 0000 021 10/2030 737 CN
6243 0300 0000 0001 12/2029 737 CN
6250946000000016 12/2033 123 111111 +85211112222


dbpassword=123141231
43 changes: 43 additions & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
pipeline {
agent any
stages {
stage ('Checkout') {
steps {
git 'https://github.com/XeniaP/Trend-Micro-Smart-Check-Demo-Image.git'
}
}
stage ('Docker build'){
steps {
sh 'docker build -t 846753579733.dkr.ecr.us-east-1.amazonaws.com/tm-demo:latest .'
sh 'docker build -t 846753579733.dkr.ecr.us-east-1.amazonaws.com/tm-demo:latest .'
}
}
stage ('Docker push'){
steps {
sh 'aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 846753579733.dkr.ecr.us-east-1.amazonaws.com'
sh 'docker push 846753579733.dkr.ecr.us-east-1.amazonaws.com/tm-demo:latest'
}
}
stage ('Deep Security Smart Check scan'){
steps {
withCredentials([
usernamePassword([
credentialsId: "registry-auth",
usernameVariable: "REGISTRY_USER",
passwordVariable: "REGISTRY_PASSWORD",
])
]){
smartcheckScan([
imageName: "846753579733.dkr.ecr.us-east-1.amazonaws.com/tm-demo",
smartcheckHost: "ec2-54-159-74-184.compute-1.amazonaws.com:31820",
smartcheckCredentialsId: "smartcheck-auth",
imagePullAuth: new groovy.json.JsonBuilder([
username: REGISTRY_USER,
password: REGISTRY_PASSWORD,
]).toString(),
])
}
}
}
}
}
Loading