Create rule S5332: Using clear-text protocols is security-sensitive (#1422)

This commit is contained in:
github-actions[bot] 2022-11-25 17:07:05 +01:00 committed by GitHub
parent 839e48cfa6
commit 2fc736ef4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 100 additions and 24 deletions

View File

@ -1,9 +1,9 @@
== Ask Yourself Whether == Ask Yourself Whether
* Application data needs to be protected against falsifications or leaks when transiting over the network. * Application data needs to be protected against falsifications or leaks when transiting over the network.
* Application data transits over a network that is considered untrusted. * Application data transits over an untrusted network.
* Compliance rules require the service to encrypt data in transit. * Compliance rules require the service to encrypt data in transit.
* Your application renders web pages with a relaxed mixed content policy. * Your application renders web pages with a relaxed mixed content policy.
* OS level protections against clear-text traffic are deactivated. * OS-level protections against clear-text traffic are deactivated.
There is a risk if you answered yes to any of those questions. There is a risk if you answered yes to any of those questions.

View File

@ -1,24 +1,34 @@
Clear-text protocols such as ``++ftp++``, ``++telnet++`` or non-secure ``++http++`` lack encryption of transported data, as well as the capability to build an authenticated connection. Clear-text protocols such as ``++ftp++``, ``++telnet++``, or ``++http++`` lack
It means that an attacker able to sniff traffic from the network can read, modify or corrupt the transported content. These protocols are not secure as they expose applications to an extensive range of risks: encryption of transported data, as well as the capability to build an
authenticated connection. It means that an attacker able to sniff traffic from
the network can read, modify, or corrupt the transported content. These
protocols are not secure as they expose applications to an extensive range of
risks:
* Sensitive data exposure * sensitive data exposure
* Traffic redirected to a malicious endpoint * traffic redirected to a malicious endpoint
* Malware infected software update or installer * malware-infected software update or installer
* Execution of client side code * execution of client-side code
* Corruption of critical information * corruption of critical information
Even in the context of isolated networks like offline environments or segmented cloud environments, the insider threat exists. Thus, attacks involving communications being sniffed or tampered with can still happen. Even in the context of isolated networks like offline environments or segmented
cloud environments, the insider threat exists. Thus, attacks involving
communications being sniffed or tampered with can still happen.
For example, attackers could successfully compromise prior security layers by: For example, attackers could successfully compromise prior security layers by:
* Bypassing isolation mechanisms * bypassing isolation mechanisms
* Compromising a component of the network * compromising a component of the network
* Getting the credentials of an internal IAM account (either from a service account or an actual person) * getting the credentials of an internal IAM account (either from a service
account or an actual person)
In such cases, encrypting communications would decrease the chances of attackers to successfully leak data or steal credentials from other network components. In such cases, encrypting communications would decrease the chances of attackers
By layering various security practices (segmentation and encryption, for example), the application will follow the _defense-in-depth_ principle. to successfully leak data or steal credentials from other network components.
By layering various security practices (segmentation and encryption, for
example), the application will follow the _defense-in-depth_ principle.
Note that using the ``++http++`` protocol is being deprecated by https://blog.mozilla.org/security/2015/04/30/deprecating-non-secure-http[major web browsers]. Note that using the ``++http++`` protocol is being deprecated by
https://blog.mozilla.org/security/2015/04/30/deprecating-non-secure-http[major web browsers].
In the past, it has led to the following vulnerabilities: In the past, it has led to the following vulnerabilities:

View File

@ -0,0 +1,8 @@
== Ask Yourself Whether
* Application data needs to be protected against tampering or leaks when transiting over the network.
* Application data transits over an untrusted network.
* Compliance rules require the service to encrypt data in transit.
* OS-level protections against clear-text traffic are deactivated.
There is a risk if you answered yes to any of those questions.

View File

@ -0,0 +1,2 @@
{
}

View File

@ -0,0 +1,8 @@
== Recommended Secure Coding Practices
* Make application data transit over a secure, authenticated and encrypted protocol like TLS or SSH. Here are a few alternatives to the most common clear-text protocols:
** Use ``++sftp++``, ``++scp++``, or ``++ftps++`` instead of ``++ftp++``.
** Use ``++https++`` instead of ``++http++``.
It is recommended to secure all transport channels, even on local networks, as it can take a single non-secure connection to compromise an entire application or system.

View File

@ -0,0 +1,38 @@
include::../description.adoc[]
include::ask-yourself.adoc[]
include::recommended.adoc[]
== Sensitive Code Example
[source,docker]
----
RUN curl http://www.example.com/
----
== Compliant Solution
[source,docker]
----
RUN curl https://www.example.com/
----
include::see.adoc[]
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
== Message
* Make sure that using clear-text protocols is safe here.
== Highlighting
Highlight the URL.
'''
endif::env-github,rspecator-view[]

View File

@ -0,0 +1,10 @@
== See
* https://owasp.org/Top10/A02_2021-Cryptographic_Failures/[OWASP Top 10 2021 Category A2] - Cryptographic Failures
* https://www.owasp.org/www-project-top-ten/2017/A3_2017-Sensitive_Data_Exposure[OWASP Top 10 2017 Category A3] - Sensitive Data Exposure
* https://mobile-security.gitbook.io/masvs/security-requirements/0x10-v5-network_communication_requirements[Mobile AppSec Verification Standard] - Network Communication Requirements
* https://owasp.org/www-project-mobile-top-10/2016-risks/m3-insecure-communication[OWASP Mobile Top 10 2016 Category M3] - Insecure Communication
* https://cwe.mitre.org/data/definitions/200[MITRE, CWE-200] - Exposure of Sensitive Information to an Unauthorized Actor
* https://cwe.mitre.org/data/definitions/319[MITRE, CWE-319] - Cleartext Transmission of Sensitive Information
* https://security.googleblog.com/2016/09/moving-towards-more-secure-web.html[Google, Moving towards more secure web]
* https://blog.mozilla.org/security/2015/04/30/deprecating-non-secure-http/[Mozilla, Deprecating non secure http]

View File

@ -2,4 +2,4 @@
No issue is reported for the following cases because they are not considered sensitive: No issue is reported for the following cases because they are not considered sensitive:
* Insecure protocol scheme followed by loopback addresses like 127.0.0.1 or ``++localhost++`` * Insecure protocol scheme followed by loopback addresses like 127.0.0.1 or ``++localhost++``.

View File

@ -1,13 +1,13 @@
== Recommended Secure Coding Practices == Recommended Secure Coding Practices
* Make application data transit over a secure, authenticated and encrypted protocol like TLS or SSH. Here are a few alternatives to the most common clear-text protocols: * Make application data transit over a secure, authenticated and encrypted protocol like TLS or SSH. Here are a few alternatives to the most common clear-text protocols:
** Use``++ssh++`` as an alternative to ``++telnet++`` ** Use ``++ssh++`` as an alternative to ``++telnet++``.
** Use ``++sftp++``, ``++scp++`` or ``++ftps++`` instead of ``++ftp++`` ** Use ``++sftp++``, ``++scp++``, or ``++ftps++`` instead of ``++ftp++``.
** Use ``++https++`` instead of ``++http++`` ** Use ``++https++`` instead of ``++http++``.
** Use ``++SMTP++`` over ``++SSL/TLS++`` or ``++SMTP++`` with ``++STARTTLS++`` instead of clear-text SMTP ** Use ``++SMTP++`` over ``++SSL/TLS++`` or ``++SMTP++`` with ``++STARTTLS++`` instead of clear-text SMTP.
* Enable encryption of cloud components communications whenever it's possible. * Enable encryption of cloud components communications whenever it is possible.
* Configure your application to block mixed content when rendering web pages. * Configure your application to block mixed content when rendering web pages.
* If available, enforce OS level deactivation of all clear-text traffic * If available, enforce OS-level deactivation of all clear-text traffic.
It is recommended to secure all transport channels (even local network) as it can take a single non secure connection to compromise an entire application or system. It is recommended to secure all transport channels, even on local networks, as it can take a single non-secure connection to compromise an entire application or system.