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

Wiz Scanner Plugin #4265

Open
wiz-jenkins-deploy opened this issue Jan 16, 2025 · 14 comments
Open

Wiz Scanner Plugin #4265

wiz-jenkins-deploy opened this issue Jan 16, 2025 · 14 comments
Labels
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

@wiz-jenkins-deploy
Copy link

Repository URL

https://github.com/wiz-sec-public/wiz-scanner-plugin

New Repository Name

wiz-scanner-plugin

Description

This Jenkins plugin enables integrate Wiz CLI to detect sensitive data, secrets, misconfigurations, and vulnerabilities in container images, directories and IaC files.

GitHub users to have commit permission

@wiz-jenkins-deploy

Jenkins project users to have release permission

wizdeploy

Issue tracker

GitHub issues

@wiz-jenkins-deploy wiz-jenkins-deploy added the hosting-request Request to host a component in jenkinsci label Jan 16, 2025
@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.32.13)

@jenkins-cert-app jenkins-cert-app added the security-audit-todo The security team needs to audit the hosting request code label Jan 16, 2025
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.

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

@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 Jan 16, 2025
@mawinter69
Copy link
Contributor

  • In WizCliDownloader practically all file handling will not work when the build is running on an agent. Look at FilePath.write() to write the downloaded things directly to the remote location.
  • You have several other places where you use workspace.getRemote(). Those places use it in the wrong way. You need to test this with a real agent that runs on a remote machine. What will not work is setting up an agent on the same machine so that the controller process has write access to agents root directory.
  • https://github.com/wiz-sec-public/wiz-scanner-plugin/blob/c8ff129391d389772f46952f98fab624b6196800/src/main/java/io/jenkins/plugins/wiz/WizScannerAction.java#L21 You store the run in the action twice once in line 21 and one in line 24. You should only use the one in line 21 as the build object shouldn't be persisted. The run is injected when reloading it from disk.
  • As you do calls to external urls you will need to implement proxy handling, ideally via ProxyConfiguration
  • With dark-mode plugin in use the action becomes unusable
  • Take a look at the design-library this should allow to create a UI that is in sync with other pages in Jenkins, e.g. use jenkins-table , see also the pages for colors, spacing, symbols
  • save the svg here to the file resources/images/symbolswiz.svg. Then you can use it with <l:icon src="symbol-wiz plugin-wizscanner" class="icon-md"/>. You can then also remove the png and use the svg for the action here by using symbol-wiz plugin-wizscanner (one thing due to a bug in Jenkins that was only fixed in a newer release than what you define, the color of the svg is broken, can be fixed by putting adding fill="#0254ec" to the svg root element and removing the style definition and the class attribute)
  • You could remove the inline svgs by using symbols as explained here . You can use the ionicons symbols.
  • The pom is a mess right now will provide more at a later point in time

@mawinter69
Copy link
Contributor

Took your action and tweaked it a bit. How about this:

Image
Probably it is better to remove those colored bubbles with the severity, as it only duplicates the header

@mawinter69
Copy link
Contributor

@eliorpaz
Copy link

/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 dependency org.bouncycastle:bcutil-jdk18on should be replaced with a dependency to the api plugin org.jenkins-ci.plugins:bouncycastle-api
  • ⛔ Required: The dependency org.bouncycastle:bcprov-jdk18on should be replaced with a dependency to the api plugin org.jenkins-ci.plugins:bouncycastle-api
  • ⛔ Required: The dependency org.bouncycastle:bcpkix-jdk18on should be replaced with a dependency to the api plugin org.jenkins-ci.plugins:bouncycastle-api

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

@eliorpaz
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 dependency org.bouncycastle:bcutil-jdk18on should be replaced with a dependency to the api plugin org.jenkins-ci.plugins:bouncycastle-api
  • ⛔ Required: The dependency org.bouncycastle:bcprov-jdk18on should be replaced with a dependency to the api plugin org.jenkins-ci.plugins:bouncycastle-api
  • ⛔ Required: The dependency org.bouncycastle:bcpkix-jdk18on should be replaced with a dependency to the api plugin org.jenkins-ci.plugins:bouncycastle-api

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

Thank you for the feedback. I am actively working on replacing the Bouncycastle dependencies with the Jenkins API plugin. However, I'm encountering some implementation challenges with this transition. Could you please provide guidance on the recommended way to replace direct Bouncycastle usage with the bouncycastle-api plugin's functionality? Specifically, what is the proper way to access Bouncycastle features through the Jenkins plugin API?

Looking forward to your suggestions.

@mawinter69

@mawinter69
Copy link
Contributor

mawinter69 commented Jan 23, 2025

@mawinter69
Copy link
Contributor

@mawinter69
Copy link
Contributor

@mawinter69
Copy link
Contributor

@mawinter69
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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

4 participants