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

[EVM-370] Added --insecure flag to both ibft and polybft #1182

Merged

Conversation

ZeljkoBenovic
Copy link
Contributor

Description

When initializing the chain and using a local storage, private keys are stored as a plaintext format by default, in a local folder the operator has defined during the secrets init or polybft-secrets init stage.

This PR adds the --insecure flag as mandatory in order to store private keys unencrypted.
If the operator tries to run secrets init or polybft-secrets init command without --insecure flag, the error use a secrets backend, or supply an --insecure flag... will be presented.
When --insecure flag is used for storing the secrets locally, the following warning will be presented:
[WARNING: INSECURE LOCAL SECRETS - SHOULD NOT BE RUN IN PRODUCTION]
as storing secrets using this method, presents a high security risk and should not be used in production environments.

Changes include

  • Bugfix (non-breaking change that solves an issue)
  • Hotfix (change that solves an urgent issue, and requires immediate attention)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (change that is not backwards-compatible and/or changes current functionality)

Checklist

  • I have assigned this PR to myself
  • I have added at least 1 reviewer
  • I have added the relevant labels
  • I have updated the official documentation
  • I have added sufficient documentation in code

Testing

  • I have tested this code with the official test suite
  • I have tested this code manually

Manual tests

Run secrets init --data-dir <folder> or polybft-secrets init --data-dir <folder>- it should fail with an error use a secrets backend, or supply an --insecure flag....
Run secrets init --data-dir <folder> --insecure or polybft-secrets init --data-dir <folder> --insecure- it should succeed with a warning [WARNING: INSECURE LOCAL SECRETS - SHOULD NOT BE RUN IN PRODUCTION]

Additional comments

Fixes EVM-370
Fixes EDGE-1024

@ZeljkoBenovic ZeljkoBenovic added the feature New update to Polygon Edge label Jan 31, 2023
@ZeljkoBenovic ZeljkoBenovic self-assigned this Jan 31, 2023
Copy link
Collaborator

@Stefan-Ethernal Stefan-Ethernal left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented Jan 31, 2023

Codecov Report

Merging #1182 (18af72b) into feature/v3-parity (576f435) will decrease coverage by 0.04%.
The diff coverage is n/a.

@@                  Coverage Diff                  @@
##           feature/v3-parity    #1182      +/-   ##
=====================================================
- Coverage              54.84%   54.80%   -0.04%     
=====================================================
  Files                    176      176              
  Lines                  23519    23519              
=====================================================
- Hits                   12898    12889       -9     
- Misses                  9590     9598       +8     
- Partials                1031     1032       +1     
Impacted Files Coverage Δ
network/server_discovery.go 74.53% <0.00%> (-7.46%) ⬇️
syncer/client.go 63.20% <0.00%> (+1.41%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@ZeljkoBenovic ZeljkoBenovic merged commit a3558ba into feature/v3-parity Feb 2, 2023
@ZeljkoBenovic ZeljkoBenovic deleted the evm-370/v3-parity-insecure-local-secrets branch February 2, 2023 16:20
@github-actions github-actions bot locked and limited conversation to collaborators Feb 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature New update to Polygon Edge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants