Skip to content

Avoid eval for externally supplied Tekton task parameters #874

Description

@coderabbitai

Summary

Several AWS Tekton tasks construct a mapt command as a shell string and invoke it with eval. Parameters supplied to the Task can therefore be reinterpreted by the shell during evaluation rather than treated strictly as command arguments.

Required changes

Refactor the command construction in the affected AWS Tekton tasks to avoid eval and pass arguments directly using a safely quoted mechanism appropriate for the script shell (for example, a Bash argument array where Bash is available).

Affected areas:

  • tkn/template/infra-aws-ocp-snc.yaml
  • tkn/infra-aws-ocp-snc.yaml
  • tkn/template/infra-aws-rhel.yaml
  • tkn/infra-aws-rhel.yaml

Keep template and generated/deployed manifests consistent.

Rationale

Task parameters are externally supplied input. Evaluating an interpolated command string can allow shell syntax in parameter values (such as command substitutions, backticks, or quote characters) to alter command execution.

Acceptance criteria

  • No affected task invokes a command assembled from Task parameters via eval.
  • Task parameter values are passed as literal CLI arguments.
  • The OCP SNC and RHEL template and deployed manifests remain behaviorally aligned.
  • Existing supported create and destroy command options continue to be forwarded correctly.

Backlinks

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions