嗨,我正在使用下面的gitlab yml文件来设置我的管道。该项目是一个maven Java项目。但我不能成功地完成所有的步骤。这是gitlab yml:
image: maven:3.5-jdk-8
variables:
MAVEN_CLI_OPTS: "-s .m2/settings.xml --batch-mode"
MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository"
include:
- template: Security/SAST.gitlab-ci.yml
cache:
paths:
- .m2/settings.xml
# Define stages
# Stages group various steps into one block,
# if any step fails, the entire stage fails
stages:
- validate
- compile
- SonarQube
- test
validate:
stage: validate
script:
- mvn validate
compile:
stage: compile
script:
- mvn $MAVEN_CLI_OPTS compile
sonarqube-check:
image: maven:3.6.3-jdk-11
stage: SonarQube
variables:
SONAR_USER_HOME: "${CI_PROJECT_DIR}/.sonar"
script:
- mvn sonar:sonar -Dsonar.projectKey=key -Dsonar.host.url=url -Dsonar.login=id
allow_failure: true
spotbugs-sast:
variables:
COMPILE: "false"
SECURE_LOG_LEVEL: "debug"
artifacts:
reports:
sast: gl-sast-report.json
#spotbugs-sast:
# variables:
# SECURE_LOG_LEVEL: "debug"
#FAIL_NEVER: 1
test:
image: maven:3.5-jdk-8
stage: test
script:
- mkdir -p /opt/path/conf/project/
- echo ${CI_PROJECT_DIR}
- cp "${CI_PROJECT_DIR}/project.properties" "/opt/path/conf/project/"
- mvn $MAVEN_CLI_OPTS test -B
但我在各个阶段都有错误:声纳,斑点虫,还有测试。
以下工件无法解决: webpay:webpay-client:jar:4.0.4,mpi强:mpiforced:jar:1.0.0,webpay:webpay-mpi:jar:4.3.9,webpay:matrix-mpi:jar:1.27.4,webpay:vbv-矩阵:jar:1.12.1,webpay:xercesImpl:jar:2.12.0,webpay:xss4j:jar:0.0.1,webpay:xmlParserAPI:jar:2.11.0,webpay:webpay-mpi-util:4.2.2
有人能帮我解决一下我的问题吗。提前谢谢。如果需要更多的信息,请告诉我。
发布于 2022-04-22 17:59:09
您可以尝试回到一个文档示例,并对其进行调整,使其变得像您的问题中的那个。
但是要注意:斑点虫-sast不会再分析Java了。
见GitLab 14.10 (2022年4月)
SAST中更快、更容易的Java扫描 GitLab静态应用程序安全测试(SAST)现在使用Semgrep扫描Go (在GitLab 14.4中引入)代码,建立在以前对Go (在GitLab 14.4中引入)和JavaScript、TypeScript和Python (在GitLab 13.12中引入)的支持的基础上。 基于Semgrep的分析器运行速度要比基于SpotBugs的现有分析器快7倍。它也不需要在扫描前编译您的代码,所以使用起来比SpotBugs简单得多。 静态分析和漏洞研究小组共同努力将规则转换为Semgrep格式,保存了大多数现有规则。在转换规则时,我们还更新、改进和测试了这些规则。 如果使用GitLab管理的SAST模板 (
SAST.gitlab-ci.yml
),则每当找到SAST.gitlab-ci.yml
代码时,Semgrep和SpotBugs都会运行。在GitLab终极版中,安全仪表板结合了两个分析器的发现,所以您不会看到重复的漏洞报告。 在GitLab 15.0中,作为我们宣布,我们将GitLab管理的SAST模板 (SAST.gitlab-ci.yml
)改为,只运行基于Semgrep的分析器for代码。基于SpotBugs的分析器仍将扫描其他JVM语言,如Groovy、Kotlin和Scala。 如果您有任何问题,反馈,或新的基于Semgrep的Java扫描的问题,请提出问题,我们将很高兴帮助。 见文档和问题。
GitLab 15.1 (2022年6月)增加了一些改进,这些改进可能会有所帮助:
静态分析分析器更新 GitLab静态分析包括GitLab静态分析团队积极管理、维护和更新的许多安全分析器。以下分析器更新是在15.1发布里程碑期间发布的。这些更新带来了额外的覆盖、错误修复和改进。
- Improve logging
- Use checked-out copy of the repository if `git fetch` fails
- Fall back to scanning the latest commit if automatic diff detection fails
- Update `gradle` and `grails` to support Java 17
- Set Java 17 as the system-wide default version
- Use ‘assemble’ task for Gradle projects, instead of ‘build’, to support custom `GRADLE_CLI_OPTS` (see [issue #299872](https://gitlab.com/gitlab-org/gitlab/-/issues/299872))
- Add additional detection rules
如果您是包括GitLab管理的SAST模板 (SAST.gitlab-ci.yml
),您不需要做任何事情来接收这些更新。但是,如果覆盖或自定义自己的CI/CD模板,则需要更新CI/CD配置。
若要保持在任何分析器的特定版本上,可以使用引脚到分析器的较小版本。固定到以前的版本会阻止您接收自动分析器更新,并要求您在CI/CD模板中手动插入分析器版本。
有关以前的更改,请参见上个月的最新消息。
https://stackoverflow.com/questions/70695454
复制相似问题