Rule Definition
Built-in remote addresses cause problems when the target is moved. Avoid hardcoded network resources (e.g., IP addresses, URLs, absolute file paths, etc.) to assure robustness and portability.
Remediation
Utilize indirect access to network resources using underlaying operating system calls and relative paths. In case hardcoding is necessary, isolating hardcoded data to installation scripts or configuration files can limit its potential negative impact.
Violation Code Sample
>>> url = "http://0.0.0.0:8080/'
Fixed Code Sample
>>> # "server_address" is uploaded from somewhere else
>>> url = "http://%s:%d/" % server_address
Reference
ASCRM 1.0, Automated Source Code Reliability Measure, Object Management Group.
Related Technologies
Technical Criterion
PCI-DSS4-Requirement-1.4.5 - The disclosure of internal IP addresses and routing information is limited to only authorized parties.
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.