2020-06-30 12:47:33 +02:00
|
|
|
|
include::../description.adoc[]
|
|
|
|
|
|
|
|
|
|
include::../ask-yourself.adoc[]
|
|
|
|
|
|
|
|
|
|
include::../recommended.adoc[]
|
|
|
|
|
|
|
|
|
|
== Sensitive Code Example
|
|
|
|
|
|
|
|
|
|
----
|
|
|
|
|
String ip = '192.168.12.42'; // Sensitive
|
|
|
|
|
String clientIp = ApexPages.currentPage().getHeaders().get(‘True-Client-IP’);
|
|
|
|
|
Boolean isKnown = ip.equals(clientIp);
|
|
|
|
|
----
|
|
|
|
|
|
|
|
|
|
== Compliant Solution
|
|
|
|
|
|
|
|
|
|
----
|
|
|
|
|
StaticResource sr= [SELECT ip_address FROM StaticResource WHERE Name = 'configuration' LIMIT 1]; // Compliant
|
|
|
|
|
String ip_address = sr.body.toString();
|
|
|
|
|
String clientIp = ApexPages.currentPage().getHeaders().get(‘True-Client-IP’);
|
|
|
|
|
Boolean isKnown = ip_address.equals(clientIp);
|
|
|
|
|
----
|
|
|
|
|
|
|
|
|
|
include::../exceptions.adoc[]
|
|
|
|
|
|
|
|
|
|
include::../see.adoc[]
|
2021-06-02 20:44:38 +02:00
|
|
|
|
|
|
|
|
|
ifdef::rspecator-view[]
|
|
|
|
|
== Comments And Links
|
|
|
|
|
(visible only on this page)
|
|
|
|
|
|
|
|
|
|
include::../comments-and-links.adoc[]
|
|
|
|
|
endif::rspecator-view[]
|