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

Investigating an Oracle Secret Backend #2357

Closed
gdavison opened this issue Feb 9, 2017 · 18 comments
Closed

Investigating an Oracle Secret Backend #2357

gdavison opened this issue Feb 9, 2017 · 18 comments

Comments

@gdavison
Copy link
Contributor

gdavison commented Feb 9, 2017

My company is interested in using Vault, but our primary database is Oracle. I'd like to work on creating a secret backend for Oracle, but there are several issues that make it problematic. I'd like to get some thoughts from Vault project people before going too far down the rabbit hole.

Firstly, Oracle does not publish the wire interface to their database, so the only way to communicate with Oracle is through their binary blob driver library. On some platforms, it looks like a static library is available.

In order to use the Oracle libraries, at least some use of cgo would be required. Rather than build all of Vault with cgo, it would make sense to use something like go-plugin to isolate that portion. Judging from comments on both the Vault and go-plugin pages, go-plugin is not quite ready for prime-time use in Vault.

In general, does the approach make sense? Use would have to be at-own-risk until plugin issues are resolved, of course.

@vishalnayak
Copy link
Contributor

@gdavison This is not a new request and is being tracked by #1460.

@gdavison
Copy link
Contributor Author

gdavison commented Feb 9, 2017

@vishalnayak #1460 is closed. Should it be open if it's tracking an issue?

@vishalnayak
Copy link
Contributor

@gdavison Not sure why it is closed. Probably for not getting more eyes on it and have people work on the same feature in parallel.

@jefferai
Copy link
Member

jefferai commented Feb 9, 2017

Hi @gdavison ,

go-plugin support in Vault is very much on our roadmap currently, and this is one of the primary use-cases, as we've wanted Oracle support and cgo is something we don't want in Vault generally. We know how we're going to do the go-plugin enhancements; one of the things we haven't locked down yet is what the plugin interface looks like, although we have some ideas.

If you're interested in working on an Oracle backend, coding one up against the current backend interface would probably get you pretty far for the eventual plugin interface as we'll clearly need to satisfy a number of the same needs. In the mean time you would have a backend you could use in your Vault build.

I'll reopen this for now rather than reopening #1460 as you being active makes it more current. :-) If you have questions let us know and we can also let you know progress on the plugin interface as it takes shape so you can test. Plugins won't be in 0.7 but might appear somewhere in the 0.7.x line.

@jefferai jefferai reopened this Feb 9, 2017
@jefferai
Copy link
Member

jefferai commented Feb 9, 2017

@gdavison I thought I answered all of them?

@gdavison
Copy link
Contributor Author

gdavison commented Feb 9, 2017

@jefferai your comment wasn't there when I replied. Once I saw your comment, I deleted mine. You definitely answered what I was looking for, thanks!

@gdavison
Copy link
Contributor Author

@jefferai I have an Oracle backend coded. Should I submit a work-in-progress pull request?

@jefferai
Copy link
Member

Hi @gdavison ,

You should discuss with @briankassouf as he has been working on both our combined database backend and its plugin support. Both are getting close!

@briankassouf
Copy link
Contributor

Hi @gdavison

That's great news! The plugin functionality is also getting close. It would be nice for this backend to be the first plugin database type supported. The WIP interface for a plugin is currently:

type DatabaseType interface {
 	Type() string
 	CreateUser(statements Statements, username, password, expiration string) error
 	RenewUser(statements Statements, username, expiration string) error
 	RevokeUser(statements Statements, username string) error
 
 	Initialize(map[string]interface{}) error
 	Close() error
 	GenerateUsername(displayName string) (string, error)
 	GeneratePassword() (string, error)
 	GenerateExpiration(ttl time.Duration) (string, error)
 }

Let me know what you think! My work-in-progress pull request is #2200.

@gdavison
Copy link
Contributor Author

Hi @briankassouf, I'm on the road, so I haven't had a chance to take much of a look through the code on your PR. One thought I have, however, is about the CreateUser() function: each database has its own weirdnesses around usernames and passwords, so I think that it would be better to have each plugin generate those internally.

I'll have more of a chance to take a look Monday and rebase and create my WIP PR for the non-plugin version. Next I'll port it to the plugin interface.

@jefferai
Copy link
Member

@gdavison That's what the GenerateUsername, GeneratePassword, and GenerateExpiration functions are for!

You should work closely with @briankassouf ; one of the reasons for having a plugin interface is to avoid cgo-based databases in the main tree, so you can skip the PR for the non-plugin version; Oracle is the main initial reason we're adding plugin support in the first place :-)

@gdavison
Copy link
Contributor Author

Well, that's embarrassing, I skimmed right over the GenerateX() functions. I plead vacation brain :)

@jefferai
Copy link
Member

@gdavison If it helps at all, someone worked on an Oracle backend at https://github.com/binxiong/vault

In case any code there might be of use.

@gdavison
Copy link
Contributor Author

Thanks, @jefferai, I'll take a look to see if there's anything I should "borrow". I've had working code via cgo for a couple weeks, but haven't ported it to the plugin interface yet.

@yeroc
Copy link

yeroc commented May 31, 2017

Is there any update on this?

@jefferai
Copy link
Member

@yeroc @gdavison has been working on it.

@lscoughlin
Copy link

Did this die?

@gdavison
Copy link
Contributor Author

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

No branches or pull requests

6 participants