Fix bug: parse pipeline config as data instead of sourcing it as shell - #88
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Signed-off-by: Devin <devin@cognition.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
run_full_pipeline.sh,run_bteq_pipeline.shandrun_sas_pipeline.shall didsource config/pipeline_config.cfg, so anything written into the config ran as bash under the ETL service account (the file itself relied on$(date ...)). Anyone who can edit the config (shared deploy dir, group-writable file, compromised upstream) gets code execution with the account's DBALLprivileges.Fix: the config is now pure
KEY=VALUEdata and is read by a newconfig/load_pipeline_config.shthat never evaluates it:load_pipeline_config.sh:KEY=VALUElines (comments/blank allowed) whereKEYis in a fixed allow-list (TD_*,DB_*,SAS_*,PIPELINE_HOME,LOOKBACK_MONTHS,RISK_SCORE_THRESHOLD,LOG_LEVEL); unknown keys (e.g.PATH) are rejected$ ` \ ; | & < > ( ) { } " '; integers/paths/LOG_LEVEL are type-checkedprintf -v+export, noeval/sourceSAS_BATCH,BTEQ_DIR,SAS_DIR,LOG_DIR,ARCHIVE_DIR, andRUN_DATE/RUN_TIMESTAMP(kept if already set so sub-pipelines share the orchestrator's run stamp)TD_USERNAMEfrom the environment still overrides the file default, as beforepipeline_config.cfgloses its shebang,exports,${...}references and$(date)lines; every consumer variable name is unchanged.Verified locally: normal load yields the same variable set as before;
TD_SERVER="$(touch /tmp/PWNED)", a baretouch ...line,PATH=/evil, and a0666config are all rejected with a non-zero exit and nothing executed;run_full_pipeline.sh --dry-runruns end-to-end.Devin-Org: engineering