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

Implemented Admin Password hashing using sha256 #9

Closed

Conversation

ukane-philemon
Copy link

@ukane-philemon ukane-philemon commented Dec 26, 2021

Per SEI CERT C Coding Standard, it is best practice not to store plain text passwords in memory or on disk. This was achieved by storing the sha256 hash of the admin pass, removing the provided password bytes from memory, and constant-time comparing the hashes of incoming passwords with the stored hash of the admin pass. For input on startup, the secure terminal is used to input the admin pass every start-up.

@ukane-philemon ukane-philemon force-pushed the HashAdminPassword branch 2 times, most recently from 72ec7e4 to cbbdedf Compare December 28, 2021 16:09
@ukane-philemon ukane-philemon force-pushed the HashAdminPassword branch 4 times, most recently from 9bdcee8 to 4079ab0 Compare January 14, 2022 14:13
jholdstock and others added 24 commits February 2, 2022 10:04
This allows both tspend and treasury policies to be set by clients on a per-ticket basis. Preferences can be set when initially registering a ticket with `/payfee`, and can be later updated using `/setvotechoices`.

Any requests which alter treasury/tspend policy will be stored in the database using the existing accountability system.

**Note:** This does not include consistency checking, it will need to be added later when dcrwallet has an RPC to retrieve policies in batches.
* This allow using error.Is and error.As within vsp.
* Add test cases for apiError type.
GitHub is now capable of rendering mermaid.js diagrams, so we don't need to maintain a separate source and rendered .png file. The mermaid source can be embedded directly into the documentation itself.
- Rather than manually downloading and invoking golangci-lint, use the GitHub
action provided by the developers.
- Configure golangci with a config file rather than passing command line args.
This enables the same config to be used locally and on CI without introducing
duplication. It also allows much more flexibililty in configuration than using
CLI args alone.
Ensure that Tickets loaded from the database are returned with empty maps instead of nil maps.

To be back-ported to 1.1.0 release.
Make the existing startup warning more obvious, and add a new one for when a pre-release version of vspd is used on mainnet.
- Ensure errors are properly wrapped with `%w`
- Error strings should not starts with caps.
- Add missing params to "Bad signature" error log
These messages should always be logged, even if log level is set to WARN or ERROR.
* Remove global cache variable.

Rather than maintaining cached data in a global variable, instantiate a cache struct and keep it in the `Server` struct.

* Store net params in RPC clients.

This means net params only need to be supplied once at startup, and also removes a global instance of net params in `background.go`.
CanTicketVote already has the full rawTx, so it doesn't need the hash passed in separately.
Running as sub-tests has the benefit of automatically logging the test name, no need to include it in failure messages manually. It even works if the test panics.
Theres no need to declare separate  vars for the testNode and then create it later, it can just be created up-front.
I assume "hist at max" is leftover from when it was possible to set more than one alt sign address.
`CanTicketVote` doesn't really fit into the RPC client code as it is more of a business logic function. Moving it into the webapi package is more appropriate.
No reason for this to be a standalone func with a param when it can be a method of VspDatabase. This will be useful later when VspDatabase contains its own logger.
We already have a file with hard-coded parameters for each Decred network, so having logic to figure out parameters later is unnecessary.
- Rename all instances to "shutdownCtx" to be really explicit. This context is special in that it can be closed at any time without warning, so it should be obvious to the reader.
- Don't use shutdownCtx in RPC clients. Clients should not stop working immediately when shutdown is signalled, they need to keep working while the process is shutting down.
Theres no reason for run() to return an error, it can simply return an exit code for the process.
@ukane-philemon ukane-philemon force-pushed the HashAdminPassword branch 2 times, most recently from 7548759 to 499d19a Compare June 10, 2022 19:09
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