Skip to content

Remove secret keys from all documentation and code. #796

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

Closed
rohit-joy opened this issue Apr 25, 2025 · 4 comments
Closed

Remove secret keys from all documentation and code. #796

rohit-joy opened this issue Apr 25, 2025 · 4 comments
Assignees

Comments

@rohit-joy
Copy link

Some secret keys hardcoded were flagged in security scans. Please remove all of them.

Recommendations:

  1. In Tests, generate the keys at runtime.

  2. In Documentation, leave a small excerpt or placeholder indicating what key should go where.

  3. In product/service runtime, get the keys from a secret store. Kubernetes has drivers that can read and fill mount points inside of Pods with secrets from a secret store.

@excelsior
Copy link
Collaborator

@rohit-joy

I fixed most of the vulnerabilities, except these:

  • Row 7:
{
  "file"=>"C:/Users/Public/Fortify/SC/jobs/575d502a-25a0-466d-b5aa-62eca7607efa/work/Src/credentialregistry/Dockerfile copy",
  "start_line"=>26
}

There's no such file in the repository.

  • Rows 10 & 13:
Attackers can control the file system path argument to open() at jwt_encode.py line 9, which allows them to access or modify otherwise protected files.

The whole purpose of that script is to read a file from the path specified by the user and generate a token from it. The script can't be called from the outside and the file's content isn't exposed in any way.

What's the best way to fix it?

  • Row 11:
{
  "file"=>"C:/Users/Public/Fortify/SC/jobs/575d502a-25a0-466d-b5aa-62eca7607efa/work/Src/credentialregistry/db/seeds/envelope.json",
  "start_line"=>6
}

There's no such file in the repository anymore.

@excelsior excelsior self-assigned this Apr 25, 2025
@rohit-joy
Copy link
Author

rohit-joy commented Apr 26, 2025

Row 7: Ignore

Row 10 and 13: Move that into the markdown documentation instead of leaving it as a py file.

Row 11: Ignore

Thank you, @excelsior .

@excelsior
Copy link
Collaborator

@rohit-joy All the violations have been addressed and both repos contain the necessary changes.

@jeannekitchens
Copy link

@rohit-joy can this be closed? If not, identify all open items.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants