50 lines
796 B
Plaintext
50 lines
796 B
Plaintext
include::../description.adoc[]
|
|
|
|
include::../ask-yourself.adoc[]
|
|
|
|
include::../recommended.adoc[]
|
|
|
|
== Sensitive Code Example
|
|
|
|
----
|
|
ip = "192.168.12.42"; // Sensitive
|
|
|
|
const net = require('net');
|
|
var client = new net.Socket();
|
|
client.connect(80, ip, function() {
|
|
// ...
|
|
});
|
|
----
|
|
|
|
== Compliant Solution
|
|
|
|
[source,javascript]
|
|
----
|
|
ip = process.env.IP_ADDRESS; // Compliant
|
|
|
|
const net = require('net');
|
|
var client = new net.Socket();
|
|
client.connect(80, ip, function() {
|
|
// ...
|
|
});
|
|
----
|
|
|
|
include::../exceptions.adoc[]
|
|
|
|
include::../see.adoc[]
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::../message.adoc[]
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
include::../comments-and-links.adoc[]
|
|
endif::env-github,rspecator-view[]
|