tidb icon indicating copy to clipboard operation
tidb copied to clipboard

Why we need user and permissions?

Open xialvjun opened this issue 9 years ago • 6 comments

Why not just put user and permissions all at application level rather than database level? Database can act as a ssh server and application can act as a ssh client. Database can just set host, port, and ssh public key. Application just link to the database.

That's all.

Why we need a system for user and permissions?

xialvjun avatar Aug 27 '17 06:08 xialvjun

database is an independent system, it can be accessed with or without applications, regardless of on-premises/off-premises, security is high on the priority list in the corporate infrastructure. Consider an extreme case that a MySQL server is deployed on a public cloud service, using default port and easy password like 'password', I bet it will be hacked within a week, some bitcoins will be needed as the redemption fee then.

tshqin avatar Aug 27 '17 07:08 tshqin

I think database is neerly impossible to be set on a public enviroment. Even if it be set on a public enviroment, it not for public use. We can use ways like ssh to connect to the database.

xialvjun avatar Aug 27 '17 07:08 xialvjun

one has permission on OS doesn't mean one should have permission on db, they are different roles. "Nothing worse than a familiar enemy"

tshqin avatar Aug 27 '17 07:08 tshqin

I didn't mean we use ssh to connect the database. I mean just use a way like ssh to connect the database rather than using username and password.

Well, there are two dimensions: user system and permission system. We can use public-private key to replace user system for better security. We can abandon permission system because in normal case(one application for one database) we don't need it, in special case(multi applications for one database) we can transform it to normal case(database > dbos > app1 + app2)

xialvjun avatar Aug 27 '17 07:08 xialvjun

SSH, especially SSL/TLS are supported by many dbms, they're optional and have no conflict with user/password. eg. MySQL connection methods: https://dev.mysql.com/doc/workbench/en/wb-manage-server-connections.html For TiDB, I'm not sure if it supports SSH/SSL/TLS yet or not.

tshqin avatar Aug 27 '17 09:08 tshqin

@xialvjun @tshqin SSL/TLS will be supported in this PR. For most applications, username/password is the standard authentication method.

shenli avatar Aug 27 '17 12:08 shenli