如何让网站使用 https 进行安全保护

发布于 2024-08-20 12:28:49 字数 456 浏览 5 评论 0 原文

我必须为公司构建一个小型网络应用程序来维护他们的业务数据...只有公司内部的人员才会使用它,但我们计划将其托管在公共域中,以便员工可以从不同位置连接到应用程序。 (到目前为止,我已经构建了仅在内部托管的网络应用程序)

我想知道是否需要使用安全连接(https)或仅表单身份验证就足够了。

如果你说 https,我有一些问题:

  1. 我应该做什么来为 https 准备我的网站。 (我需要更改代码/配置吗)
  2. SSL 和 https 是一样的吗?
  3. 我需要向某人申请以获得一些许可证或其他东西吗?
  4. 我是否需要保护所有页面或仅保护登录页面...

我在互联网上搜索答案,但我无法获得所有这些要点...任何白皮书或其他参考资料也会有所帮助...

感觉如果您需要更多信息,请随时询问。

谢谢拉贾

I have to build a small webapp for a company to maintain their business data... Only those within the company will be using it, but we are planning to host it in public domain, so that the employees can connect to app from various locations. (Till now I have built web apps that are hosted internally only)

I'm wondering whether I need to use a secured connection (https) or just the forms authentication is enough.

If you say https, I have some questions :

  1. What should I do to prepare my website for https. (Do I need to alter the code / Config)
  2. Is SSL and https one and the same...
  3. Do I need to apply with someone to get some license or something.
  4. Do I need to make all my pages secured or only the login page...

I was searching Internet for answer, but I was not able to get all these points... Any whitepaper or other references would also be helpful...

Feel free to ask incase you need more information.

Thanks

  • Raja

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(7

柠北森屋 2024-08-27 12:28:49

我应该做什么来准备我的网站
对于 https。 (我需要改变
代码/配置)

您应该牢记安全编码的最佳实践(这里有一个很好的介绍:http: //www.owasp.org/index.php/Secure_Coding_Principles ),否则您只需要正确设置 SSL 证书即可。

SSL 和 https 是一回事吗?

几乎是的。

我需要向某人申请才能获得
一些许可证或其他东西。

您可以从证书颁发机构购买 SSL 证书或使用自签名证书。您可以购买的价格相差很大 - 从每年 10 美元到数百美元不等。例如,如果您建立在线商店,您将需要其中之一。自签名证书是内部应用程序的可行选择。您还可以使用其中之一进行开发。以下是有关如何为 IIS 设置自签名证书的好教程:使用自签名证书在 IIS 7.0 上启用 SSL

我需要保护我的所有页面吗
或者只有登录页面..

一切都使用 HTTPS,而不仅仅是初始用户登录。这不会产生太大的开销,并且意味着用户从远程托管应用程序发送/接收的数据如果被拦截,则无法被外部方读取。甚至 Gmail 现在也默认启用 HTTPS。

What should I do to prepare my website
for https. (Do I need to alter the
code / Config)

You should keep best practices for secure coding in mind (here is a good intro: http://www.owasp.org/index.php/Secure_Coding_Principles ), otherwise all you need is a correctly set up SSL certificate.

Is SSL and https one and the same..

Pretty much, yes.

Do I need to apply with someone to get
some license or something.

You can buy an SSL certificate from a certificate authority or use a self-signed certificate. The ones you can purchase vary wildly in price - from $10 to hundreds of dollars a year. You would need one of those if you set up an online shop, for example. Self-signed certificates are a viable option for an internal application. You can also use one of those for development. Here's a good tutorial on how to set up a self-signed certificate for IIS: Enabling SSL on IIS 7.0 Using Self-Signed Certificates

Do I need to make all my pages secured
or only the login page..

Use HTTPS for everything, not just the initial user login. It's not going to be too much of an overhead and it will mean the data that the users send/receive from your remotely hosted application cannot be read by outside parties if it is intercepted. Even Gmail now turns on HTTPS by default.

笑忘罢 2024-08-27 12:28:49

什么样的业务数据?商业秘密或者只是他们不想让人们看到的东西,但如果泄露出去,也没什么大不了的?如果我们谈论的是商业秘密、财务信息、客户信息和一般机密的信息。那么就不要走那条路。

我想知道是否需要使用
安全连接 (https) 或仅
表单身份验证就足够了。

始终使用安全连接。

我需要更改代码/配置吗

是的。好吧,也许不是。您可能需要一位专家为您做这件事。

SSL 和 https 是一回事吗...

大部分是的。人们通常将这些事物称为同一事物。

我需要向某人申请才能获得许可证或其他东西吗?

您可能希望由证书颁发机构签署您的证书。这将花费您或您的客户一些钱。

我需要保护所有页面还是仅保护登录页面...

始终使用 https。如果网站是供内部用户使用的,那么性能通常不是问题。

我在互联网上寻找答案,
但我没能得到所有这些
点...任何白皮书或其他
参考资料也会有帮助...

从这里开始获取一些指示: http://www.owasp .org/index.php/Category:OWASP_Guide_Project

请注意,一旦可以从 Internet 访问网站,SSL 就只是确保网站安全的一小部分。它不能阻止大多数类型的黑客攻击。

What kind of business data? Trade secrets or just stuff that they don't want people to see but if it got out, it wouldn't be a big deal? If we are talking trade secrets, financial information, customer information and stuff that's generally confidential. Then don't even go down that route.

I'm wondering whether I need to use a
secured connection (https) or just the
forms authentication is enough.

Use a secure connection all the way.

Do I need to alter the code / Config

Yes. Well may be not. You may want to have an expert do this for you.

Is SSL and https one and the same...

Mostly yes. People usually refer to those things as the same thing.

Do I need to apply with someone to get some license or something.

You probably want to have your certificate signed by a certificate authority. It will cost you or your client a bit of money.

Do I need to make all my pages secured or only the login page...

Use https throughout. Performance is usually not an issue if the site is meant for internal users.

I was searching Internet for answer,
but I was not able to get all these
points... Any whitepaper or other
references would also be helpful...

Start here for some pointers: http://www.owasp.org/index.php/Category:OWASP_Guide_Project

Note that SSL is a minuscule piece of making your web site secure once it is accessible from the internet. It does not prevent most sort of hacking.

千寻… 2024-08-27 12:28:49

我认为您对站点身份验证和 SSL 感到困惑。

如果您需要将您的网站纳入 SSL,那么您需要将 SSL 证书安装到您的 Web 服务器中。您可以从赛门铁克等地方为自己购买一个证书。该证书将包含您的公钥/私钥对以及其他内容。

您无需在源代码中执行任何操作,并且仍然可以继续在站点中使用表单身份验证(或任何其他身份验证)。只是,Web 服务器和客户端之间发生的任何数据通信都将使用您的证书进行加密和签名。人们会使用安全 HTTP (https://) 来访问您的网站。

查看此了解更多信息 --> http://en.wikipedia.org/wiki/Transport_Layer_Security

I think you are getting confused with your site Authentication and SSL.

If you need to get your site into SSL, then you would need to install a SSL certificate into your web server. You can buy a certificate for yourself from one of the places like Symantec etc. The certificate would contain your public/private key pair, along with other things.

You wont need to do anything in your source code, and you can still continue to use your Form Authntication (or any other) in your site. Its just that, any data communication that takes place between the web server and the client will encrypted and signed using your certificate. People would use secure-HTTP (https://) to access your site.

View this for more info --> http://en.wikipedia.org/wiki/Transport_Layer_Security

年少掌心 2024-08-27 12:28:49

对于业务数据,如果数据是私有的,我将使用安全连接,否则表单身份验证就足够了。

如果您确实决定使用安全连接,请注意,我没有保护网站安全的经验,我只是放弃我个人经历中遇到的情况。如果我有任何错误,请随时纠正我。

我应该做什么来为 https 准备我的网站。 (我需要更改代码/配置吗)

为了启用SSL(安全套接字层) 对于您的网站,您需要设置证书,代码或配置不可更改。

我通过使用 OpenSSL 和 < a href="http://www.activestate.com/activeperl/" rel="nofollow noreferrer">ActivePerl 来自 此在线教程。如果这是用于更大的受众(我的受众少于 10 人)并且属于公共领域,我建议寻求专业的替代方案。

SSL 和 https 是一回事吗...

不完全一样,但它们是齐头并进的! SSL 确保您在查看网站时来回加密和解密数据,https 是访问安全网站所需的 URI。您会注意到,当您尝试访问 http://secure.mydomain.com 时,它会显示一条错误消息。

我需要向某人申请才能获得许可证或其他东西吗?

您不需要获得许可证,而是需要获得证书。您可以研究提供专业服务并确保网站安全的公司,例如 VeriSign举个例子。

我需要保护所有页面还是仅保护登录页面...

mydomain.com 启用证书后,属于 *.mydomain.com 下的每个页面将得到保障。

For business data, if the data is private I would use a secured connection, otherwise a forms authentication is sufficient.

If you do decide to use a secured connection, please note that I do not have experience with securing websites, I am just recanting off what I encountered during my own personal experience. If I am wrong in anyway, please feel free to correct me.

What should I do to prepare my website for https. (Do I need to alter the code / Config)

In order to enable SSL (Secure Sockets Layer) for your website, you would need to set-up a certificate, code or config is not altered.

I have enabled SSL for an internal web-server, by using OpenSSL and ActivePerl from this online tutorial. If this is used for a larger audience (my audience was less than 10 people) and is in the public domain, I suggest seeking professional alternatives.

Is SSL and https one and the same...

Not exactly, but they go hand in hand! SSL ensures that data is encrypted and decrypted back and forth while you are viewing the website, https is the URI that is need to access the secure website. You will notice when you try to access http://secure.mydomain.com it displays an error message.

Do I need to apply with someone to get some license or something.

You would not need to obtain a license, but rather a certificate. You can look into companies that offer professional services with securing websites, such as VeriSign as an example.

Do I need to make all my pages secured or only the login page...

Once your certificate is enabled for mydomain.com every page that falls under *.mydomain.com will be secured.

后eg是否自 2024-08-27 12:28:49

4.我需要保护所有页面还是仅保护登录页面...

只需将登录页面保持在 https 下

,这将确保浏览其他页面时不会产生任何开销。条件是您需要在 Web 配置中提供正确的身份验证设置。这是为了确保未登录的用户无法浏览需要身份验证的页面。

4.Do I need to make all my pages secured or only the login page...

Just keep the login page under https

this will ensure there is no overhead when browsing other pages. the condition is you need to provide correct authentication settings in the web config. This is to ensure users who are not logged in will not be able to browse pages that would need authentication.

七堇年 2024-08-27 12:28:49

@balalakshmi 提到了正确的身份验证设置。身份验证只是问题的一半,另一半是授权。

如果您使用表单身份验证和标准控件(例如 ),则需要执行一些操作来确保只有经过身份验证的用户才能访问安全页面。

web.config 部分下,您需要默认禁用匿名访问:

<authorization>
 <deny users="?" />
</authorization>

任何将被匿名访问的页面(例如Login.aspx 页面本身)需要进行重新允许匿名访问的覆盖。这需要 元素,并且必须位于 级别(外部)。 web> 部分),如下所示:

<!-- Anonymous files -->
<location path="Login.aspx">
 <system.web>
  <authorization>
   <allow users="*" />
  </authorization>
 </system.web>
</location>

请注意,您还需要允许匿名访问匿名页面使用的任何样式表或脚本:

<!-- Anonymous folders -->
<location path="styles">
 <system.web>
  <authorization>
   <allow users="*" />
  </authorization>
 </system.web>
</location>

请注意该位置的路径属性与 web.config 文件夹相关,并且不能有 ~/ 前缀,这与大多数其他路径类型配置属性不同。

@balalakshmi mentioned about the correct authentication settings. Authentication is only half of the problem, the other half is authorization.

If you're using Forms Authentication and standard controls like <asp:Login> there are a couple of things you'll need to do to ensure that only your authenticated users can access secured pages.

In web.config, under the <system.web> section you'll need to disable anonymous access by default:

<authorization>
 <deny users="?" />
</authorization>

Any pages that will be accessed anonymously (such as the Login.aspx page itself) will need to have an override that re-allows anonymous access. This requires a <location> element and must be located at the <configuration> level (outside the <system.web> section), like this:

<!-- Anonymous files -->
<location path="Login.aspx">
 <system.web>
  <authorization>
   <allow users="*" />
  </authorization>
 </system.web>
</location>

Note that you'll also need to allow anonymous access to any style sheets or scripts that are used by the anonymous pages:

<!-- Anonymous folders -->
<location path="styles">
 <system.web>
  <authorization>
   <allow users="*" />
  </authorization>
 </system.web>
</location>

Be aware that the location's path attribute is relative to the web.config folder and cannot have a ~/ prefix, unlike most other path-type configuration attributes.

咋地 2024-08-27 12:28:49

尝试在 PHP 中创建一个引导目录,就像

<?PHP
$ip = $_SERVER['REMOTE_ADDR'];
$privacy = ['BOOTSTRAP_CONFIG'];
$shell   = ['BOOTSTRAP_OUTPUT'];
enter code here
if $ip == $privacy {
function $privacy int $ip = "https://";
} endif {
echo $shell
}
?>

主要是这样!

Try making a boot directory in PHP, as in

<?PHP
$ip = $_SERVER['REMOTE_ADDR'];
$privacy = ['BOOTSTRAP_CONFIG'];
$shell   = ['BOOTSTRAP_OUTPUT'];
enter code here
if $ip == $privacy {
function $privacy int $ip = "https://";
} endif {
echo $shell
}
?>

Thats mainly it!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文