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

refactor(cmd-api-server): clean up configuration parameters gitguardi… #2086

Closed
wants to merge 6 commits into from

Conversation

ruzell22
Copy link
Contributor

…an scanner test

test

Signed-off-by: ruzell22 [email protected]

@gitguardian
Copy link

gitguardian bot commented Jun 20, 2022

⚠️ GitGuardian has uncovered 2 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
- Generic Private Key b3fa477 examples/cactus-example-carbon-accounting-backend/example-config.json View secret
- RSA Private Key b3fa477 examples/cactus-example-carbon-accounting-backend/example-config.json View secret
🛠 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 the best practices.
  3. Revoke and rotate these secrets.
  4. If possible, rewrite git history. 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


🦉 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!

- name: GitGuardian scan
uses: GitGuardian/ggshield-action@master
with:
args: --show-secrets --exit-zero --all-policies --verbose
Copy link
Contributor

@petermetz petermetz Feb 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Idea 1

Suggested change
args: --show-secrets --exit-zero --all-policies --verbose
args: --show-secrets --exit-zero --all-policies --verbose --config-path ./gitguardian.yaml

Idea 2 (desperate option)

Try to rename the config file to have .yml extension instead of .yaml just to 100% match what their documentation says.

Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ruzell22 Final change request and sorry for spamming: Please break this into two pull requests where:

  1. First PR is just about adding the custom git guardian check of ours (e.g. the gitguardian workflow + the configuration file) - this PR must also address the change requests I just added related to the git guardian config files and workflow file
  2. Second PR is one that you mark as dependent on the first PR and it does the originally intended change which was to clean up the configuration parameters.

with:
fetch-depth: 0 # fetch all history so multiple commits can be scanned
env:
GITHUB_TOKEN: "87028c11-8bef-4bd6-b440-5d3851314ead"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ruzell22 Please remove this and make sure to invalidate your token because this one now has been exposed.

# - name: Login to DockerHub Registry
# run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: GitGuardian scan
uses: GitGuardian/ggshield-action@master
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ruzell22 Please pin to a specific version (whichever is latest right now is fine but it has to be a specific version such as v.3.2.1)

Comment on lines 37 to 38
GITGUARDIAN_API_KEY: bBae0Daed3c0dFD1dC624380aA3FEbBfddD06dCeB3Ca5c2dCADF661C42617Dc65298FcE
GITGUARDIAN_INSTANCE: 'https://api.gitguardian.com/'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ruzell22 Please double check if we need this (e.g. remove them and then see if the checking process still works or not). If it does work without these then they should be removed. If it does NOT work without these then we MUST:

  1. Invalidate this gitguardian API key before someone maliciously uses it
  2. Generate a new git guardian API key, send that to me in private and I'll make sure to add it as a git repo level environment secret.

ruzell22 added a commit to ruzell22/cactus that referenced this pull request Mar 13, 2023
related to hyperledger-cacti#720 and hyperledger-cacti#2086

This includes GitGuardian workflow + configuration file
To replace the original GitGuardian scanner so it will be configurable.

Signed-off-by: ruzell22 <[email protected]>
@petermetz
Copy link
Contributor

@ruzell22 Are you still working on this?

@ruzell22
Copy link
Contributor Author

Hello @petermetz , the clean up configuration part is fixed already. However, the gitguardian issue is yet to be resolved. The question has been posted at stackoverflow, thank you.

@ruzell22
Copy link
Contributor Author

Hello @petermetz , this draft PR relating to gitguardian can now be closed. Thank you.

@ruzell22 ruzell22 requested a review from petermetz August 29, 2023 07:52
@petermetz
Copy link
Contributor

Hello @petermetz , this draft PR relating to gitguardian can now be closed. Thank you.

@ruzell22 Got it, closing, thank you as well!

@petermetz petermetz closed this Aug 29, 2023
@petermetz petermetz deleted the haruharu720test branch August 29, 2023 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants