30 lines
463 B
Plaintext
30 lines
463 B
Plaintext
![]() |
include::../description.adoc[]
|
||
|
|
||
|
include::../ask-yourself.adoc[]
|
||
|
|
||
|
include::../recommended.adoc[]
|
||
|
|
||
|
== Sensitive Code Example
|
||
|
|
||
|
----
|
||
|
func connect() {
|
||
|
user := "root"
|
||
|
password:= "supersecret" // Sensitive
|
||
|
|
||
|
url := "login=" + user + "&passwd=" + password
|
||
|
}
|
||
|
----
|
||
|
|
||
|
== Compliant Solution
|
||
|
|
||
|
----
|
||
|
func connect() {
|
||
|
user := getEncryptedUser()
|
||
|
password:= getEncryptedPass() // Compliant
|
||
|
|
||
|
url := "login=" + user + "&passwd=" + password
|
||
|
}
|
||
|
----
|
||
|
|
||
|
include::../see.adoc[]
|