Create hardcode.py#17
Conversation
| # ruleid: python-sqlalchemy-hardcoded-secret | ||
| create_engine("postgres://user:pass@localhost:5432/biz") | ||
| # ruleid: python-sqlalchemy-hardcoded-secret | ||
| create_engine("mysql+pymysql://root:aaaa@localhost:3306/aaa?charset=utf8") |
There was a problem hiding this comment.
A secret is hard-coded in the application. Secrets stored in source code, such as credentials, identifiers, and other types of sensitive data, can be leaked and used by internal or external malicious actors. Use environment variables to securely provide credentials and other secrets or retrieve them from a secure vault or Hardware Security Module (HSM).
View Dataflow Graph
flowchart LR
classDef invis fill:white, stroke: none
classDef default fill:#e7f5ff, color:#1c7fd6, stroke: none
subgraph File0["<b>hardcode.py</b>"]
direction LR
%% Source
subgraph Source
direction LR
v0("<b>[Line: 7]</b> #quot;mysql+pymysql://root:aaaa@localhost:3306/aaa?charset=utf8#quot;")
end
%% Intermediate
%% Sink
subgraph Sink
direction LR
v1("<b>[Line: 7]</b> create_engine(#quot;mysql+pymysql://root:aaaa@localhost:3306/aaa?charset=utf8#quot;)")
end
end
%% Class Assignment
Source:::invis
Sink:::invis
File0:::invis
%% Connections
Source --> Sink
%% Clickable
click v0 href "https://github.com/sebastianrevuelta/Chess/blob/b0993b078359223c11db083a725278c4293cb79d/hardcode.py#L7" "View in source" _blank
click v1 href "https://github.com/sebastianrevuelta/Chess/blob/b0993b078359223c11db083a725278c4293cb79d/hardcode.py#L7" "View in source" _blank
|
|
||
|
|
||
| # ruleid: python-sqlalchemy-hardcoded-secret | ||
| create_engine("postgres://user:pass@localhost:5432/biz") |
There was a problem hiding this comment.
A secret is hard-coded in the application. Secrets stored in source code, such as credentials, identifiers, and other types of sensitive data, can be leaked and used by internal or external malicious actors. Use environment variables to securely provide credentials and other secrets or retrieve them from a secure vault or Hardware Security Module (HSM).
View Dataflow Graph
flowchart LR
classDef invis fill:white, stroke: none
classDef default fill:#e7f5ff, color:#1c7fd6, stroke: none
subgraph File0["<b>hardcode.py</b>"]
direction LR
%% Source
subgraph Source
direction LR
v0("<b>[Line: 5]</b> #quot;postgres://user:pass@localhost:5432/biz#quot;")
end
%% Intermediate
%% Sink
subgraph Sink
direction LR
v1("<b>[Line: 5]</b> create_engine(#quot;postgres://user:pass@localhost:5432/biz#quot;)")
end
end
%% Class Assignment
Source:::invis
Sink:::invis
File0:::invis
%% Connections
Source --> Sink
%% Clickable
click v0 href "https://github.com/sebastianrevuelta/Chess/blob/b0993b078359223c11db083a725278c4293cb79d/hardcode.py#L5" "View in source" _blank
click v1 href "https://github.com/sebastianrevuelta/Chess/blob/b0993b078359223c11db083a725278c4293cb79d/hardcode.py#L5" "View in source" _blank
No description provided.