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

Plugin hosting request for buildpulse-flaky-tests-plugin #3979

Open
siddhantdange opened this issue Jun 20, 2024 · 42 comments
Open

Plugin hosting request for buildpulse-flaky-tests-plugin #3979

siddhantdange opened this issue Jun 20, 2024 · 42 comments
Labels
bot-check-complete Automated hosting checks passed hosting-request Request to host a component in jenkinsci security-audit-done The hosting request code passed the security audit with success

Comments

@siddhantdange
Copy link

siddhantdange commented Jun 20, 2024

Repository URL

https://github.com/buildpulse/buildpulse-flaky-tests-plugin

New Repository Name

buildpulse-flaky-tests-plugin

Description

Our Jenkins plugin allows one to easily send test results to BuildPulse for CI analytics and flaky test detection.

GitHub users to have commit permission

@siddhantdange

Jenkins project users to have release permission

sidbuildpulse

Issue tracker

GitHub issues

@siddhantdange siddhantdange added the hosting-request Request to host a component in jenkinsci label Jun 20, 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 following usernames in 'Jenkins project users to have release permission' need to log into Jira: sidbuildpulse (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: sidbuildpulse (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

@siddhantdange
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 Jun 20, 2024
@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.6)

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

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

@Wadeck
Copy link
Contributor

Wadeck commented Jun 21, 2024

Hey @siddhantdange
I think the Security scan is failing because you do not include in the pom.xml the pluginRepository, leading to the failure to find maven-hpi-plugin:3.13 (available in the Jenkins repo)

    <pluginRepositories>
        <pluginRepository>
            <id>repo.jenkins-ci.org</id>
            <url>https://repo.jenkins-ci.org/public/</url>
        </pluginRepository>
    </pluginRepositories>

@siddhantdange
Copy link
Author

/request-security-scan

@jenkins-cert-app
Copy link
Collaborator

The Jenkins Security Scan discovered 4 finding(s) 🔍.

Please follow the instructions below for every identified issues:

  • Implement the recommended fix to address the issue.
  • If you think it's a false positive, suppress the warning directly within the code.
  • Alternative, you write an explanation here about why you think it's irrelevant. That will require a manual review, leading to a slower process.

After addressing the findings through one of the above methods:

  • If all modifications have been made to the code, please initiate a new security scan by triggering the /request-security-scan command.
  • If there are any unresolved findings (those not corrected or suppressed), request a review from the Jenkins security team by using the /audit-review command.

Stapler: Missing POST/RequirePOST annotation

You can find detailed information about this finding here.

BuildPulseCommand.java#60
Potential CSRF vulnerability: If BuildPulseCommand#downloadAndGetCommand connects to user-specified URLs, modifies state, or is expensive to run, it should be annotated with @POST or @RequirePOST

Stapler: Missing permission check

You can find detailed information about this finding here.

BuildPulseCommand.java#60
Potential missing permission check in BuildPulseCommand#downloadAndGetCommand

Jenkins: Plaintext password storage

You can find detailed information about this finding here.

BuildPulseStep.java#28
Field should be reviewed whether it stores a password and is serialized to disk: key
BuildPulseCommand.java#20
Field should be reviewed whether it stores a password and is serialized to disk: key

@jenkins-cert-app jenkins-cert-app 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 Jun 21, 2024
@siddhantdange
Copy link
Author

/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 Jun 21, 2024
@jenkins-cert-app
Copy link
Collaborator

The Jenkins Security Scan discovered 3 finding(s) 🔍.

Please follow the instructions below for every identified issues:

  • Implement the recommended fix to address the issue.
  • If you think it's a false positive, suppress the warning directly within the code.
  • Alternative, you write an explanation here about why you think it's irrelevant. That will require a manual review, leading to a slower process.

After addressing the findings through one of the above methods:

  • If all modifications have been made to the code, please initiate a new security scan by triggering the /request-security-scan command.
  • If there are any unresolved findings (those not corrected or suppressed), request a review from the Jenkins security team by using the /audit-review command.

Stapler: Missing POST/RequirePOST annotation

You can find detailed information about this finding here.

BuildPulseCommand.java#63
Potential CSRF vulnerability: If BuildPulseCommand#downloadAndGetCommand connects to user-specified URLs, modifies state, or is expensive to run, it should be annotated with @POST or @RequirePOST

Stapler: Missing permission check

You can find detailed information about this finding here.

BuildPulseCommand.java#63
Potential missing permission check in BuildPulseCommand#downloadAndGetCommand

Jenkins: Plaintext password storage

You can find detailed information about this finding here.

BuildPulseStep.java#28
Field should be reviewed whether it stores a password and is serialized to disk: keyId

@jenkins-cert-app jenkins-cert-app 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 Jun 21, 2024
@siddhantdange
Copy link
Author

/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 Jun 21, 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 Jun 21, 2024
@siddhantdange
Copy link
Author

siddhantdange commented Jun 27, 2024

@NotMyFault is there any further action needed?

@NotMyFault
Copy link
Member

I'll take a look later the week

@siddhantdange
Copy link
Author

siddhantdange commented Aug 13, 2024

@mawinter69 Addressed these comments and updated repository. The hardcoded url is for a required argument to the binary - the binary infers repository url from env vars for other CI providers, however, this does not apply here so we've filled in a dummy value (added comment for clarity).

@mawinter69
Copy link
Contributor

Some more things

  • the pom.xml has no parent: It should have something like:
<parent>
    <groupId>org.jenkins-ci.plugins</groupId>
    <artifactId>plugin</artifactId>
    <version>4.86</version>
    <relativePath/>
  </parent>

The missing pom is the reason why you have to define the dependencies in lines 55-72 and 122-139. You can just remove them.
This also allows you to remove the lines 160-182 and 27-28

  • https://github.com/buildpulse/buildpulse-jenkins-plugin/blob/b65c7234731072e025c5cb0ac2941e930d746495/pom.xml#L45 the artifactid should match the jenkins version so it should be 2.440.x
  • create a file src/main/resources/index.jelly with a description what the plugin does. This is what is shown in the Jenkins UI in the available plugins page
  • You might want to add a config.jelly for your BuildStep. With this file you allow your customers to use the snippet generator to generate the correct syntax for the step. Also add corresponding help files for each things that can be configured. This can be of great help when you have the help inline and don't need to first visit e.g. the plugin page or some other place.
  • The CODEOWNERS file should be * @jenkinsci/buildpulse-flaky-tests-plugin-developers

@siddhantdange
Copy link
Author

siddhantdange commented Aug 14, 2024

@mawinter69 Updated once more - will add the config.jelly as a part of a future update. By the way, I appreciate all the time you're spending here!

Also looks like when clicking on a plugin 'Available Plugins', it redirects me to the plugin documentation (plugin README)

@mawinter69
Copy link
Contributor

A few more things:

  • the CODEOWNERS file is .github/CODEOWNERS, so delete the one in the project root and update the one in .github
  • the urls in the pom.xml are wrong. You requested above buildpulse-flaky-tests-plugin so the urls in the pom should use that, what most people do is to write https://github.com/jenkinsci/${project.artifactId}-plugin , affected lines: 10, 30, 33 - 35
  • The version in line 90 is probably not needed as you get the version via the bom

@siddhantdange
Copy link
Author

@mawinter69 updated CODEOWNERS, pom.xml, and renamed the repository to buildpulse-flaky-tests-plugin

@mawinter69
Copy link
Contributor

The urls in line 33-35 are missing a / after the org

@siddhantdange
Copy link
Author

siddhantdange commented Aug 15, 2024

@NotMyFault @mawinter69 updated

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

@siddhantdange
Copy link
Author

siddhantdange commented Aug 19, 2024

@mawinter69 is this approved?

@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-done The hosting request code passed the security audit with success labels Aug 25, 2024
@jenkins-cert-app
Copy link
Collaborator

The Jenkins Security Scan discovered 2 finding(s) 🔍.

Please follow the instructions below for every identified issues:

  • Implement the recommended fix to address the issue.
  • If you think it's a false positive, suppress the warning directly within the code.
  • Alternative, you write an explanation here about why you think it's irrelevant. That will require a manual review, leading to a slower process.

After addressing the findings through one of the above methods:

  • If all modifications have been made to the code, please initiate a new security scan by triggering the /request-security-scan command.
  • If there are any unresolved findings (those not corrected or suppressed), request a review from the Jenkins security team by using the /audit-review command.

Jenkins: Plaintext password storage

You can find detailed information about this finding here.

BuildPulseStep.java#42
Field should be reviewed whether it stores a password and is serialized to disk: key
BuildPulseCommand.java#24
Field should be reviewed whether it stores a password and is serialized to disk: keyId

@jenkins-cert-app jenkins-cert-app 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 Aug 25, 2024
@siddhantdange
Copy link
Author

/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 Aug 27, 2024
@jenkins-cert-app
Copy link
Collaborator

The Jenkins Security Scan discovered 1 finding(s) 🔍.

Please follow the instructions below for every identified issues:

  • Implement the recommended fix to address the issue.
  • If you think it's a false positive, suppress the warning directly within the code.
  • Alternative, you write an explanation here about why you think it's irrelevant. That will require a manual review, leading to a slower process.

After addressing the findings through one of the above methods:

  • If all modifications have been made to the code, please initiate a new security scan by triggering the /request-security-scan command.
  • If there are any unresolved findings (those not corrected or suppressed), request a review from the Jenkins security team by using the /audit-review command.

Jenkins: Plaintext password storage

You can find detailed information about this finding here.

BuildPulseCommand.java#24
Field should be reviewed whether it stores a password and is serialized to disk: keyId

@jenkins-cert-app jenkins-cert-app 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 Aug 27, 2024
@siddhantdange
Copy link
Author

/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 Aug 28, 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 Aug 28, 2024
@siddhantdange
Copy link
Author

@NotMyFault keyId is never serialized to disk

@siddhantdange
Copy link
Author

@NotMyFault @mawinter69 Just wanted to bump this

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 security-audit-done The hosting request code passed the security audit with success
Projects
None yet
Development

No branches or pull requests

5 participants