2020-06-30 12:50:28 +02:00
|
|
|
include::../description.adoc[]
|
|
|
|
|
|
|
|
include::../ask-yourself.adoc[]
|
|
|
|
|
|
|
|
include::../recommended.adoc[]
|
|
|
|
|
|
|
|
== Sensitive Code Example
|
|
|
|
|
|
|
|
----
|
|
|
|
url = "http://example.com" # Sensitive
|
|
|
|
url = "ftp://anonymous@example.com" # Sensitive
|
|
|
|
url = "telnet://anonymous@example.com" # Sensitive
|
|
|
|
|
|
|
|
import telnetlib
|
|
|
|
cnx = telnetlib.Telnet("towel.blinkenlights.nl") # Sensitive
|
|
|
|
|
|
|
|
import ftplib
|
|
|
|
cnx = ftplib.FTP("ftp.example.com") # Sensitive
|
|
|
|
|
|
|
|
import smtplib
|
|
|
|
smtp = smtplib.SMTP("smtp.example.com", port=587) # Sensitive
|
|
|
|
----
|
|
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
|
2022-02-04 17:28:24 +01:00
|
|
|
[source,python]
|
2020-06-30 12:50:28 +02:00
|
|
|
----
|
|
|
|
url = "https://example.com" # Compliant
|
|
|
|
url = "sftp://anonymous@example.com" # Compliant
|
|
|
|
url = "ssh://anonymous@example.com" # Compliant
|
|
|
|
|
|
|
|
import ftplib
|
|
|
|
cnx = ftplib.FTP_TLS("ftp.example.com") # Compliant
|
|
|
|
|
|
|
|
import smtplib
|
|
|
|
smtp = smtplib.SMTP("smtp.example.com", port=587) # Compliant
|
|
|
|
smtp.starttls(context=context)
|
|
|
|
|
|
|
|
smtp_ssl = smtplib.SMTP_SSL("smtp.gmail.com", port=465) # Compliant
|
|
|
|
----
|
|
|
|
|
|
|
|
include::../exceptions.adoc[]
|
|
|
|
|
|
|
|
include::../see.adoc[]
|
2021-09-20 15:38:42 +02:00
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
|
|
|
|
'''
|
|
|
|
== Implementation Specification
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
include::message.adoc[]
|
|
|
|
|
|
|
|
endif::env-github,rspecator-view[]
|