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

Request to host new JENKINS plugin #3828

Open
OlegGavri opened this issue Mar 19, 2024 · 29 comments
Open

Request to host new JENKINS plugin #3828

OlegGavri opened this issue Mar 19, 2024 · 29 comments
Labels
bot-check-complete Automated hosting checks passed hosting-request Request to host a component in jenkinsci needs-fix security-audit-done The hosting request code passed the security audit with success

Comments

@OlegGavri
Copy link

OlegGavri commented Mar 19, 2024

Repository URL

https://github.com/OlegGavri/gparms

New Repository Name

global-pipeline-parameters-plugin

Description

This plugin allow any Pipeline Jobs store and read values common for all jobs. This values will be shared between all jobs in Jenkins Instance.

GitHub users to have commit permission

@reffum

Jenkins project users to have release permission

reffum

Issue tracker

Jira

@OlegGavri OlegGavri added the hosting-request Request to host a component in jenkinsci label Mar 19, 2024
Copy link

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.

  • ⛔ Required: The origin repository 'https://github.com/OlegGavri/gparms.git' ends in .git, please remove this
  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Jira: reffum (reports are re-synced hourly, wait to re-check for a bit after logging in)
  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Artifactory: reffum (reports are re-synced hourly, wait to re-check for a bit after logging in)
  • ⛔ Required: Repository URL 'https://github.com/OlegGavri/gparms' is not a valid GitHub repository (check that you do not have .git at the end, GitHub API doesn't support this).
  • ⚠️ Warning: No pom.xml detected.

You can re-trigger a check by editing your hosting request or by commenting /hosting re-check

@jenkins-cert-app
Copy link
Collaborator

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 a Jenkins Security Scan was triggered on your repository.
It takes ~10 minutes to complete.

Commands

The bot will parse all comments, and it will check if any line start with a command.

Security team only:

  • /audit-ok => the audit is complete, the hosting can continue 🎉.
  • /audit-skip => the audit is not necessary, the hosting can continue 🎉.
  • /audit-findings => the audit reveals some issues that require corrections ✏️.

Anyone:

  • /request-security-scan => the findings from the Jenkins Security Scan were corrected, this command will re-scan your repository 🔍.
  • /audit-review => the findings from the audit were corrected, this command will ping the security team to review the findings 👀. It's only applicable when the previous audit required changes.

Only one command can be requested per comment.

(automatically generated message, version: 1.28.0)

@jenkins-cert-app jenkins-cert-app added the security-audit-todo The security team needs to audit the hosting request code label Mar 19, 2024
@jenkins-cert-app
Copy link
Collaborator

❌ Jenkins Security Scan failed.
The Security team was notified about this.

Copy link

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.

  • ⛔ Required: The parent pom version '4.76' should be at least '4.78' or higher.
  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Jira: reffum (reports are re-synced hourly, wait to re-check for a bit after logging in)
  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Artifactory: reffum (reports are re-synced hourly, wait to re-check for a bit after logging in)
  • ⛔ Required: The 'artifactId' from the pom.xml (gparams) is incorrect, it should be gparam ('New Repository Name' field with "-plugin" removed)

You can re-trigger a check by editing your hosting request or by commenting /hosting re-check

Copy link

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.

  • ⛔ Required: The parent pom version '4.76' should be at least '4.78' or higher.
  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Jira: reffum (reports are re-synced hourly, wait to re-check for a bit after logging in)
  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Artifactory: reffum (reports are re-synced hourly, wait to re-check for a bit after logging in)

You can re-trigger a check by editing your hosting request or by commenting /hosting re-check

Copy link

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.

  • ⛔ Required: The parent pom version '4.76' should be at least '4.78' or higher.

You can re-trigger a check by editing your hosting request or by commenting /hosting re-check

Copy link

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.

  • ⛔ Required: The parent pom version '4.76' should be at least '4.78' or higher.
  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Jira: @reffum (reports are re-synced hourly, wait to re-check for a bit after logging in)
  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Artifactory: @reffum (reports are re-synced hourly, wait to re-check for a bit after logging in)

You can re-trigger a check by editing your hosting request or by commenting /hosting re-check

Copy link

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.

  • ⛔ Required: The parent pom version '4.76' should be at least '4.78' or higher.
  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Jira: reffum (reports are re-synced hourly, wait to re-check for a bit after logging in)
  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Artifactory: reffum (reports are re-synced hourly, wait to re-check for a bit after logging in)

You can re-trigger a check by editing your hosting request or by commenting /hosting re-check

@Wadeck
Copy link
Contributor

Wadeck commented Mar 19, 2024

❌ Jenkins Security Scan failed.
The Security team was notified about this.

=>

[2024-03-19 12:58:04] [build-stdout] [2024-03-19 12:58:04] [autobuild] [ERROR] Failed to execute goal org.jenkins-ci.tools:maven-hpi-plugin:3.51:hpi (default-hpi) on project gparams: Missing /tmp/tmp.a3B2uGcvUx/git-clone/target/classes/index.jelly. Delete any from pom.xml and create src/main/resources/index.jelly:
[2024-03-19 12:58:04] [build-stdout] [2024-03-19 12:58:04] [autobuild] [ERROR]
[2024-03-19 12:58:04] [build-stdout] [2024-03-19 12:58:04] [autobuild] [ERROR] <div>
[2024-03-19 12:58:04] [build-stdout] [2024-03-19 12:58:04] [autobuild] [ERROR] The description here…
[2024-03-19 12:58:04] [build-stdout] [2024-03-19 12:58:04] [autobuild] [ERROR] </div>

In other words, the tooling expects you to have a src/main/resources/index.jelly with description about what your plugin is doing.

Copy link

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.

  • ⛔ Required: The parent pom version '4.76' should be at least '4.78' or higher.

You can re-trigger a check by editing your hosting request or by commenting /hosting re-check

@OlegGavri
Copy link
Author

/hosting re-check

Copy link

Hello from your friendly Jenkins Hosting Checker

It looks like you have everything in order for your hosting request. A member of the Jenkins hosting team will check over things that I am not able to check(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

@github-actions github-actions bot added bot-check-complete Automated hosting checks passed and removed needs-fix labels Mar 19, 2024
@OlegGavri
Copy link
Author

❌ Jenkins Security Scan failed.
The Security team was notified about this.

=>

[2024-03-19 12:58:04] [build-stdout] [2024-03-19 12:58:04] [autobuild] [ERROR] Failed to execute goal org.jenkins-ci.tools:maven-hpi-plugin:3.51:hpi (default-hpi) on project gparams: Missing /tmp/tmp.a3B2uGcvUx/git-clone/target/classes/index.jelly. Delete any from pom.xml and create src/main/resources/index.jelly:
[2024-03-19 12:58:04] [build-stdout] [2024-03-19 12:58:04] [autobuild] [ERROR]
[2024-03-19 12:58:04] [build-stdout] [2024-03-19 12:58:04] [autobuild] [ERROR]


[2024-03-19 12:58:04] [build-stdout] [2024-03-19 12:58:04] [autobuild] [ERROR] The description here…
[2024-03-19 12:58:04] [build-stdout] [2024-03-19 12:58:04] [autobuild] [ERROR]

In other words, the tooling expects you to have a src/main/resources/index.jelly with description about what your plugin is doing.

Fix it. Add index.jelly.

@NotMyFault
Copy link
Member

The plugin's functionality is already covered by the parameterized trigger plugin and by using shared pipelines.
The latter exists exactly for this reason.

@OlegGavri
Copy link
Author

The plugin's functionality is already covered by the parameterized trigger plugin and by using shared pipelines. The latter exists exactly for this reason.

Hello! Thank you for answer.
I know about this two possibilities. I also try to use it, but they did not suit in my case.
parameterized trigger run other job, but I don't need that. I need some values shared between some independent jobs and available to read/write in any time from any jobs.
Shared Pipelines seems to be better for this purpose. But I can't understand how I can write value at JENKINS Server machine when Job is running on other machine?
To be precisely, in my case jobs is running on some virtual machins, but the shared value must be stored in a specific file on JENKINS Servier file with specific path. I can't understand how I make it with Shared Library.
Thank you for answer.

@daniel-beck
Copy link
Contributor

This looks more like https://plugins.jenkins.io/metadata/ than the others suggested above. It looks like it does something novel (AFAICT) and potentially useful.

https://github.com/OlegGavri/gparms/blob/7e93fa1d6b00c088a7bc934ed6214f87ea085487/src/main/java/io/jenkins/plugins/GParamsReadStep.java#L71-L75 seems to implement path traversal (let name be ../config.xml), and makes the lookup path dependent on the working directory. It should involve the Jenkins home directory in the path, and require alphanumeric name up to a max length.

@daniel-beck daniel-beck added security-audit-needs-correction The security audit revealed issues that must be corrected from the hosting request and removed security-audit-todo The security team needs to audit the hosting request code labels Mar 19, 2024
@OlegGavri
Copy link
Author

This looks more like https://plugins.jenkins.io/metadata/ than the others suggested above. It looks like it does something novel (AFAICT) and potentially useful.

https://github.com/OlegGavri/gparms/blob/7e93fa1d6b00c088a7bc934ed6214f87ea085487/src/main/java/io/jenkins/plugins/GParamsReadStep.java#L71-L75 seems to implement path traversal (let name be ../config.xml), and makes the lookup path dependent on the working directory. It should involve the Jenkins home directory in the path, and require alphanumeric name up to a max length.

Thank you very much for your answer and for bug finding. I fix it.
Metadata is seem to be more appropriate. But in my case value should be "global", not associated with Jobs, project and build etc. And gparams is very easy to use.

@daniel-beck
Copy link
Contributor

Metadata is seem to be more appropriate. But in my case value should be "global", not associated with Jobs, project and build etc. And gparams is very easy to use.

To clarify, I'm not discouraging hosting of this plugin, just providing what I think is a better comparison. Metadata does something different, so there's a place for this plugin IMO.

@OlegGavri
Copy link
Author

https://github.com/OlegGavri/gparms/blob/7e93fa1d6b00c088a7bc934ed6214f87ea085487/src/main/java/io/jenkins/plugins/GParamsReadStep.java#L71-L75 seems to implement path traversal (let name be ../config.xml), and makes the lookup path dependent on the working directory. It should involve the Jenkins home directory in the path, and require alphanumeric name up to a max length.

I have fixed this path traversal vulnerability

Copy link

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.

  • ⛔ Required: The 'artifactId' from the pom.xml (gparams) is incorrect, it should be global-parameters ('New Repository Name' field with "-plugin" removed)

You can re-trigger a check by editing your hosting request or by commenting /hosting re-check

@github-actions github-actions bot added needs-fix and removed bot-check-complete Automated hosting checks passed labels Mar 23, 2024
Copy link

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.

  • ⛔ Required: The 'artifactId' from the pom.xml (gparams) is incorrect, it should be global-pipeline-parameters ('New Repository Name' field with "-plugin" removed)

You can re-trigger a check by editing your hosting request or by commenting /hosting re-check

@OlegGavri
Copy link
Author

/hosting re-check

@daniel-beck
Copy link
Contributor

I have fixed this path traversal vulnerability

Thanks. I recommend validation be done during execution. While I expect the constructor cannot be bypassed for a Pipeline step, I am not confident about that.

https://github.com/OlegGavri/gparms/blob/8a5af9e9ee2742150840e8215bf1392c2ffee25c/src/main/java/io/jenkins/plugins/Parameters.java#L7 is wrong as there may not be a system property, use Jenkins#getRootDir instead.

@OlegGavri
Copy link
Author

I have fixed this path traversal vulnerability

Thanks. I recommend validation be done during execution. While I expect the constructor cannot be bypassed for a Pipeline step, I am not confident about that.

https://github.com/OlegGavri/gparms/blob/8a5af9e9ee2742150840e8215bf1392c2ffee25c/src/main/java/io/jenkins/plugins/Parameters.java#L7 is wrong as there may not be a system property, use Jenkins#getRootDir instead.

Thanks. I fix your recommendations.

@OlegGavri
Copy link
Author

/hosting re-check

Copy link

Hello from your friendly Jenkins Hosting Checker

It looks like you have everything in order for your hosting request. A member of the Jenkins hosting team will check over things that I am not able to check(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

@github-actions github-actions bot added bot-check-complete Automated hosting checks passed and removed needs-fix labels Apr 13, 2024
@NotMyFault
Copy link
Member

/request-security-scan

@jenkins-cert-app jenkins-cert-app added security-audit-todo The security team needs to audit the hosting request code and removed security-audit-needs-correction The security audit revealed issues that must be corrected from the hosting request labels Apr 15, 2024
@jenkins-cert-app
Copy link
Collaborator

The Jenkins Security Scan did not find anything dangerous with your plugin, congratulations! 🎉


💡 The Security team recommends that you are setting up the scan in your repository by following our guide.

@jenkins-cert-app jenkins-cert-app added security-audit-done The hosting request code passed the security audit with success and removed security-audit-todo The security team needs to audit the hosting request code labels Apr 15, 2024
@NotMyFault
Copy link
Member

Hey, I took a brief look at your hosting request and have some feedback for you:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot-check-complete Automated hosting checks passed hosting-request Request to host a component in jenkinsci needs-fix security-audit-done The hosting request code passed the security audit with success
Projects
None yet
Development

No branches or pull requests

5 participants