Bitcoin Forum
November 18, 2024, 11:00:16 PM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: ACL for RPC? Any interest?  (Read 1203 times)
isis (OP)
Full Member
***
Offline Offline

Activity: 154
Merit: 102


View Profile
August 29, 2012, 05:18:29 PM
 #1

I've been taking a long close look at bitcoind especially now that the raw transactions API is in.
I'm considering implementing an access control list against the RPC functionality and was wondering if anyone else would be interested in a patch to support access control.

The purpose behind this would be to provide granular permissions based access to bitcoind rpc calls.  This would allow for instance an untrusted app to view your wallet but not be able to send or dump the keys etc.

Anyways I'm mostly posting this to gather interest, if there is sufficient interest I will go ahead and do it and release a patch when it's done.  So let me know what you think.

Interested in OpenPay?
https://github.com/openpay
Donate to show your appreciation and support the effort!

1LMDCSAwjhT2Vp1sSf62dybEYW3MYpsoZj

Pyramining Links - Help OpenPay and get a 10% bonus on your funds.
http://pyramining.com/referral/zre9ysgqt
http://pyramining.com/referral/ans9km72g
http://pyramining.com/referral/f3k4xebzp
http://pyramining.com/referral/nc3ag2sdb
maaku
Legendary
*
expert
Offline Offline

Activity: 905
Merit: 1012


View Profile
August 29, 2012, 05:25:48 PM
 #2

Yes, this would be useful for me.

I'm an independent developer working on bitcoin-core, making my living off community donations.
If you like my work, please consider donating yourself: 13snZ4ZyCzaL7358SmgvHGC9AxskqumNxP
Gavin Andresen
Legendary
*
qt
Offline Offline

Activity: 1652
Merit: 2301


Chief Scientist


View Profile WWW
August 29, 2012, 06:07:03 PM
 #3

If you do it, I'd suggest implementing it as a proxy that sits in front of bitcoind.

But before you do that, you should do some googling to see if somebody has already written a JSON-RPC-over-HTTP proxy that implements per-method access control.

How often do you get the chance to work on a potentially world-changing project?
isis (OP)
Full Member
***
Offline Offline

Activity: 154
Merit: 102


View Profile
August 29, 2012, 08:43:24 PM
 #4

If you do it, I'd suggest implementing it as a proxy that sits in front of bitcoind.

But before you do that, you should do some googling to see if somebody has already written a JSON-RPC-over-HTTP proxy that implements per-method access control.


I understand what you mean but the point was more or less to make bitcoind itself more secure since in many cases it's used as a server.

In my use case I'm using ONLY the raw transactions API, there really is no wallet to speak of, so it's no strictly necessary.  However I can see a use case where someone uses it to back an eWallet type service (probably is already being used this way), in this case it would be nice to restrict access to certain features so that only particular users or services could do certain functions.

Anyways just a thought.

Interested in OpenPay?
https://github.com/openpay
Donate to show your appreciation and support the effort!

1LMDCSAwjhT2Vp1sSf62dybEYW3MYpsoZj

Pyramining Links - Help OpenPay and get a 10% bonus on your funds.
http://pyramining.com/referral/zre9ysgqt
http://pyramining.com/referral/ans9km72g
http://pyramining.com/referral/f3k4xebzp
http://pyramining.com/referral/nc3ag2sdb
markm
Legendary
*
Offline Offline

Activity: 3024
Merit: 1121



View Profile WWW
August 29, 2012, 09:48:44 PM
 #5

Yes its a good idea for sure. As soon as I saw the latest list of commands my first thought was gosh wouldn't it be nice to disable some of those for some callers.

I would have ended up having my shell scripts check args before passing them to the daemon but if the shell script knows the password a caller would have had to be able to execute it without being able to read it, which strikes me as an unlikely combination of permissions, or the password would have to be hidden in a config file but, again, setting up a user to be able to execute the script as a user who can access the config file, but not be able to read the config file itself sounds kind of tricksy, just the kind of thing that is going to be one of those nasty little nitpacky things that bites you next time you set everything up from scratch on a shiny new blank machine...

So yeah, great minds think alike. (That fools seldom differ is irrelevant, of course... Wink)

-MarkM-

Browser-launched Crossfire client now online (select CrossCiv server for Galactic  Milieu)
Free website hosting with PHP, MySQL etc: http://hosting.knotwork.com/
gmaxwell
Moderator
Legendary
*
expert
Offline Offline

Activity: 4284
Merit: 8808



View Profile WWW
August 30, 2012, 03:59:52 AM
 #6

many cases it's used as a server.
0_o

I certainly hope people are not exposing the bitcoin rpc port to the open internet.
isis (OP)
Full Member
***
Offline Offline

Activity: 154
Merit: 102


View Profile
August 30, 2012, 04:30:06 PM
 #7

many cases it's used as a server.
0_o

I certainly hope people are not exposing the bitcoin rpc port to the open internet.

You'd be surprised.  Even if it's not exposed though, if an attacker could gain access to your network they could run RPC all day and you'd never know. 

Interested in OpenPay?
https://github.com/openpay
Donate to show your appreciation and support the effort!

1LMDCSAwjhT2Vp1sSf62dybEYW3MYpsoZj

Pyramining Links - Help OpenPay and get a 10% bonus on your funds.
http://pyramining.com/referral/zre9ysgqt
http://pyramining.com/referral/ans9km72g
http://pyramining.com/referral/f3k4xebzp
http://pyramining.com/referral/nc3ag2sdb
markm
Legendary
*
Offline Offline

Activity: 3024
Merit: 1121



View Profile WWW
August 30, 2012, 04:32:42 PM
 #8

Yeah its actually the reverse of how I expressed it, looking at new calls made me think it'd be nice to be able to disable old calls for some users.

Basically I thought wow some nice harmless info-providing calls now, but what use are they really if giving access to them means also giving access to the wallet, the ability to send coins, and so on... all the original old things you don't have any good reason, probably, for letting anyone else have access to.

-MarkM-

EDIT: Of course being able to have multiple daemons use the same blockchain would also work, you could have a wallet-less daemon for the info calls, without needing a whole new copy of the blockchain for it. But that doesn't seem to be on the way any time soon so ACL seems a good alternative.

Browser-launched Crossfire client now online (select CrossCiv server for Galactic  Milieu)
Free website hosting with PHP, MySQL etc: http://hosting.knotwork.com/
jgarzik
Legendary
*
qt
Offline Offline

Activity: 1596
Merit: 1100


View Profile
August 30, 2012, 05:23:41 PM
 #9

In general, it is simply not advised to expose the RPC server to the Internet.  There are a great many things that should be done before it would be considered safe for exposing to the Internet.

A proxy server is a much better suggestion.  Then you may expose precisely, and only, what you need.  That's how pool servers work.  Proxy servers also permit accessing multiple backend bitcoind's and other flexible solutions.


Jeff Garzik, Bloq CEO, former bitcoin core dev team; opinions are my own.
Visit bloq.com / metronome.io
Donations / tip jar: 1BrufViLKnSWtuWGkryPsKsxonV2NQ7Tcj
markm
Legendary
*
Offline Offline

Activity: 3024
Merit: 1121



View Profile WWW
August 30, 2012, 07:11:58 PM
 #10

Oh gosh I was not thinking of exposing to the internet! Gosh no!

I was thinking of usernames who run stuff that needs some info the daemon can provide. I do not like the idea of having such a username know the password that can do actual wallet stuff, transactions, etc.

For example, a CGI script to provide some info or other that somehow relies on some info the daemon can provide.

I would not want the user that CGI runs as to have any access other than exactly what it needs to do its job.

-MarkM-


Browser-launched Crossfire client now online (select CrossCiv server for Galactic  Milieu)
Free website hosting with PHP, MySQL etc: http://hosting.knotwork.com/
justusranvier
Legendary
*
Offline Offline

Activity: 1400
Merit: 1013



View Profile
August 30, 2012, 07:18:43 PM
 #11

It would be nice if bitcoind could use PAM for password checking, at least on systems where PAM exists.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!