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

Appknox Scanner #3984

Closed
ginilpg opened this issue Jun 28, 2024 · 59 comments
Closed

Appknox Scanner #3984

ginilpg opened this issue Jun 28, 2024 · 59 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

@ginilpg
Copy link

ginilpg commented Jun 28, 2024

Repository URL

https://github.com/appknox/appknox-jenkins-plugin

New Repository Name

appknox-scanner-plugin

Description

This plugin enables automatic security testing for Android and iOS mobile applications using the Appknox vulnerability scanner engine. Designed specifically for mobile development teams, Appknox offers comprehensive, automated mobile app security testing. It seamlessly integrates static, dynamic, and api assessments into the development pipeline, optimized for Jenkins.

GitHub users to have commit permission

@ginilpg

Jenkins project users to have release permission

ginilpg

Issue tracker

Github Issues

@ginilpg ginilpg added the hosting-request Request to host a component in jenkinsci label Jun 28, 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 28, 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: Your baseline specified does not meet the minimum Jenkins version required, please update <jenkins.version>2.414.3</jenkins.version> to at least 2.440.3 in your pom.xml. Take a look at the baseline recommendations.
  • ⛔ Required: The parent pom version '4.80' should be at least '4.82' or higher.
  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Jira: @ginilpg (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: @ginilpg (reports are re-synced hourly, wait to re-check for a bit after logging in)
  • ⛔ Required: The 'name' field in the pom.xml should not contain "Jenkins"
  • ⛔ Required: The 'artifactId' from the pom.xml (appknox-jenkins-plugin) should not contain "Jenkins"
  • ⛔ Required: The 'artifactId' from the pom.xml (appknox-jenkins-plugin) is incorrect, it should be appknox-scanner ('New Repository Name' field with "-plugin" removed)
  • ⛔ Required: 'New Repository Name' must end with "-plugin" (disregard if you are not requesting hosting of a plugin)

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: Your baseline specified does not meet the minimum Jenkins version required, please update <jenkins.version>2.414.3</jenkins.version> to at least 2.440.3 in your pom.xml. Take a look at the baseline recommendations.
  • ⛔ Required: The parent pom version '4.80' should be at least '4.82' or higher.
  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Jira: @ginilpg (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: @ginilpg (reports are re-synced hourly, wait to re-check for a bit after logging in)
  • ⛔ Required: The 'name' field in the pom.xml should not contain "Jenkins"
  • ⛔ Required: The 'artifactId' from the pom.xml (appknox-jenkins-plugin) should not contain "Jenkins"
  • ⛔ Required: The 'artifactId' from the pom.xml (appknox-jenkins-plugin) is incorrect, it should be appknox-scanner ('New Repository Name' field with "-plugin" removed)
  • ⛔ Required: 'New Repository Name' must end with "-plugin" (disregard if you are not requesting hosting of a plugin)

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 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.

AppknoxPlugin.java#286
Potential CSRF vulnerability: If DescriptorImpl#doCheckRiskThreshold connects to user-specified URLs, modifies state, or is expensive to run, it should be annotated with @POST or @RequirePOST
AppknoxPlugin.java#279
Potential CSRF vulnerability: If DescriptorImpl#doCheckFilePath 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.

AppknoxPlugin.java#286
Potential missing permission check in DescriptorImpl#doCheckRiskThreshold
AppknoxPlugin.java#279
Potential missing permission check in DescriptorImpl#doCheckFilePath

@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 28, 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: Your baseline specified does not meet the minimum Jenkins version required, please update <jenkins.version>2.414.3</jenkins.version> to at least 2.440.3 in your pom.xml. Take a look at the baseline recommendations.
  • ⛔ Required: The parent pom version '4.80' should be at least '4.82' or higher.
  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Jira: @ginilpg (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: @ginilpg (reports are re-synced hourly, wait to re-check for a bit after logging in)
  • ⛔ Required: The 'name' field in the pom.xml should not contain "Jenkins"
  • ⛔ Required: The 'artifactId' from the pom.xml (appknox-jenkins-plugin) should not contain "Jenkins"
  • ⛔ Required: The 'artifactId' from the pom.xml (appknox-jenkins-plugin) is incorrect, it should be appknox-scanner ('New Repository Name' field with "-plugin" removed)
  • ⛔ Required: 'New Repository Name' must end with "-plugin" (disregard if you are not requesting hosting of a plugin)

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: Your baseline specified does not meet the minimum Jenkins version required, please update <jenkins.version>2.414.3</jenkins.version> to at least 2.440.3 in your pom.xml. Take a look at the baseline recommendations.
  • ⛔ Required: The parent pom version '4.80' should be at least '4.82' or higher.
  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Jira: ginilpg (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: ginilpg (reports are re-synced hourly, wait to re-check for a bit after logging in)
  • ⛔ Required: The 'name' field in the pom.xml should not contain "Jenkins"
  • ⛔ Required: The 'artifactId' from the pom.xml (appknox-jenkins-plugin) should not contain "Jenkins"
  • ⛔ Required: The 'artifactId' from the pom.xml (appknox-jenkins-plugin) is incorrect, it should be appknox-scanner ('New Repository Name' field with "-plugin" removed)
  • ⛔ Required: 'New Repository Name' must end with "-plugin" (disregard if you are not requesting hosting of a plugin)

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

Copy link

github-actions bot commented Jul 2, 2024

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: ginilpg (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: ginilpg (reports are re-synced hourly, wait to re-check for a bit after logging in)
  • ⛔ Required: The 'artifactId' from the pom.xml (appknox-security-scan-plugin) is incorrect, it should be appknox-scanner ('New Repository Name' field with "-plugin" removed)
  • ⛔ Required: 'New Repository Name' must end with "-plugin" (disregard if you are not requesting hosting of a plugin)

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

Copy link

github-actions bot commented Jul 2, 2024

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: ginilpg (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: ginilpg (reports are re-synced hourly, wait to re-check for a bit after logging in)
  • ⛔ Required: The 'artifactId' from the pom.xml (appknox-security-scan-plugin) is incorrect, it should be appknox-scanner ('New Repository Name' field with "-plugin" removed)

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

@ginilpg
Copy link
Author

ginilpg commented Jul 2, 2024

/hosting re-check

Copy link

github-actions bot commented Jul 2, 2024

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: ginilpg (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: ginilpg (reports are re-synced hourly, wait to re-check for a bit after logging in)
  • ⛔ Required: The 'artifactId' from the pom.xml (appknox-security-scan-plugin) is incorrect, it should be appknox-scanner ('New Repository Name' field with "-plugin" removed)

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

@ginilpg
Copy link
Author

ginilpg commented Jul 2, 2024

/hosting re-check

Copy link

github-actions bot commented Jul 2, 2024

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: ginilpg (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: ginilpg (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

github-actions bot commented Jul 2, 2024

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 Jul 2, 2024
@ginilpg
Copy link
Author

ginilpg commented Jul 8, 2024

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

The Jenkins Security Scan discovered 7 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.

AppknoxPlugin.java#456
Potential CSRF vulnerability: If DescriptorImpl#doCheckRiskThreshold connects to user-specified URLs, modifies state, or is expensive to run, it should be annotated with @POST or @RequirePOST
AppknoxPlugin.java#449
Potential CSRF vulnerability: If DescriptorImpl#doCheckFilePath connects to user-specified URLs, modifies state, or is expensive to run, it should be annotated with @POST or @RequirePOST
AppknoxPlugin.java#442
Potential CSRF vulnerability: If DescriptorImpl#doCheckCredentialsId connects to user-specified URLs, modifies state, or is expensive to run, it should be annotated with @POST or @RequirePOST
AppknoxPlugin.java#430
Potential CSRF vulnerability: If DescriptorImpl#doFillCredentialsIdItems 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.

AppknoxPlugin.java#456
Potential missing permission check in DescriptorImpl#doCheckRiskThreshold
AppknoxPlugin.java#449
Potential missing permission check in DescriptorImpl#doCheckFilePath
AppknoxPlugin.java#442
Potential missing permission check in DescriptorImpl#doCheckCredentialsId

@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 Jul 8, 2024
@ginilpg
Copy link
Author

ginilpg commented Jul 9, 2024

/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 Jul 9, 2024
@ginilpg
Copy link
Author

ginilpg commented Jul 9, 2024

/audit-review

@ginilpg
Copy link
Author

ginilpg commented Aug 28, 2024

/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

@ginilpg
Copy link
Author

ginilpg commented Aug 28, 2024

mawinter69

@daniel-beck Plugin has been tested with both the agent and controller. The plugin functions correctly in both scenarios

@ginilpg
Copy link
Author

ginilpg commented Aug 29, 2024

@daniel-beck @NotMyFault Could you please assist us with the further steps here?

@ginilpg
Copy link
Author

ginilpg commented Aug 29, 2024

/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 29, 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 29, 2024
@ginilpg
Copy link
Author

ginilpg commented Sep 4, 2024

/hosting re-check

Copy link

github-actions bot commented Sep 4, 2024

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

@ginilpg
Copy link
Author

ginilpg commented Sep 4, 2024

/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 Sep 4, 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 Sep 4, 2024
@ginilpg
Copy link
Author

ginilpg commented Sep 4, 2024

if this works then when the build is running on an agent

Doesn't look like it would.

Also https://javadoc.jenkins.io/hudson/Plugin.html exists, so AppknoxPlugin is a confusing class name for a build step.

@daniel-beck Class name has been changed to AppknoxScanner. Could you please check

@ginilpg
Copy link
Author

ginilpg commented Sep 13, 2024

@NotMyFault Can some one please help here to publish this plugin?

@ginilpg
Copy link
Author

ginilpg commented Sep 18, 2024

@alecharp @slide @NotMyFault @batmat @oleg-nenashev @timja Could someone please assist us with the next set of steps? This has been pending for over a month.

@timja
Copy link
Member

timja commented Sep 18, 2024

Hi

Apologies for the delay.


  1. Please update your documentation for pipeline to not use the step([$class... syntax, https://github.com/appknox/appknox-jenkins-plugin/blob/233e66f6b540ddcd83852fc263f70b1f1a8a5395/src/main/java/io/jenkins/plugins/AppknoxScanner.java#L26 should have a symbol and then the pipeline snipper generator should provide the syntax for the step called appKnoxScanner
  2. It doesn't seem good to hardcode the binary version of the scanner in the plugin, should users be able to override the default version? (a default would be fine)
  3. How did you test the plugin with an agent and a controller? If they were on the same machine it would probably still work, I would suggest testing with an agent either in a virtual machine or inside of docker. From my reading of the code I don't think it would work
  4. Description could probably be shortened in https://github.com/appknox/appknox-jenkins-plugin/blob/233e66f6b540ddcd83852fc263f70b1f1a8a5395/src/main/resources/index.jelly to drop "The Appknox Security Scan Plugin " as it will be displayed directly below Appknox Security Scanner
  5. You Jenkinsfile should be updated to work with the supported Java versions (the default will likely no longer work but hasn't been changed due to compatibility reasons) you should start with https://github.com/jenkinsci/archetypes/blob/master/common-files/Jenkinsfile

@mawinter69
Copy link
Contributor

@ginilpg
Copy link
Author

ginilpg commented Oct 7, 2024

Hi

Apologies for the delay.

  1. Please update your documentation for pipeline to not use the step([$class... syntax, https://github.com/appknox/appknox-jenkins-plugin/blob/233e66f6b540ddcd83852fc263f70b1f1a8a5395/src/main/java/io/jenkins/plugins/AppknoxScanner.java#L26 should have a symbol and then the pipeline snipper generator should provide the syntax for the step called appKnoxScanner
  2. It doesn't seem good to hardcode the binary version of the scanner in the plugin, should users be able to override the default version? (a default would be fine)
  3. How did you test the plugin with an agent and a controller? If they were on the same machine it would probably still work, I would suggest testing with an agent either in a virtual machine or inside of docker. From my reading of the code I don't think it would work
  4. Description could probably be shortened in https://github.com/appknox/appknox-jenkins-plugin/blob/233e66f6b540ddcd83852fc263f70b1f1a8a5395/src/main/resources/index.jelly to drop "The Appknox Security Scan Plugin " as it will be displayed directly below Appknox Security Scanner
  5. You Jenkinsfile should be updated to work with the supported Java versions (the default will likely no longer work but hasn't been changed due to compatibility reasons) you should start with https://github.com/jenkinsci/archetypes/blob/master/common-files/Jenkinsfile

All the above mentioned points has been addressed. Please review it. @timja

@ginilpg
Copy link
Author

ginilpg commented Oct 7, 2024

@mawinter69 All the above mentioned points has been addressed. Please review it.

@timja
Copy link
Member

timja commented Oct 8, 2024

Description in index.jelly could still be improved but not a blocker
https://github.com/appknox/appknox-jenkins-plugin/blob/main/src/main/resources/index.jelly

@timja
Copy link
Member

timja commented Oct 8, 2024

/hosting host

@jenkins-infra-bot
Copy link
Contributor

Hosting request complete, the code has been forked into the jenkinsci project on GitHub as https://github.com/jenkinsci/appknox-scanner-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:

Welcome aboard!

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

8 participants