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

Infisical Plugin #3924

Closed
DanielHougaard opened this issue May 13, 2024 · 24 comments
Closed

Infisical Plugin #3924

DanielHougaard opened this issue May 13, 2024 · 24 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

@DanielHougaard
Copy link
Contributor

Repository URL

https://github.com/Infisical/infisical-jenkins

New Repository Name

infisical-plugin

Description

The Infisical Plugin is a native integration that links Infisical with Jenkins, without the need to use our CLI tool as a part of the freestyle Jenkins project.

The plugin pulls in secret values from Infisical and sets environment variables that can be used in the build step(s). The secret values are masked from the output.

The plugin takes use of Credentials to securely store the Infisical authentication credentials.

GitHub users to have commit permission

@DanielHougaard
@maidul98
@dangtony98
@vmatsiiako
@akhilmhdh

Jenkins project users to have release permission

danielhougaard

Issue tracker

Jira

@DanielHougaard DanielHougaard added the hosting-request Request to host a component in jenkinsci label May 13, 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.426.3 in your pom.xml. Take a look at the baseline recommendations.
  • ⛔ Required: The following usernames in 'Jenkins project users to have release permission' need to log into Jira: danielhougaard (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: danielhougaard (reports are re-synced hourly, wait to re-check for a bit after logging in)
  • ⛔ Required: The 'artifactId' from the pom.xml (infisical-jenkins) should not contain "Jenkins"
  • ⛔ Required: The 'artifactId' from the pom.xml (infisical-jenkins) is incorrect, it should be infisical ('New Repository Name' field with "-plugin" removed)

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

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

The Jenkins Security Scan discovered 5 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: Missing permission check on a form fill web method with credentials lookup

You can find detailed information about this finding here.

InfisicalConfiguration.java#140
doFillInfisicalCredentialIdItems should perform a permission check before calling #includeAs
doFillInfisicalCredentialIdItems should perform a permission check before calling #includeEmptyValue

Stapler: Missing POST/RequirePOST annotation

You can find detailed information about this finding here.

InfisicalConfiguration.java#140
Potential CSRF vulnerability: If DescriptorImpl#doFillInfisicalCredentialIdItems 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.

InfisicalConfiguration.java#140
Potential missing permission check in DescriptorImpl#doFillInfisicalCredentialIdItems

Jenkins: Plaintext password storage

You can find detailed information about this finding here.

InfisicalSecretValue.java#17
Field should be reviewed whether it stores a password and is serialized to disk: infisicalKey
SingleSecretResponse.java#7
Field should be reviewed whether it stores a password and is serialized to disk: secretKey

@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 May 13, 2024
@DanielHougaard
Copy link
Contributor Author

/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 'artifactId' from the pom.xml (infisical-plugin) is incorrect, it should be infisical ('New Repository Name' field with "-plugin" removed)

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

@DanielHougaard
Copy link
Contributor 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 May 13, 2024
@DanielHougaard
Copy link
Contributor Author

/audit-review

@DanielHougaard
Copy link
Contributor 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 May 13, 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 May 13, 2024
@DanielHougaard
Copy link
Contributor Author

DanielHougaard commented May 13, 2024

  • Docs (README) has been added to the repository.
  • A separate plugin for pipeline support will be raised once this plugin is released, as it will use this plugin as a dependency.
    • I've seen examples of other plugins doing this as well.

@mawinter69
Copy link
Contributor

  • Docs (README) has been added to the repository.

  • A separate plugin for pipeline support will be raised once this plugin is released, as it will use this plugin as a dependency.

    • I've seen examples of other plugins doing this as well.

Why a separate plugin? It is much more common to have the things for freestyle and pipeline in the same plugin. And wouldn't it be enough to give your buildwrapper and InfisicalSecret a @Symbol annotation on the Descriptor so you can use it in pipeline (just guessing here, never tried this myself for a buildwrapper)?

@DanielHougaard
Copy link
Contributor Author

Hi @mawinter69, thanks for the clarification. After taking a second look at the docs I totally agree that it would be senseless to create a separate plugin for pipeline support. I've updated the repo to support pipelines!

@DanielHougaard
Copy link
Contributor Author

@mawinter69 Just following up, did you get to take a look after my update from 2 days ago?

@mawinter69
Copy link
Contributor

one comment, maybe change the symbol from infisical to withInfisical, similar to e.g. withCredentials

Also if I need to configure infisical in each pipeline, that will cause a lot of duplicate work. Isn't it likely that almost all pipelines will use the same configuration and just need different secrets? So it might be good to provide one or more central configurations that can be reused.

And as it looks as if infisical is providing credentials, I wonder if there is a way to say something like

withCredentials([infisicalSecret(config: configID, path: '/', secretValues: [...]
)]) {
...
}

Just proposal I'm not using infisical (and most likely will never use it)

@DanielHougaard
Copy link
Contributor Author

Hi @mawinter69, I've updated the infisical symbol to withInfisical.

In regards to the config, it's likely that the environment slug and project slug are unique on a per-job basis.
We may release an update in the future, allowing for a more "global" config. For now we're looking to release with the current config implementation.

@DanielHougaard
Copy link
Contributor Author

Hi again @mawinter69, we're looking to get this done as soon as possible (ideally Monday in the coming week). If you could please let us know how we can proceed that would be great!

@mawinter69
Copy link
Contributor

I think you have everything to release for now. My suggestions can also be delivered later.

@DanielHougaard
Copy link
Contributor Author

@mawinter69 Awesome! Please let me know when everything is set up, and I’ll get started with the release:-)

@NotMyFault
Copy link
Member

Hey,

I took a brief look over your hosting request and have some feedback for you:

@DanielHougaard
Copy link
Contributor Author

Hi @NotMyFault, thank you for the feedback! I've implemented all your feedback in the repo.

I have one question/need for clarification:

https://github.com/Infisical/infisical-jenkins/blob/6709df615e40bb23c9667d78c6424b6d807a277a/pom.xml#L44 should always match your jenkins.version specified.

https://github.com/Infisical/infisical-jenkins/commit/de68abd6e4fc7f0898fb8c7a987371f8ac8d1d67

In the commit above I've updated the version as requested. Does it need to be an exact match? Or is it fine to end it with .x like I have in the commit above? Thanks!

@NotMyFault
Copy link
Member

Does it need to be an exact match? Or is it fine to end it with .x like I have in the commit above?

The .x is actually part of the artifact name, but the version itself should match your jenkins.version specified :)

@NotMyFault
Copy link
Member

/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/infisical-plugin

A Jira component named [infisical-plugin](https://issues.jenkins.io/issues/?jql=project+%3D+JENKINS+AND+component+%3D+ infisical-plugin)has also been created with danielhougaard as the default assignee for issues.

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

5 participants