34 lines
518 B
Plaintext
34 lines
518 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
|
||
|
|
||
|
----
|
||
|
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[]
|