You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is there an existing issue that is already proposing this?
I have searched the existing issues
Is your feature request related to a problem? Please describe it
Currently, there is no way for us to specify the CircleCI Context when triggering a pipeline with this Action. It's possible to set a string representing the name of the CircleCI Context in the GHA_Meta parameter when triggering the pipeline, but that prevents us from sending any additional data through to the workflows.
Describe the solution you'd like
An additional optional parameter named CCI_Context that, when set, will add this parameter to the POST request that triggers the CircleCI Pipeline. This is then used to set the name of the CircleCI Context.
action.yml
We would need an additional input defined:
inputs:
# ...CCI_Context:
required: falsedescription: 'An optional CircleCI context to use when running jobs. Will be available on the CircleCI pipeline as CCI_Context.'
src/lib/CircleCIPipelineTrigger.ts
We adjust this to get a new input and add it to the list of parameters when it is present:
What is the motivation / use case for changing the behavior?
Keys/secrets in CircleCI could be exposed in certain scenarios:
Bad actor commits a change to expose service account keys/secrets in CircleCI when the workflow is ran.
Bad actor pushes commit and triggers the pipeline with their branch, exposing the secret.
Bad actor takes the secret and runs additional operations for bad actor purposes.
Operations are successful until admins are made aware and roll the token.
OpenID Connect (OIDC) solves this issue by introducing a trust relationship between two services, so that only a public key is shown when making service-to-service communication. This would address the issue, but currently CircleCI does not have an OIDC provider to accept inbound requests.
We could use CircleCI Context names in combination with GitHub Environments and GitHub branch protection rules to isolate the service account that is allowed to perform operations on specific GitHub Environments.
Bad actor commits a change to a GitHub Action that tries to expose a service account key/token/secret in CircleCI when it is ran.
Bad actor pushes commit and tries to trigger the pipeline via GitHub Action in their branch.
Results in failure when the GitHub Environment uses protected branches.
(or)
Bad actor commits a change to a GitHub Action that tries to expose a service account key/token/secret in CircleCI when it is ran.
Bad actor pushes commit that tries to run sensitive actions in CircleCI with the protected CircleCI Context name.
Results in failure because the (non protected) GitHub Environment CCI_TOKEN does not have permission to use the CircleCI Context.
The text was updated successfully, but these errors were encountered:
@KyleTryon do you think this is a reasonable ask? I think the technical limitation also applies to CircleCI configurations that can't be configured at runtime within a pipeline/workflow, but the most immediate application I see is for improved security through CircleCI Contexts.
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
Currently, there is no way for us to specify the CircleCI Context when triggering a pipeline with this Action. It's possible to set a string representing the name of the CircleCI Context in the
GHA_Meta
parameter when triggering the pipeline, but that prevents us from sending any additional data through to the workflows.Describe the solution you'd like
An additional optional parameter named
CCI_Context
that, when set, will add this parameter to the POST request that triggers the CircleCI Pipeline. This is then used to set the name of the CircleCI Context.action.yml
We would need an additional
input
defined:src/lib/CircleCIPipelineTrigger.ts
We adjust this to get a new input and add it to the list of parameters when it is present:
Teachability, documentation, adoption, migration strategy
Migration Strategy
Since the parameter is optional, teams would only need to opt-in to using it in a newer version of this Action.
Documentation
The following changes could be made to the README.
(under the "How to use" section)
Add the Pipeline Parameter definitions to your CircleCI config. This data will be entered by the GitHub Action when triggered.
Add the following to the top of your
.circleci/config.yml
file. Ensure you are specifying version2.1
(under the "Inputs" section)
CCI_Context
required: false
description: An optional CircleCI context to use when running jobs. Will be available on the CircleCI pipeline as CCI_Context.
What is the motivation / use case for changing the behavior?
Keys/secrets in CircleCI could be exposed in certain scenarios:
OpenID Connect (OIDC) solves this issue by introducing a trust relationship between two services, so that only a public key is shown when making service-to-service communication. This would address the issue, but currently CircleCI does not have an OIDC provider to accept inbound requests.
We could use CircleCI Context names in combination with GitHub Environments and GitHub branch protection rules to isolate the service account that is allowed to perform operations on specific GitHub Environments.
(or)
The text was updated successfully, but these errors were encountered: