Closed rbello closed 1 year ago
Security audit, information and commands
The security team is auditing all the hosting requests, to ensure a better security by default. This message informs you that the security team was notified about the request and will soon participate in this issue to assist. The team is usually starting by a quick superficial audit and if it's not sufficient, they are planning a deeper audit.
/audit-ok
=> the audit is complete, the hosting can continue :tada:./audit-skip
=> the audit is not necessary, the hosting can continue :tada:./audit-required
=> the superficial audit was not sufficient, a deeper look is necessary :mag:./audit-findings
=> the audit reveals some issues that require corrections :pencil2:./audit-review
=> the findings from the audits were corrected, this command will ping the security team to review the findings :eyes:.
It's only applicable when the previous audit required changes.(automatically generated message)
Hello from your friendly Jenkins Hosting Checker
It appears you have some issues with your hosting request. Please see the list below and correct all issues marked Required. Your hosting request will not be approved until these issues are corrected. Issues marked with Warning or Info are just recommendations and will not stall the hosting process.
<jenkins.version>2.346.1</jenkins.version>
to at least 2.361.4 in your pom.xml. Take a look at the baseline recommendations.You can re-trigger a check by editing your hosting request or by commenting /hosting re-check
/hosting re-check
Hello from your friendly Jenkins Hosting Checker
It appears you have some issues with your hosting request. Please see the list below and correct all issues marked Required. Your hosting request will not be approved until these issues are corrected. Issues marked with Warning or Info are just recommendations and will not stall the hosting process.
You can re-trigger a check by editing your hosting request or by commenting /hosting re-check
/hosting re-check
Hello from your friendly Jenkins Hosting Checker
It looks like you have everything in order for your hosting request. A human volunteer will check over things that I am not able to check for (code review, README content, etc) and process the request as quickly as possible. Thank you for your patience.
Hosting team members can host this request with /hosting host
We're doing a security audit on your plugin, tracked internally as JENSEC-1938.
Hello @Kevin-CB, I prepared a new branch where I updated the minimum Java version to 11 and the parent project version to 4.54 I don't want to merge it right now because you are auditing the main branch. But if you don't mind I can do the merge.
Hello @rbello, we’re able to perform a complete audit on your plugins, and here are our feedbacks:
We’re not sure projectKey
is sensitive or not (SonarQualityAuditActivityReporter.java#L25 & SonarQubeCheckPeriodicWork.java#L274), but if it’s, you should implements the Secret field: https://www.jenkins.io/doc/developer/security/secrets/
There are XSS vulnerabilities at BuildDashboard/main.jelly#L84 & BuildDashboard/main.jelly#L88 , you need to escape the variables application
and version
.
See: https://www.jenkins.io/doc/developer/security/xss-prevention/#escaping-and-localized-expressions
Another XSS with BuildDashboard/main.jelly, you need to restrict href protocol to only allow some predefined schemes (https / http) for example. (It's not exploitable since the button is hidden)
CSRFs at BuildApi.java#L47, RunApi.java#L47 & PluginManagementLink.java#L60-L91 . Recommendation: https://www.jenkins.io/doc/developer/security/form-validation/#protecting-from-csrf
Per Jenkins project guidelines, SSL/TLS validation must be enabled by default which is not the case here SonarQubeCheckPeriodicWork.java#L293-L294 . Reference: https://www.jenkins.io/doc/developer/security/misc/#dealing-with-ssltls-connection-issues
You’ve dependencies with known vulnerabilities:
I will let you correct the different findings and ping us when you are done or if you have questions.
/audit-findings
Thank you @Kevin-CB and the team for your very interesting feedback.
projectKey
sensitivity: I don't think this information can be considered sensitive. This is typically the artifactId
prefixed with the groupId
XSS vulnerabilities / passing values to JavaScript: ok, fixed using data-*
attributes
XSS vulnerabilities / restrict href protocol: ok, fixed in ArtifactReleaseActivity::isUrlPresent
CSRF / missing crumb:
SSL/TLS validation must be enabled by default: ok fixed, added parameter to enable insecure mode (false by default)
Dependencies with known vulnerabilities: all vulnerabilities come from the same dependency (org.sonarsource.sonarqube:sonar-ws
) but I use the latests version (9.8.0.63668)
/audit-review
Thank you for your reactivity and your corrections, I was able to double check and everything looks good now!
I have just two little comments:
XSS vulnerabilities / restrict href protocol: ok, fixed in ArtifactReleaseActivity::isUrlPresent
/audit-ok
Hey @rbello,
I have some general feedback for your hosting request:
<l:icon class="symbol-anySymbol plugin-ionicons-api icon-sm"/>
I recommend using <l:icon src="symbol-anySymbol plugin-ionicons-api" class="icon-sm"/>
. The latter adheres with the documentation how to apply a class to a symbol.<st:adjunct includes=path.to.your.js.file>
v5
to keep the dependabot noise low.Hi @NotMyFault,
Thank you for your reply.
Do you have some documentation about st:adjunct
?
I found this paragraph and some samples, but it seems that the includes
attribute should contains a kind of package identifier and not a file path ?
<st:adjunct includes="io.jenkins.plugins.prism"/>
<st:adjunct includes="io.jenkins.plugins.jquery3"/>
<st:adjunct includes="lib.form.select.select"/>
NB: in my javascript functions I have translated strings. Does adjunct is compatible with this ?
if (!confirm('${%confirm_delete_version}')) {
return false;
}
Do you have some documentation about st:adjunct ?
See here: https://www.jenkins.io/doc/developer/security/csp/#inline-javascript-blocks
Hi @NotMyFault,
adjunct
kotlin-stdlib-common
library because otherwise I encounter a validation problem:[ERROR] Rule 5: org.apache.maven.plugins.enforcer.RequireUpperBoundDeps failed with message:
Failed while enforcing RequireUpperBoundDeps. The error(s) are [
Require upper bound dependencies error for org.jetbrains.kotlin:kotlin-stdlib-common:1.5.31 paths to dependency are:
+-io.jenkins.plugins:devops-portal:1.0
+-org.sonarsource.sonarqube:sonar-ws:9.8.0.63668
+-com.squareup.okhttp3:okhttp:4.10.0
+-com.squareup.okio:okio-jvm:3.0.0
+-org.jetbrains.kotlin:kotlin-stdlib-common:1.5.31
and
+-io.jenkins.plugins:devops-portal:1.0
+-org.sonarsource.sonarqube:sonar-ws:9.8.0.63668
+-com.squareup.okhttp3:okhttp:4.10.0
+-org.jetbrains.kotlin:kotlin-stdlib:1.6.20
+-org.jetbrains.kotlin:kotlin-stdlib-common:1.6.20
]
There are one recomment that I plan to implement in a future version if you agree:
<l:icon>
because I have many references to modify
- I have to keep the import of the
kotlin-stdlib-common
library because otherwise I encounter a validation problem:
If you just need the kotlin library to satisfy enforcer and don't depend on it, you may exclude it:
diff --git a/pom.xml b/pom.xml
index f2d3f11..6eccf09 100644
--- a/pom.xml
+++ b/pom.xml
@@ -113,15 +113,16 @@
<artifactId>apache-httpcomponents-client-4-api</artifactId>
</dependency>
<!-- Sonar Connector -->
- <dependency>
- <groupId>org.jetbrains.kotlin</groupId>
- <artifactId>kotlin-stdlib-common</artifactId>
- <version>1.8.0</version>
- </dependency>
<dependency>
<groupId>org.sonarsource.sonarqube</groupId>
<artifactId>sonar-ws</artifactId>
<version>9.8.0.63668</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jetbrains.kotlin</groupId>
+ <artifactId>kotlin-stdlib-common</artifactId>
+ </exclusion>
+ </exclusions>
</dependency>
</dependencies>
There are one recomment that I plan to implement in a future version if you agree:
Fine with me, I just wrote it down to raise awareness.
Is the sonarqube dependency only needed for tests? If so, I would recommend declaring it that way because the hpi file sizes 10M, rather than ~300K without sonarqube.
Ok I have fixed the pom.xml
No it's not a test dependency unfortunately. I will consider getting rid of it later.
No it's not a test dependency unfortunately. I will consider getting rid of it later.
I see, thanks for considering. 10M to ~300K is a notable difference :)
1.0-SNAPSHOT
: https://github.com/rbello/jenkins-plugin-devops-portal/blob/c85e558e6d166c1ae1d4676338208417b4c486fa/pom.xml#L12
Typically, -SNAPSHOT
is removed during releases only. devops-portal-$NEXT_MINOR_VERSION
matching your artifact id.https://github.com/rbello/jenkins-plugin-devops-portal
to https://github.com/jenkinsci/devops-portal-plugin
in the readme because that's the new target location of the repository.@NotMyFault Done
/hosting host
Hosting request complete, the code has been forked into the jenkinsci project on GitHub as https://github.com/jenkinsci/devops-portal-plugin
GitHub issues has been selected for issue tracking and was enabled for the forked repo.
A pull request has been created against the repository permissions updater to setup release permissions. Additional users can be added by modifying the created file.
Please delete your original repository (if there are no other forks), under 'Danger Zone', so that the jenkinsci organization repository is the definitive source for the code. If there are other forks, please contact GitHub support to make the jenkinsci repo the root of the fork network (mention that Jenkins approval was given in support request 569994). Also, please make sure you properly follow the documentation on documenting your plugin so that your plugin is correctly documented.
You will also need to do the following in order to push changes and release your plugin:
In order for your plugin to be built by the Jenkins CI Infrastructure and check pull requests, please add a Jenkinsfile to the root of your repository with the following content:
buildPlugin(useContainerAgent: true, jdkVersions: [8, 11])
Welcome aboard!
Repository URL
https://github.com/rbello/jenkins-plugin-devops-portal
New Repository Name
devops-portal-plugin
Description
Bring together all the information about the build and run of your applications into a single dashboard.
GitHub users to have commit permission
@rbello
Jenkins project users to have release permission
rbello
Issue tracker
GitHub issues