Question 1Security Operations
Choose 1
While reviewing a recent compromise, a forensics team discovers that there are hardcoded
credentials in the database connection strings. Which of the following assessment types should be performed during software development to prevent this from reoccurring?
Correct answer:
C. Static analysis
Explanation:
Hardcoded credentials in source code (e.g., connection strings) are a coding flaw that should be caught before deployment. Static analysis (Static Application Security Testing or SAST) examines source code without executing it, identifying hardcoded secrets, insecure functions, and other vulnerabilities during the development phase, preventing them from reaching production.
Correct Option:
C. Static analysis –
Static analysis tools scan source code, bytecode, or binaries for patterns of known vulnerabilities, including hardcoded credentials (e.g., password= in clear text), SQL injection flaws, buffer overflows, etc. It is performed early in the SDLC, allowing developers to fix issues before code is compiled or deployed.
Incorrect Options:
A. Vulnerability scan –
Vulnerability scanning typically targets running systems (network or web apps) for missing patches and misconfigurations. It may detect hardcoded credentials in production but is not a development-phase prevention method.
B. Penetration test –
Penetration testing is a human-led, dynamic attack simulation. It is costly, time-consuming, and performed later in the lifecycle, not as a routine code-level prevention tool.
D. Quality assurance (QA) –
QA focuses on functional and performance testing (e.g., unit tests, integration tests). While QA might catch some issues, it is not specifically designed to find hardcoded credentials.
Reference:
CompTIA SY0-701 Objective 4.3 – Explain testing techniques. Static analysis (SAST) identifies hardcoded secrets and code-level vulnerabilities during development. (See also NIST SP 800-218, Secure Software Development Framework, Practice PW.4 – Scan Code.)
Hardcoded credentials in source code (e.g., connection strings) are a coding flaw that should be caught before deployment. Static analysis (Static Application Security Testing or SAST) examines source code without executing it, identifying hardcoded secrets, insecure functions, and other vulnerabilities during the development phase, preventing them from reaching production.
Correct Option:
C. Static analysis –
Static analysis tools scan source code, bytecode, or binaries for patterns of known vulnerabilities, including hardcoded credentials (e.g., password= in clear text), SQL injection flaws, buffer overflows, etc. It is performed early in the SDLC, allowing developers to fix issues before code is compiled or deployed.
Incorrect Options:
A. Vulnerability scan –
Vulnerability scanning typically targets running systems (network or web apps) for missing patches and misconfigurations. It may detect hardcoded credentials in production but is not a development-phase prevention method.
B. Penetration test –
Penetration testing is a human-led, dynamic attack simulation. It is costly, time-consuming, and performed later in the lifecycle, not as a routine code-level prevention tool.
D. Quality assurance (QA) –
QA focuses on functional and performance testing (e.g., unit tests, integration tests). While QA might catch some issues, it is not specifically designed to find hardcoded credentials.
Reference:
CompTIA SY0-701 Objective 4.3 – Explain testing techniques. Static analysis (SAST) identifies hardcoded secrets and code-level vulnerabilities during development. (See also NIST SP 800-218, Secure Software Development Framework, Practice PW.4 – Scan Code.)
