rpc: append rpcauth.py hash in config and show pass #27588

pull st3b1t wants to merge 15 commits into bitcoin:master from st3b1t:rpcauth-show-pass-writeless changing 33 files +208 −190
  1. st3b1t commented at 7:14 pm on May 6, 2023: none

    Small change improves security during the rpcauth directive generation procedure. In this way you can hang the configuration line directly inside the bitcoin.conf file and at the same time show the new password to the user, but without writing it to disk, the new beahvior:

    append generated hash in config:

    0rpcauth.py user >> bitcoin.conf
    

    show only in stderr without write clear password to disk:

    0Your password:
    1xxxxx...
    
  2. DrahtBot commented at 7:14 pm on May 6, 2023: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Reviews

    See the guideline for information on the review process. A summary of reviews will appear here.

  3. DrahtBot added the label RPC/REST/ZMQ on May 6, 2023
  4. DrahtBot added the label CI failed on May 6, 2023
  5. Aminkavoos approved
  6. brunoerg commented at 5:59 pm on May 7, 2023: contributor

    From CI:

     0102/264 - 
     1rpc_users.py
     2 failed, Duration: 1 s
     3stdout:
     42023-05-06T19:48:12.787000Z TestFramework (INFO): PRNG seed is: 4992424049312590578
     52023-05-06T19:48:12.806000Z TestFramework (INFO): Initializing test directory /tmp/cirrus-ci-build/ci/scratch/test_runner/test_runner_₿_🏃_20230506_193750/rpc_users_159
     62023-05-06T19:48:13.197000Z TestFramework (ERROR): Unexpected exception caught during testing
     7Traceback (most recent call last):
     8  File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 131, in main
     9    self.setup()
    10  File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 297, in setup
    11    self.setup_chain()
    12  File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/rpc_users.py", line 65, in setup_chain
    13    self.password = lines[3]
    14                    ~~~~~^^^
    15IndexError: list index out of range
    
  7. st3b1t commented at 4:57 pm on May 9, 2023: none

    From CI:

     0102/264 - 
     1rpc_users.py
     2 failed, Duration: 1 s
     3stdout:
     42023-05-06T19:48:12.787000Z TestFramework (INFO): PRNG seed is: 4992424049312590578
     52023-05-06T19:48:12.806000Z TestFramework (INFO): Initializing test directory /tmp/cirrus-ci-build/ci/scratch/test_runner/test_runner_₿_🏃_20230506_193750/rpc_users_159
     62023-05-06T19:48:13.197000Z TestFramework (ERROR): Unexpected exception caught during testing
     7Traceback (most recent call last):
     8  File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 131, in main
     9    self.setup()
    10  File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 297, in setup
    11    self.setup_chain()
    12  File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/rpc_users.py", line 65, in setup_chain
    13    self.password = lines[3]
    14                    ~~~~~^^^
    15IndexError: list index out of range
    

    many tnks @brunoerg I found the problem and I am trying run testing in local. Now is passed for me.

  8. maflcko commented at 6:21 pm on May 9, 2023: member
  9. DrahtBot removed the label CI failed on May 9, 2023
  10. st3b1t commented at 7:26 pm on May 9, 2023: none
  11. fanquake commented at 9:12 am on May 10, 2023: member
    @st3b1t note that you’ve left the commit messages from the squashed commits in e1046eca9d637dfd29599d156a57a8a3a7440b23.
  12. 5d8acbe55f
  13. p2p: Avoid prematurely clearing download state for other peers a7529015eb
  14. add ryanofsky to trusted-keys 8b36918c6e
  15. ci: Pass full env to CI pod to avoid missing a var
    Instead of enumerating each passed env var, just pass all. This avoids
    the risk of missing to enumerate one. Also, it is less code.
    
    The risk could be that an env var causes non-deterministic behavior, but
    this can be fixed by explicitly excluding it once the issue is known.
    
    Values with newlines can not be stored in the file and parsed by
    docker/podman, so they are excluded.
    da95630543
  16. ci: Move CI container kill out of 06_script_b.sh
    This cleans up 06_script_b.sh to only contain code to be executed inside
    the CI pod, which avoids confusion and is needed for the next commit.
    a238a16f39
  17. ci: Remove CI_EXEC bloat in test/06_script_b.sh 4a80a9cc60
  18. refactor: Use ChainType enum exhaustively
    This is a follow up of https://github.com/bitcoin/bitcoin/pull/27491,
    more concretely
    https://github.com/bitcoin/bitcoin/pull/27491#discussion_r1188847896,
    for not using default cases (as per the style guide), and
    https://github.com/bitcoin/bitcoin/pull/27491#discussion_r1188852707 and
    https://github.com/bitcoin/bitcoin/pull/27491#discussion_r1188851857 for
    avoiding dead code.
    
    Also change chain name to chain type in docstrings
    40fb31d808
  19. Add UniValue::find_value method 85a1b4686b
  20. scripted-diff: Use UniValue::find_value method
    -BEGIN VERIFY SCRIPT-
     sed --regexp-extended -i 's/find_value\(([^ ,]+), /\1.find_value(/g' $(git grep -l find_value)
    -END VERIFY SCRIPT-
    5a3201ad05
  21. Remove unused find_value global function 2708d31a65
  22. Fix clang-tidy performance-unnecessary-copy-initialization warnings 06ef37a141
  23. Temporarily work around gcc-13 warning bug in interfaces_tests
    This can be reverted once gcc excludes lambdas with decltype(auto)
    return type from its -Wdangling-reference analysis.
    a87739e2e7
  24. d0aaf068a1
  25. fix CI stderr rpc_users.py e9f45b06d9
  26. Merge branch 'master' into rpcauth-show-pass-writeless de2d81dbad
  27. DrahtBot added the label Needs rebase on May 12, 2023
  28. DrahtBot commented at 9:44 pm on May 12, 2023: contributor

    🐙 This pull request conflicts with the target branch and needs rebase.

  29. st3b1t closed this on May 12, 2023

  30. st3b1t deleted the branch on May 12, 2023
  31. bitcoin locked this on May 11, 2024

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-06-29 10:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me