Constant variable names
ID | SECURITY-5 |
Title | Avoid constant variable names as: username , loginname , password etc. |
Priority | Mandatory |
Severity level | 3 |
Description | Avoid the use of contant variable names as: username , loginname , password , credentials etc, instead obtain these via a user input action or read them from a (secured) file. |
Rationale | For security reasons, it is discouraged to use hard-coded username and or password since this way they can be easily shared with others accidentally. |
Avoid:
username = 'myName';
password = 'myPassword';
Instead use:
% Ask the user to provide a username and password, for example using a dialog:
[username, password] = showLoginDialog();
Note: This is just one example of how to obtain credentials without hardcoding them. Ask your IT department for the available options.