aboutsummaryrefslogtreecommitdiff
path: root/files/ru/web/security/securing_your_site
diff options
context:
space:
mode:
Diffstat (limited to 'files/ru/web/security/securing_your_site')
-rw-r--r--files/ru/web/security/securing_your_site/index.html55
-rw-r--r--files/ru/web/security/securing_your_site/turning_off_form_autocompletion/index.html70
2 files changed, 125 insertions, 0 deletions
diff --git a/files/ru/web/security/securing_your_site/index.html b/files/ru/web/security/securing_your_site/index.html
new file mode 100644
index 0000000000..59682ddf82
--- /dev/null
+++ b/files/ru/web/security/securing_your_site/index.html
@@ -0,0 +1,55 @@
+---
+title: Securing your site
+slug: Web/Security/Securing_your_site
+tags:
+ - HTTP
+ - NeedsTranslation
+ - Security
+ - TopicStub
+ - Web Development
+ - Website Security
+translation_of: Web/Security/Securing_your_site
+---
+<p>{{ draft() }}</p>
+
+<p>There are a number of things you can do to help secure your site. This article offers an assortment of suggestions, as well as links to other articles providing more useful information.</p>
+
+<div class="note"><strong>Note:</strong> This article is a work in progress, and is neither complete nor does following its suggestions guarantee your site will be fully secure.</div>
+
+<h2 id="User_information_security">User information security</h2>
+
+<dl>
+ <dt><a href="/en/How_to_Turn_Off_Form_Autocompletion" title="en/How to Turn Off Form Autocompletion">How to turn off form autocompletion</a></dt>
+ <dd>Form fields support autocompletion in Gecko; that is, their values can be remembered and automatically brought back the next time the user visits your site. For certain types of data, you may wish to disable this feature.</dd>
+ <dt><a href="/en/CSS/Privacy_and_the_:visited_selector" title="en/CSS/Privacy and the :visited selector">Privacy and the :visited selector</a></dt>
+ <dd>This article discusses changes made to the <code>getComputedStyle()</code> method that eliminates the ability for malicious sites to figure out the user's browsing history.</dd>
+ <dt><a href="https://www.owasp.org/index.php/Password_Storage_Cheat_Sheet">Hash passwords using a secure algorithm</a> (OWASP)</dt>
+ <dd>Storing passwords in plain text can lead to attackers knowing and leaking the exact password of your site's users, potentially putting the users at risk. The same issues can arise if you use an old or insecure algorithm for hashing (such as md5). You should use a password-specific hashing algorithm (such as Argon2, PBKDF2, scrypt or bcrypt) instead of message digest algorithms (such as md5 and sha). This article showcases best practices to use when storing passwords.</dd>
+</dl>
+
+<h2 id="Content_security">Content security</h2>
+
+<dl>
+ <dt><a href="/en/Properly_Configuring_Server_MIME_Types" title="en/Properly Configuring Server MIME Types">Properly configuring server MIME types</a></dt>
+ <dd>There are several ways incorrect MIME types can cause potential security problems with your site. This article explains some of those and shows how to configure your server to serve files with the correct MIME types.</dd>
+ <dt><a href="/en/Security/HTTP_Strict_Transport_Security" title="en/Security/HTTP Strict Transport Security">HTTP Strict Transport Security</a></dt>
+ <dd>The <code>Strict-Transport-Security:</code> <a href="/en/HTTP" title="en/HTTP">HTTP</a> header lets a website specify that it may only be accessed using HTTPS.</dd>
+ <dt><a href="/en-US/docs/Web/HTTP/CORS" title="En/HTTP access control">HTTP access control</a></dt>
+ <dd>The Cross-Origin Resource Sharing standard provides a way to specify what content may be loaded from other domains. You can use this to prevent your site from being used improperly; in addition, you can use it to establish resources that other sites are expressly permitted to use.</dd>
+ <dt><a href="/en/Security/CSP">Content Security Policy</a></dt>
+ <dd>An added layer of security that helps to detect and mitigate certain types of attacks, including {{Glossary("Cross-site_scripting", "Cross Site Scripting (XSS)")}} and data injection attacks. These attacks are used for everything from data theft to site defacement or distribution of malware. Code is executed by the victims and lets the attackers bypass access controls and impersonate users. According to the Open Web Application Security Project, XSS was the <a class="external external-icon" href="https://www.owasp.org/images/7/72/OWASP_Top_10-2017_%28en%29.pdf.pdf" rel="noopener">seventh most common Web app vulnerability</a> in 2017.</dd>
+ <dt><a href="/en-US/docs/Web/HTTP/X-Frame-Options">The X-Frame-Options response header</a></dt>
+ <dd>
+ <p>The <code>X-Frame-Options:</code> <a href="/en/HTTP" title="en/HTTP">HTTP</a> response header can be used to indicate whether or not a browser should be allowed to render a page in a {{ HTMLElement("frame") }}. Sites can use this to avoid clickjacking attacks, by ensuring that their content is not embedded into other sites.</p>
+ </dd>
+ <dt>Securing Your Site using Htaccess</dt>
+ <dd>It is the best way to secure your site using the .htaccess file. You can blacklist IPs, restrict access to certain areas of website, protect different files, protect against image hotlinking, and a lot more.</dd>
+</dl>
+
+<h2 id="See_also">See also</h2>
+
+<ul>
+ <li><a class="external" href="https://www.owasp.org/">Open Web Application Security Project (OWASP)</a></li>
+</ul>
+
+<div>{{QuickLinksWithSubpages("/en-US/docs/Web/Security")}}</div>
diff --git a/files/ru/web/security/securing_your_site/turning_off_form_autocompletion/index.html b/files/ru/web/security/securing_your_site/turning_off_form_autocompletion/index.html
new file mode 100644
index 0000000000..6d60a0d151
--- /dev/null
+++ b/files/ru/web/security/securing_your_site/turning_off_form_autocompletion/index.html
@@ -0,0 +1,70 @@
+---
+title: How to turn off form autocompletion
+slug: Web/Security/Securing_your_site/Turning_off_form_autocompletion
+translation_of: Web/Security/Securing_your_site/Turning_off_form_autocompletion
+---
+<p><span class="seoSummary">В этой статье объясняется как можно отключить автозаполнение полей на сайте.</span></p>
+
+<p>По умолчанию браузеры запоминают информацию, которую пользователи отправляют через {{HTMLElement("input")}} поля на сайтах. Это позволяет браузеру предлагать варианты для автодополнения (то есть предлагать возможные дополнения для полей, в которые пользователь начал вводить данные) или автозаполнение (то есть предварительно заполнять определенные поля при загрузке).</p>
+
+<p>Эти функции обычно включены по умолчанию, но они могут вызвать проблемы конфиденциальности пользователей, поэтому браузеры могут позволить отключать их. Однако некоторые данные, представленные в формах, либо не будут полезны в будущем (например, одноразовый пин-код), либо содержат конфиденциальную информацию (например, уникальный правительственный идентификатор или код безопасности кредитной карты). Как автор сайта, вы можете предпочесть, чтобы браузер не запоминал значения для таких полей, даже если в браузере включена функция автозаполнения.</p>
+
+<p>It is important to know that if you turn off autocomplete, you are <strong>breaking</strong> the rule <a href="https://www.w3.org/WAI/WCAG21/Understanding/identify-input-purpose.html">1.3.5: Identify Input Purpose in WCAG 2.1</a>. If you are making a website that should follow WCAG, you should use autocomplete with autofill.</p>
+
+<h2 id="Disabling_autocompletion">Disabling autocompletion</h2>
+
+<p>To disable autocompletion in forms, you can set the <code><a href="/en-US/docs/Web/HTML/Attributes/autocomplete">autocomplete</a></code> attribute to "off":</p>
+
+<pre class="brush: html">autocomplete="off"</pre>
+
+<p>You can do this either for an entire form, or for specific input elements in a form:</p>
+
+<pre class="brush: html">&lt;form method="post" action="/form" autocomplete="off"&gt;
+[…]
+&lt;/form&gt;</pre>
+
+<pre class="brush: html">&lt;form method="post" action="/form"&gt;
+ […]
+ &lt;div&gt;
+ &lt;label for="cc"&gt;Credit card:&lt;/label&gt;
+ &lt;input type="text" id="cc" name="cc" autocomplete="off"&gt;
+ &lt;/div&gt;
+&lt;/form&gt;</pre>
+
+<p>Setting <code>autocomplete="off"</code> on fields has two effects:</p>
+
+<ul>
+ <li>It tells the browser not to save data inputted by the user for later autocompletion on similar forms, though heuristics for complying vary by browser.</li>
+ <li>It stops the browser from caching form data in the session history. When form data is cached in session history, the information filled in by the user is shown in the case where the user has submitted the form and clicked the Back button to go back to the original form page.</li>
+</ul>
+
+<p>If a browser keeps on making suggestions even after setting autocomplete to off, then you have to change the name attribute of the input element.</p>
+
+<h2 id="The_autocomplete_attribute_and_login_fields">The autocomplete attribute and login fields</h2>
+
+<p>Modern browsers implement integrated password management: when the user enters a username and password for a site, the browser offers to remember it for the user. When the user visits the site again, the browser autofills the login fields with the stored values.</p>
+
+<p>Additionally, the browser enables the user to choose a master password that the browser will use to encrypt stored login details.</p>
+
+<p>Even without a master password, in-browser password management is generally seen as a net gain for security. Since users do not have to remember passwords that the browser stores for them, they are able to choose stronger passwords than they would otherwise.</p>
+
+<p>For this reason, many modern browsers do not support <code>autocomplete="off"</code> for login fields:</p>
+
+<ul>
+ <li>If a site sets <code>autocomplete="off"</code> for a {{HTMLElement("form")}}, and the form includes username and password input fields, then the browser still offers to remember this login, and if the user agrees, the browser will autofill those fields the next time the user visits the page.</li>
+ <li>If a site sets <code>autocomplete="off"</code> for username and password {{HTMLElement("input")}} fields, then the browser still offers to remember this login, and if the user agrees, the browser will autofill those fields the next time the user visits the page.</li>
+</ul>
+
+<p>This is the behavior in Firefox (since version 38), Google Chrome (since 34), and Internet Explorer (since version 11).</p>
+
+<h3 id="Preventing_autofilling_with_autocompletenew-password">Preventing autofilling with autocomplete="new-password"</h3>
+
+<p>If you are defining a user management page where a user can specify a new password for another person, and therefore you want to prevent autofilling of password fields, you can use <code>autocomplete="new-password"</code>.</p>
+
+<p>This is a hint, which browsers are not required to comply with. However modern browsers have stopped autofilling <code>&lt;input&gt;</code> elements with <code>autocomplete="new-password"</code> for this very reason. For example, Firefox version 67 (see {{bug(1119063)}}) stopped autofilling in this case; however, Firefox 70 (see {{bug(1565407)}}) can suggest securely-generated passwords, but does not autofill a saved password. See the <a href="/en-US/docs/Web/HTML/Attributes/autocomplete#Browser_compatibility"><code>autocomplete</code> compat table</a> for more details.</p>
+
+<h2 id="Tools_for_disabling_autocompletion">Tools for disabling autocompletion</h2>
+
+<p>The <a href="https://terrylinooo.github.io/jquery.disableAutoFill/">jquery.disableAutoFill</a> plugin randomizes an input's <code>name</code> attribute by default. When the form is submitted, the plugin restores the original name. This prevents auto-completion for all browsers (includes third-party auto-completion extensions) but doesn't necessarily help with login fields.</p>
+
+<p>{{QuickLinksWithSubpages("/en-US/docs/Web/Security")}}</p>