Skip to content

Commit fce6341

Browse files
authored
Merge pull request #249 from catenax-ng/feature/cmp-1135/security-requirements
Feature/cmp 1135/security requirements: Added CodeQL workflow
2 parents dee5cb5 + 021ec54 commit fce6341

File tree

5 files changed

+173
-146
lines changed

5 files changed

+173
-146
lines changed

.github/workflows/codeql.yaml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
#################################################################################
2+
# Tractus-X - Digital Product Passport Application
3+
#
4+
# Copyright (c) 2022, 2024 BASF SE, BMW AG, Henkel AG & Co. KGaA
5+
# Copyright (c) 2022, 2024 Contributors to the Eclipse Foundation
6+
#
7+
# See the NOTICE file(s) distributed with this work for additional
8+
# information regarding copyright ownership.
9+
#
10+
# This program and the accompanying materials are made available under the
11+
# terms of the Apache License, Version 2.0 which is available at
12+
# https://www.apache.org/licenses/LICENSE-2.0.
13+
#
14+
# Unless required by applicable law or agreed to in writing, software
15+
# distributed under the License is distributed on an "AS IS" BASIS
16+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
17+
# either express or implied. See the
18+
# License for the specific language govern in permissions and limitations
19+
# under the License.
20+
#
21+
# SPDX-License-Identifier: Apache-2.0
22+
#################################################################################
23+
24+
name: "CodeQL Code Analysis"
25+
26+
on:
27+
push:
28+
branches: ["main"]
29+
paths-ignore:
30+
- "**/*.md"
31+
- "**/*.txt"
32+
pull_request:
33+
# The branches below must be a subset of the branches above
34+
branches: ["main"]
35+
paths-ignore:
36+
- "**/*.md"
37+
- "**/*.txt"
38+
schedule:
39+
- cron: "0 0 * * 0"
40+
workflow_dispatch:
41+
42+
jobs:
43+
analyze:
44+
name: Analyze
45+
runs-on: ubuntu-latest
46+
timeout-minutes: 360
47+
permissions:
48+
actions: read
49+
contents: read
50+
security-events: write
51+
52+
strategy:
53+
fail-fast: false
54+
matrix:
55+
language: ["java"] # Define languages here
56+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
57+
# Use only 'java' to analyze code written in Java, Kotlin or both
58+
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
59+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
60+
61+
steps:
62+
- name: Checkout repository
63+
uses: actions/checkout@v4
64+
65+
- name: Setup JDK 21
66+
uses: ./.github/actions/setup-java
67+
68+
# Initializes the CodeQL tools for scanning.
69+
- name: Initialize CodeQL
70+
uses: github/codeql-action/init@v2
71+
with:
72+
languages: ${{ matrix.language }}
73+
# If you wish to specify custom queries, you can do so here or in a config file
74+
# By default, queries listed here will override any specified in a config file
75+
# Prefix the list here with "+" to use these queries and those in the config file
76+
77+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
78+
# Use +security-extended,security-and-quality for wider security and better code quality
79+
queries: +security-extended,security-and-quality
80+
81+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift)
82+
# Automates dependency installation for Python, Ruby, and JavaScript, optimizing the CodeQL analysis setup
83+
# If this step fails, then you should remove it and run the build manually (see below)
84+
85+
# - name: Autobuild
86+
#uses: github/codeql-action/autobuild@v2
87+
88+
# ℹ️ Command-line programs to run using the OS shell.
89+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
90+
91+
# If the Autobuild fails above, remove it and uncomment the following three lines modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance
92+
93+
- name: Build Package
94+
run: |
95+
cd dpp-backend/digitalproductpass
96+
mvn -B clean install --batch-mode -DskipTests
97+
98+
- name: Perform CodeQL Analysis
99+
uses: github/codeql-action/analyze@v3
100+

.github/workflows/eslint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,4 +56,4 @@ jobs:
5656
run: |
5757
cd dpp-frontend
5858
npx eslint .
59-
continue-on-error: false
59+
continue-on-error: false

.github/workflows/veracode-upload.yml

Lines changed: 0 additions & 73 deletions
This file was deleted.

0 commit comments

Comments
 (0)