SocialGouv / sre-tools

https://socialgouv.github.io/sre-tools/
1 stars 1 forks source link

fix(webseal): paste with multilines #131

Closed revolunet closed 1 year ago

revolunet commented 1 year ago

Use yaml-js to parse pasted string and handle multiline variables correcly

add tests

gitguardian[bot] commented 1 year ago

⚠️ GitGuardian has uncovered 3 secrets following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secrets in your pull request
| GitGuardian id | Secret | Commit | Filename | | | -------------- | ------------------------- | ---------------- | --------------- | -------------------- | | [6670687](https://dashboard.gitguardian.com/incidents/6670687?occurrence=94807135) | RSA Private Key | a0b2ac9d776f7c6f324ee63b3abd607cce708f95 | packages/webseal/src/yamlToEnv.test.js | [View secret](https://github.com/SocialGouv/sre-tools/commit/a0b2ac9d776f7c6f324ee63b3abd607cce708f95#diff-31792caadd228378919e29d7dfbdc8e2dd029eb4c366f6344b40245aaa5311ceR38) | | [6670687](https://dashboard.gitguardian.com/incidents/6670687?occurrence=94807136) | RSA Private Key | a0b2ac9d776f7c6f324ee63b3abd607cce708f95 | packages/webseal/src/__snapshots__/yamlToEnv.test.js.snap | [View secret](https://github.com/SocialGouv/sre-tools/commit/a0b2ac9d776f7c6f324ee63b3abd607cce708f95#diff-a66fc0b867c3decdb80c04684ae33c67e8b15fbfc81d799f2c7862870b1097ccR12) | | [6670688](https://dashboard.gitguardian.com/incidents/6670688?occurrence=94807137) | Generic High Entropy Secret | a0b2ac9d776f7c6f324ee63b3abd607cce708f95 | packages/webseal/src/yamlToEnv.test.js | [View secret](https://github.com/SocialGouv/sre-tools/commit/a0b2ac9d776f7c6f324ee63b3abd607cce708f95#diff-31792caadd228378919e29d7dfbdc8e2dd029eb4c366f6344b40245aaa5311ceR36) |
🛠 Guidelines to remediate hardcoded secrets
1. Understand the implications of revoking this secret by investigating where it is used in your code. 2. Replace and store your secrets safely. [Learn here](https://blog.gitguardian.com/secrets-api-management?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) the best practices. 3. Revoke and [rotate these secrets](https://docs.gitguardian.com/secrets-detection/detectors/specifics/private_key_rsa#revoke-the-secret?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). 4. If possible, [rewrite git history](https://blog.gitguardian.com/rewriting-git-history-cheatsheet?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment). Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data. To avoid such incidents in the future consider - following these [best practices](https://blog.gitguardian.com/secrets-api-management/?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) for managing and storing secrets including API keys and other credentials - install [secret detection on pre-commit](https://docs.gitguardian.com/ggshield-docs/integrations/git-hooks/pre-commit?utm_source=product&utm_medium=GitHub_checks&utm_campaign=check_run_comment) to catch secret before it leaves your machine and ease remediation.

🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

Our GitHub checks need improvements? Share your feedbacks!

socket-security[bot] commented 1 year ago

New dependency changes detected. Learn more about Socket for GitHub ↗︎


👍 No new dependency issues detected in pull request

Bot Commands

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

Ignoring: es5-ext@0.10.62

Pull request alert summary
Issue Status
Install scripts ✅ 0 issues
Native code ✅ 0 issues
Bin script shell injection ✅ 0 issues
Unresolved require ✅ 0 issues
Invalid package.json ✅ 0 issues
HTTP dependency ✅ 0 issues
Git dependency ✅ 0 issues
Potential typo squat ✅ 0 issues
Known Malware ✅ 0 issues
Telemetry ✅ 0 issues
Protestware/Troll package ✅ 0 issues

📊 Modified Dependency Overview:

➕ Added Package Capability Access +/- Transitive Count Publisher
jest-watch-typeahead@0.6.5 None +68 simenb
⬆️ Updated Package Version Diff Added Capability Access +/- Transitive Count Publisher
@socialgouv/kosko-charts@9.19.2 9.15.0...9.19.2 environment +20/-24 socialgroovybot
@socialgouv/aes-gcm-rsa-oaep@1.1.4 1.1.2...1.1.4 None +4/-4 socialgroovybot
react-feather@2.0.10 2.0.9...2.0.10 None +0/-0 carmelo
react-copy-to-clipboard@5.1.0 5.0.4...5.1.0 None +2/-2 nkbt
react-hook-form@7.43.9 7.12.2...7.43.9 None +0/-0 bluebill1049

🚮 Removed packages: typescript@4.3.5

revolunet commented 1 year ago

@SocketSecurity ignore es5-ext@0.10.62

codecov-commenter commented 1 year ago

Codecov Report

Patch and project coverage have no change.

Comparison is base (b13f46f) 84.37% compared to head (e86b50c) 84.37%.

:exclamation: Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #131 +/- ## ======================================= Coverage 84.37% 84.37% ======================================= Files 3 3 Lines 32 32 Branches 6 6 ======================================= Hits 27 27 Misses 4 4 Partials 1 1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

github-actions[bot] commented 1 year ago

:tada: This PR is included in version 1.15.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: