Prevent logging a specific command in Concourse CI

Viewed 1369

I have a shell-based concourse task which uses semi-sensitive credentials (a key to a test server) in one of its commands. I'd like to avoid this being logged in the task output.

The gist of the pipeline is:

jobs:
- name: foobar
  plan:
  <...>
  - task: build
    config:
      platform: linux
      image_resource:
        type: docker-image
        source:
          repository: ubuntu
      <...>
      run:
        path: bash
        args:
        - -exc
        - |
          command-which-is-ok-to-print
          foobar {{my-secret-data}}               # <-- hide this one!
          another-command-which-is-ok-to-print

Currently the output appears as:

+ command-which-is-ok-to-print
results of first command which are OK to print
+ foobar "oh-no-secret-data-here!"                  <-- hide this one!
more results which are OK to print
+ another-command-which-is-ok-to-print
even more results which are OK to print

Is there a way to suppress printing this specific line?

1 Answers
Related