Repository navigation
fix(rocprofiler-sdk): detect and filter out keywords from ENV VARs before writing into DB - #10550
Conversation
✅ All Policy Checks Passed
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
There was a problem hiding this comment.
Pull request overview
This PR updates rocprofiler-sdk’s rocpd output generation to avoid persisting potentially sensitive environment variables by filtering env var names against a keyword list before serializing them into the DB “environment” JSON field.
Changes:
- Add a keyword-based filter to exclude env vars whose names appear potentially sensitive (case-insensitive substring match).
- Log when an env var is excluded due to the sensitive-keyword filter (instead of storing it in the JSON persisted to DB).
Suppressed comments (1)
projects/rocprofiler-sdk/source/lib/output/generateRocpd.cpp:1323
- This branch claims the env var was "sanitized" due to a semi-colon, but the value is not actually modified and the variable is not written to the JSON (and thus not stored). Update the message to reflect the actual behavior (excluded/skipped), or implement real sanitization.
else if(eval.find(';') != std::string::npos)
{
ROCP_INFO << fmt::format(
"Env variable {} was sanitized due to semi-colon in the value", evar);
}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
a22ea58 to
a821399
Compare
a821399 to
7d32d8a
Compare
bgopesh
left a comment
There was a problem hiding this comment.
we can add few more maybe:
access_key
access_token
authorization
bearer
client_secret
encryption_key
session_key
signing_key
ssh_key
Since we already included |
|
maybe |
fc14453 to
ae03006
Compare
…om writing into DB
…short forms of password
3e1d87c to
ce53f78
Compare
TheRock Submodule Bump ActivityNewest first
|
…th-cursor-fixes-help Brings the branch up to date with develop (1,887 commits). There were no conflicts. The only rocpd change on develop since the branch point is #10550's environment-variable filter in generateRocpd.cpp, which merges alongside the replay-pass changes. The rocpd schema SQL is unchanged on develop, so the frozen 3.0.4 copy still matches it. Co-authored-by: Vivek Kale <vivek.kale@amd.com>



Motivation
We don't want to save all env vars, in case there are sensitive keys set
Technical Details
Identify if env var contains a sensitive keyword. Exclude from saving it into the DB if included in the list.
This is not an exhaustive list. We can add more keywords to the list over time.
Issue Tracking
JIRA ID: AIPROFSDK-1050
Test Plan
N/A
Test Result
N/A
Submission Checklist