简体   繁体   English

我的C#应用​​程序应如何安全地连接到我的AWS EC2数据库?

[英]How should my C# application securely connect to my AWS EC2 database?

As I see it, I have two options: access my database with a ReSTful (http) webservice connection, or directly connecting to MySQL. 如我所见,我有两个选择:使用ReSTful(http)Web服务连接访问数据库,或直接连接到MySQL。 I've found that it isn't that easy to directly access MySQL ( http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html ) and that the remote connection is IP-specific (my app would run in many places and the IPs won't be static). 我发现直接访问MySQL并不是那么容易( http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html )并且远程连接是特定于IP的(我的应用程序将在许多地方运行,并且IP不会是静态的)。

How should applications connect to databases? 应用程序应如何连接到数据库? Directly or through the httpd server? 直接还是通过httpd服务器?

Thank you very much :) 非常感谢你 :)

You can allow a MySQL user account to connect from any host (IP addresses). 您可以允许MySQL用户帐户从任何主机(IP地址)进行连接。

for example, GRANT ALL ON foo.* TO bar@'%' IDENTIFIED BY 'PASSWORD'; 例如,GRANT ALL ON foo。* TO bar @'%'由'PASSWORD'标识;

Depends on how secure you need it to be. 取决于您需要的安全性。 We configure an OpenVPN server on the same VPC as the MySQL server and use that to control access to our systems. 我们在与MySQL服务器相同的VPC上配置OpenVPN服务器,并使用它来控制对我们系统的访问。 There is no direct connect to MySQL. 没有直接连接到MySQL。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM