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

Feature/alec 247 sonar security #94

Draft
wants to merge 48 commits into
base: develop
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
a19e0a6
enable sonar scan
BenjaminJ Nov 24, 2022
287bc65
enable sonar scan
BenjaminJ Nov 24, 2022
53bdadc
enable sonar scan
BenjaminJ Nov 24, 2022
1e3ec24
enable sonar scan
BenjaminJ Nov 24, 2022
dc2e126
enable sonar scan
BenjaminJ Nov 24, 2022
3fabbbb
enable sonar scan
BenjaminJ Nov 24, 2022
2fde86e
enable sonar scan
BenjaminJ Nov 24, 2022
162cf13
enable sonar scan
BenjaminJ Nov 24, 2022
0804974
set sonar.module to allow multi module scan
BenjaminJ Nov 28, 2022
4475aa3
Revert "comment other jobs to test sonar faster"
BenjaminJ Nov 28, 2022
980168e
compile and sonar scan same command line add projectKey into the pare…
BenjaminJ Nov 28, 2022
62767bd
comment
BenjaminJ Nov 28, 2022
aa84616
fix yaml
BenjaminJ Nov 28, 2022
33a7a5e
remove sonar token login
BenjaminJ Nov 28, 2022
08f7353
re enable build step
BenjaminJ Nov 28, 2022
673830e
add dependencu with sonar mvn command
BenjaminJ Nov 28, 2022
87554c4
add dependencu with sonar mvn command
BenjaminJ Nov 28, 2022
ee9e02c
skip test for sonar
BenjaminJ Nov 28, 2022
9e0576f
update projectkey
BenjaminJ Nov 28, 2022
77ba56a
use sonar.login
BenjaminJ Nov 28, 2022
b72ea46
use sonar.login
BenjaminJ Nov 28, 2022
55f5469
test sonar.sh from opennms project
BenjaminJ Nov 28, 2022
e6d7163
test sonar.sh from opennms project
BenjaminJ Nov 28, 2022
4a393f8
test sonar.sh from opennms project
BenjaminJ Nov 28, 2022
5e581a6
test sonar.sh from opennms project
BenjaminJ Nov 28, 2022
1aa4f60
test sonar without profile
BenjaminJ Nov 29, 2022
4c538a0
test sonar with SONARCLOUD_LOGIN
BenjaminJ Nov 29, 2022
d5cebbf
test sonar with SONARCLOUD_LOGIN
BenjaminJ Nov 29, 2022
39e4400
test sonar with SONARCLOUD_LOGIN
BenjaminJ Nov 29, 2022
b268a5b
add coverage
BenjaminJ Nov 29, 2022
6749e60
Fix getSituationStatusList (#88)
BenjaminJ Nov 25, 2022
3640d55
increase timeout from 30 seconds to 60 seconds (#89)
BenjaminJ Nov 25, 2022
ff36901
Feature/fix smoke test (#91)
BenjaminJ Nov 28, 2022
ae01d93
add security issue on purpose
BenjaminJ Nov 29, 2022
ac8f6ad
add security issue on purpose
BenjaminJ Nov 29, 2022
899a06f
Fix jacoco
BenjaminJ Nov 29, 2022
d38f7b8
revert sonar.login to circleci
BenjaminJ Nov 29, 2022
b788618
remove intentional vulnerabilities to test sonar
BenjaminJ Nov 29, 2022
b02fd73
cleanup
BenjaminJ Nov 29, 2022
6edcf29
cleanup
BenjaminJ Nov 29, 2022
a4ef1f5
cleanup
BenjaminJ Nov 29, 2022
03301ea
Add feedback and engine parameter to alec situations (#87)
BenjaminJ Nov 28, 2022
90354e9
comment configuration for maven-surefire-plugin
BenjaminJ Nov 29, 2022
443efcd
comment configuration for maven-surefire-plugin this cause the sonar …
BenjaminJ Nov 30, 2022
4a21599
Revert "Add feedback and engine parameter to alec situations (#87)"
BenjaminJ Nov 30, 2022
4954f40
Revert "Feature/fix smoke test (#91)"
BenjaminJ Nov 30, 2022
df5c127
Revert "increase timeout from 30 seconds to 60 seconds (#89)"
BenjaminJ Nov 30, 2022
9d0d711
Revert "Fix getSituationStatusList (#88)"
BenjaminJ Nov 30, 2022
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
18 changes: 18 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ workflows:
filters:
tags:
only: /.*/
- sonar:
context: "OpenNMS Build"
requires:
- build
filters:
tags:
only: /.*/
- build-docs:
context: "OpenNMS Build"
requires:
Expand Down Expand Up @@ -427,3 +434,14 @@ jobs:
name: Push packages to CloudSmith
command: .circleci/scripts/publish-cloudsmith.sh

sonar:
executor: build-executor
steps:
- attach_workspace:
at: ~/
- run:
name: Run SonarQube Code Analysis
when: always
command: |
mvn -Psonar,coverage -Dbuild.packages clean verify dependency:resolve-plugins dependency:go-offline \
sonar:sonar -Dsonar.login=$SONARCLOUD_LOGIN
63 changes: 59 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@
<json-simple.version>1.1.1</json-simple.version>
<httpclient-osgi.version>4.5.13</httpclient-osgi.version>
<httpcore-osgi.version>4.4.15</httpcore-osgi.version>
<sonarVersion>3.7.0.1746</sonarVersion>
<jacoco.version>0.8.8</jacoco.version>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -415,6 +417,16 @@
</instructions>
</configuration>
</plugin>
<plugin>
<groupId>org.sonarsource.scanner.maven</groupId>
<artifactId>sonar-maven-plugin</artifactId>
<version>${sonarVersion}</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
Expand Down Expand Up @@ -517,10 +529,11 @@
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<!-- see: https://stackoverflow.com/questions/53010200/maven-surefire-could-not-find-forkedbooter-class -->
<argLine>-Xmx1024m -Xms1024m -XX:MaxPermSize=512m -Djdk.net.URLClassPath.disableClassPathURLCheck=true</argLine>
</configuration>
<!-- this causes the sonar scan to fail-->

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just disable it in the sonar profile?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this affect sonar testing coverage ?

<!-- <configuration>-->
<!-- see: https://stackoverflow.com/questions/53010200/maven-surefire-could-not-find-forkedbooter-class -->
<!-- <argLine> -Xmx1024m -Xms1024m -XX:MaxPermSize=512m -Djdk.net.URLClassPath.disableClassPathURLCheck=true</argLine>-->
<!-- </configuration>-->
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -594,5 +607,47 @@
<additionalparam>-Xdoclint:none</additionalparam>
</properties>
</profile>
<profile>
<id>sonar</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
<sonar.organization>opennms</sonar.organization>
<sonar.projectKey>OpenNMS_alec</sonar.projectKey>
<sonar.moduleKey>${project.artifactId}</sonar.moduleKey>
</properties>
</profile>
<profile>
<id>coverage</id>
<build>
<plugins>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<goals>
<goal>report</goal>
</goals>
<configuration>
<formats>
<format>XML</format>
</formats>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>