pokt-network / pocket

Official implementation of the Pocket Network Protocol v1
https://pokt.network
MIT License
61 stars 33 forks source link

[Configs] Cleanup private keys and genesis file #827

Closed okdas closed 1 year ago

okdas commented 1 year ago

Description

A DNS resolution error was reported by @bryanchriswhite. I discovered that the service URL, in contrast to v0, was utilized as an endpoint for peer-to-peer (P2P) connections. This particular practice resulted in a certain level of confusion. The service URL, prefixed with the http:// scheme, was subsequently incorporated into the genesis file. This action, unfortunately, disrupted DNS resolution as http:// cannot constitute a segment of the DNS name.

As part of the troubleshooting process, I regenerated the private keys for the fishermen, ensuring they align with the existing pattern of addresses. The mentioned issue concerning the service URL is comprehensively documented in another ticket - #818.

Summary generated by Reviewpad on 15 Jun 23 23:47 UTC

This pull request includes changes to various files:

Issue

Fixes DNS resolution errors.

Type of change

Please mark the relevant option(s):

List of changes

Testing

Required Checklist

If Applicable Checklist

gitguardian[bot] commented 1 year ago

⚠️ GitGuardian has uncovered 13 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 | | | -------------- | ------------------------- | ---------------- | --------------- | -------------------- | | [5841025](https://dashboard.gitguardian.com/incidents/5841025?occurrence=98378340) | Generic High Entropy Secret | 293d887fdd4dfc021b2f1fc26bc60466a9a83aa4 | build/config/genesis.json | [View secret](https://github.com/pokt-network/pocket/commit/293d887fdd4dfc021b2f1fc26bc60466a9a83aa4#diff-aca7710ce5afb6e8a415e08c3bce60a875a3ade60fa02b71a2f21c4af32bcc94R1634) | | [5841025](https://dashboard.gitguardian.com/incidents/5841025?occurrence=98378341) | Generic High Entropy Secret | 293d887fdd4dfc021b2f1fc26bc60466a9a83aa4 | build/localnet/manifests/configs.yaml | [View secret](https://github.com/pokt-network/pocket/commit/293d887fdd4dfc021b2f1fc26bc60466a9a83aa4#diff-9ac2d201dbd0af77236ecc1987231640898e4a029fbf1ae34e4513e1a2a0102dR1793) | | [5841025](https://dashboard.gitguardian.com/incidents/5841025?occurrence=98387837) | Generic High Entropy Secret | a90ad69cb325271915a1f0f1caeb1e68194b6b42 | charts/pocket/templates/configmap-genesis.yaml | [View secret](https://github.com/pokt-network/pocket/commit/a90ad69cb325271915a1f0f1caeb1e68194b6b42#diff-33d68fb410c6b83957f59a2c6fcdc96d62a90d236e6a2a65bf24b205baa46f5dR1799) | | [6987427](https://dashboard.gitguardian.com/incidents/6987427?occurrence=98276873) | Generic High Entropy Secret | fdd901e71231f56012d2fc9bc9461f3d360cea67 | build/config/genesis.json | [View secret](https://github.com/pokt-network/pocket/commit/fdd901e71231f56012d2fc9bc9461f3d360cea67#diff-aca7710ce5afb6e8a415e08c3bce60a875a3ade60fa02b71a2f21c4af32bcc94L1768) | | [6987427](https://dashboard.gitguardian.com/incidents/6987427?occurrence=98276874) | Generic High Entropy Secret | b4121c81ccd70199b9a012e924798fb91c943349 | build/config/genesis.json | [View secret](https://github.com/pokt-network/pocket/commit/b4121c81ccd70199b9a012e924798fb91c943349#diff-aca7710ce5afb6e8a415e08c3bce60a875a3ade60fa02b71a2f21c4af32bcc94R1634) | | [6987427](https://dashboard.gitguardian.com/incidents/6987427?occurrence=98276875) | Generic High Entropy Secret | fdf52db77197465b840f52297e6549c30a1e3363 | build/config/genesis.json | [View secret](https://github.com/pokt-network/pocket/commit/fdf52db77197465b840f52297e6549c30a1e3363#diff-aca7710ce5afb6e8a415e08c3bce60a875a3ade60fa02b71a2f21c4af32bcc94R48) | | [6987427](https://dashboard.gitguardian.com/incidents/6987427?occurrence=98276876) | Generic High Entropy Secret | fdf52db77197465b840f52297e6549c30a1e3363 | build/config/genesis.json | [View secret](https://github.com/pokt-network/pocket/commit/fdf52db77197465b840f52297e6549c30a1e3363#diff-aca7710ce5afb6e8a415e08c3bce60a875a3ade60fa02b71a2f21c4af32bcc94L1634) | | [6987427](https://dashboard.gitguardian.com/incidents/6987427?occurrence=98276877) | Generic High Entropy Secret | fdd901e71231f56012d2fc9bc9461f3d360cea67 | test.json | [View secret](https://github.com/pokt-network/pocket/commit/fdd901e71231f56012d2fc9bc9461f3d360cea67#diff-ccabc787fb1dff12fcd2c75b9dfe064266f670317b1efd1072cb6508822c3782R1) | | [6987427](https://dashboard.gitguardian.com/incidents/6987427?occurrence=98276878) | Generic High Entropy Secret | fdd901e71231f56012d2fc9bc9461f3d360cea67 | build/config/genesis.json | [View secret](https://github.com/pokt-network/pocket/commit/fdd901e71231f56012d2fc9bc9461f3d360cea67#diff-aca7710ce5afb6e8a415e08c3bce60a875a3ade60fa02b71a2f21c4af32bcc94R1634) | | [6987427](https://dashboard.gitguardian.com/incidents/6987427?occurrence=98276879) | Generic High Entropy Secret | fdf52db77197465b840f52297e6549c30a1e3363 | test.json | [View secret](https://github.com/pokt-network/pocket/commit/fdf52db77197465b840f52297e6549c30a1e3363#diff-ccabc787fb1dff12fcd2c75b9dfe064266f670317b1efd1072cb6508822c3782L1) | | [6987427](https://dashboard.gitguardian.com/incidents/6987427?occurrence=98276880) | Generic High Entropy Secret | b4121c81ccd70199b9a012e924798fb91c943349 | build/config/genesis.json | [View secret](https://github.com/pokt-network/pocket/commit/b4121c81ccd70199b9a012e924798fb91c943349#diff-aca7710ce5afb6e8a415e08c3bce60a875a3ade60fa02b71a2f21c4af32bcc94L48) | | [6987427](https://dashboard.gitguardian.com/incidents/6987427?occurrence=98378338) | Generic High Entropy Secret | 293d887fdd4dfc021b2f1fc26bc60466a9a83aa4 | build/config/genesis.json | [View secret](https://github.com/pokt-network/pocket/commit/293d887fdd4dfc021b2f1fc26bc60466a9a83aa4#diff-aca7710ce5afb6e8a415e08c3bce60a875a3ade60fa02b71a2f21c4af32bcc94L1634) | | [6987427](https://dashboard.gitguardian.com/incidents/6987427?occurrence=98378339) | Generic High Entropy Secret | 293d887fdd4dfc021b2f1fc26bc60466a9a83aa4 | build/localnet/manifests/configs.yaml | [View secret](https://github.com/pokt-network/pocket/commit/293d887fdd4dfc021b2f1fc26bc60466a9a83aa4#diff-9ac2d201dbd0af77236ecc1987231640898e4a029fbf1ae34e4513e1a2a0102dL1793) |
🛠 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/generics/generic_high_entropy_secret#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!

codecov[bot] commented 1 year ago

Codecov Report

Patch and project coverage have no change.

Comparison is base (2074a1b) 31.52% compared to head (5fef2a6) 31.52%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #827 +/- ## ======================================= Coverage 31.52% 31.52% ======================================= Files 107 107 Lines 9034 9034 ======================================= Hits 2848 2848 Misses 5846 5846 Partials 340 340 ```

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

okdas commented 1 year ago

Why is this still a draft?

Wow, you're fast! My apologies – I pushed one more commit. :)

How do we test / validate?

What exactly are we aiming to validate? We no longer experience errors related to DNS resolutions (this location in the genesis file was the culprit). Considering I also altered the genesis file, I've ensured both k8s LocalNet and the docker-compose setup function correctly, and all tests pass. To be frank, I'm unsure what additional tests we should conduct here.

Once this is merged, I'll need to make minor adjustments to DevNet to also utilize the genesis file that we're now supplying with the helm chart (introduced in this PR).