42 lines
923 B
Plaintext
42 lines
923 B
Plaintext
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[]
|
||
|
||
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[]
|