Skip to content

[WIP]process-state: filter out additional contents from state downloads #1126

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

amithkb
Copy link
Contributor

@amithkb amithkb commented Apr 21, 2025

  • Currently _main.json has additional data like defaultTaskVariables which might contain sensitive data which will be open to access for all when download state of the process.
  • Soln: add filters to restrict only non sensitive fields to such state downloads

@amithkb amithkb changed the title process-state: filter out additional contents from state downloads [WIP]process-state: filter out additional contents from state downloads Apr 21, 2025
@ibodrov
Copy link
Collaborator

ibodrov commented Apr 21, 2025

JFYI, Downloading process state is guarded by

private void assertProcessAccess(ProcessEntry pe, String downloadEntity) {

Also, it should be possible to put expressions into defailtTaskVars that fetch the sensitive data (from secrets). This way you'll get explicit control over who can access it and the audit log.

@amithkb
Copy link
Contributor Author

amithkb commented Apr 21, 2025

JFYI, Downloading process state is guarded by

private void assertProcessAccess(ProcessEntry pe, String downloadEntity) {

Yes. The current usage is like global public project is present, where end user process runs with end-user Ids. But the requirement is, need to filter certain content even from the process initiator.

Also, it should be possible to put expressions into defailtTaskVars that fetch the sensitive data (from secrets). This way you'll get explicit control over who can access it and the audit log.

defaultTaskVariables are injected through policies which is available only inside the task

@ibodrov
Copy link
Collaborator

ibodrov commented Apr 21, 2025

I don't see how filtering _main.json would help in this case -- the process initiator will have the ability to get the default vars anyway by just printing them out from within the flow?

I didn't test it, but perhaps we can put something like ${crypto.exportAsString(...)} into the policy instead of the actual value? So it is not passed in _main.json but rather fetched at runtime?

@amithkb amithkb added the wip Work in progress, do not merge label Apr 21, 2025
@ibodrov
Copy link
Collaborator

ibodrov commented Apr 21, 2025

Something like

configuration:
  runtime: "concord-v2"

flows:
  default:
    - script: js
      body: |
        let vars = context.processConfiguration().defaultTaskVariables()
        print(vars)

All I am saying is that defaultTaskVars is not a good mechanism to pass secrets.

@amithkb
Copy link
Contributor Author

amithkb commented Apr 22, 2025

Yeah. Requirement is directly inject the secrets inside the task only and users should not be able to print it or use it outside the task for any other purpose. Here secrets are maintained by admins. Any good way to acheive this?

@ibodrov
Copy link
Collaborator

ibodrov commented Apr 22, 2025

A better way is to change tasks to accept secret references (orgName/secretName) instead of secret values. And then fetch the secret values directly in tasks at runtime. For example, that is how Ansible tasks fetches the keys, if I remember it correctly.

And then secret references can be defaultTaskVars.

@amithkb
Copy link
Contributor Author

amithkb commented Apr 22, 2025

A better way is to change tasks to accept secret references (orgName/secretName) instead of secret values. And then fetch the secret values directly in tasks at runtime. For example, that is how Ansible tasks fetches the keys, if I remember it correctly.

And then secret references can be defaultTaskVars.

But Secret is public and anyone can access it outside the task as well. For example slack token which has to be used inside the slack task provided by concord admin only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wip Work in progress, do not merge
Development

Successfully merging this pull request may close these issues.

2 participants