Invariant Properties

  • rss
  • Home

An Alternate Way To Get A Key: Key Servers

Bear Giles | July 14, 2015

I’ve previously mentioned providing an encryption key via a JNDI value provided by an appserver, or better yet splitting the key between that JNDI value and a file outside of the webapp directory. A recent question at work reminded me that this isn’t the only solution. Another approach is a simple key server – a webservice that provides the encryption key on demand.

This sounds wildly insecure but it’s fairly easy to lock down since the use case is so limited:

1. Run it on a private network (in a data center you own) or a VPC (in AWS). This restricts access to systems in the same data center since there should be a physical router blocking access from the internet at large.

2. Consider using IP address white-listing. You know the IP addresses of your servers, or at least their IP address range. Configure the webservice to only accept connections from these IP addresses. This can’t hurt but a knowledgeable attacker can perform ARP poisoning to hijack a white-listed address.

3. Use mutual authentication with digital certificates. You can create these certificates in-house. This forces an attacker to know something non-trivial in addition to being physically located near the key server.

4. Use SSL to prevent eavesdropping.

5. Use a keystore with a password provided by JNDI if you are returning private keys. It’s harder to protect secret keys but you could use a JNDI-provided key to wrap them. This would limit exposure if the appserver value is leaked due to poor backup security or compromised sysadmins.

I don’t think we gain anything by requiring a nonce since the code to handle it will also require secure initialization.

The biggest benefits to a key server are scalability and the ability to provide more than one key. It also prevents key disclosure if an attacker is able to look at arbitrary files on your system or, worse, obtain a backup copy of the system. The biggest drawback is that it’s one more system to maintain.

In production an AWS ‘micro’ instance should be more than adequate to support many client servers. The cost of a ‘micro’ instance is negligible. In a data center you could put it on a minimal virtual server.

For development and testing you can use a keyserver under the same appserver as your application.

I hope it goes without saying that this is not adequate for systems that require the highest security. However if you’re looking for something beyond a key provided by JNDI then this should be one of the options on the table.

Categories
Amazon Web Services (AWS), security
Comments rss
Comments rss
Trackback
Trackback

« Auto-encrypting Serializable Classes Extending PostgreSQL: Complex Number Data Type »

Leave a Reply

Click here to cancel reply.

You must be logged in to post a comment.

Archives

  • May 2020 (1)
  • March 2019 (1)
  • August 2018 (1)
  • May 2018 (1)
  • February 2018 (1)
  • November 2017 (4)
  • January 2017 (3)
  • June 2016 (1)
  • May 2016 (1)
  • April 2016 (2)
  • March 2016 (1)
  • February 2016 (3)
  • January 2016 (6)
  • December 2015 (2)
  • November 2015 (3)
  • October 2015 (2)
  • August 2015 (4)
  • July 2015 (2)
  • June 2015 (2)
  • January 2015 (1)
  • December 2014 (6)
  • October 2014 (1)
  • September 2014 (2)
  • August 2014 (1)
  • July 2014 (1)
  • June 2014 (2)
  • May 2014 (2)
  • April 2014 (1)
  • March 2014 (1)
  • February 2014 (3)
  • January 2014 (6)
  • December 2013 (13)
  • November 2013 (6)
  • October 2013 (3)
  • September 2013 (2)
  • August 2013 (5)
  • June 2013 (1)
  • May 2013 (2)
  • March 2013 (1)
  • November 2012 (1)
  • October 2012 (3)
  • September 2012 (2)
  • May 2012 (6)
  • January 2012 (2)
  • December 2011 (12)
  • July 2011 (1)
  • June 2011 (2)
  • May 2011 (5)
  • April 2011 (6)
  • March 2011 (4)
  • February 2011 (3)
  • October 2010 (6)
  • September 2010 (8)

Recent Posts

  • 8-bit Breadboard Computer: Good Encapsulation!
  • Where are all the posts?
  • Better Ad Blocking Through Pi-Hole and Local Caching
  • The difference between APIs and SPIs
  • Hadoop: User Impersonation with Kerberos Authentication

Meta

  • Log in
  • Entries RSS
  • Comments RSS
  • WordPress.org

Pages

  • About Me
  • Notebook: Common XML Tasks
  • Notebook: Database/Webapp Security
  • Notebook: Development Tips

Syndication

Java Code Geeks

Know Your Rights

Support Bloggers' Rights
Demand Your dotRIGHTS

Security

  • Dark Reading
  • Krebs On Security Krebs On Security
  • Naked Security Naked Security
  • Schneier on Security Schneier on Security
  • TaoSecurity TaoSecurity

Politics

  • ACLU ACLU
  • EFF EFF

News

  • Ars technica Ars technica
  • Kevin Drum at Mother Jones Kevin Drum at Mother Jones
  • Raw Story Raw Story
  • Tech Dirt Tech Dirt
  • Vice Vice

Spam Blocked

53,313 spam blocked by Akismet
rss Comments rss valid xhtml 1.1 design by jide powered by Wordpress get firefox