Skip to content
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

ci: hide encryption key from circleci logs #23585

Closed
wants to merge 1 commit into from

Conversation

alexeagle
Copy link
Contributor

Also add a new github token under a new symmetric key.
After this PR lands I'll update the KEY variable held by circleci so that master publishing will work again.

@alexeagle alexeagle added area: build & ci Related the build and CI infrastructure of the project action: review The PR is still awaiting reviews from at least one requested reviewer target: major This PR is targeted for the next major release labels Apr 27, 2018
# $KEY is set on CI only for non-PR builds. See /.circleci/README.md
# Turn off debug mode to avoid echo the key into the log.
set +x
openssl aes-256-cbc -d -in .circleci/github_token -k "${KEY}" -out "${HOME}/.git_credentials"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not related to this PR:
Since this line is CircleCI-specific, it might be better to move it somewhere in .circleci/ and let this script assume that .git_credentials is ready.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm really on the fence about that. I think this line either belongs here (close to where it is used) or in the .circleci/config.yml (close to where the $KEY is configured)

In the latter case it's easier to avoid leaking it. WDYT?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.circleci/config.yml sgtm 😃

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@alexeagle alexeagle added action: merge The PR is ready for merge by the caretaker and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels May 1, 2018
@alexeagle alexeagle force-pushed the publish_snapshot branch 5 times, most recently from 079a6e1 to 5579bdd Compare May 2, 2018 03:44
name: Decrypt github credentials
# See below - ideally this job should not trigger for non-upstream builds
# But since it does, we have to check if $KEY is set before attempting to
# decrypt credentials.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this comment be a TODO?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I doubt circleci will fix this, I haven't seen a lot of movement on issues I've escalated with them, and this would be low on our list :(

@@ -158,6 +158,10 @@ jobs:
publish_snapshot:
<<: *job_defaults
steps:
- run:
name: Skip this job for Pull Requests
command: '[[ -v CIRCLE_PR_NUMBER ]] && circleci step halt || true'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not akso check that we are on angular/angular?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could ... but we have that logic inside publish-build-artifacts as well.
I certainly wouldn't want to duplicate the logic more than necessary.
This guard definitely has to be here since the decryption fails otherwise. I think I'd rather leave most of the logic in the shell script rather than the circle config.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fine with me.
(Wouldn't the decryption fail as well if this is not angular/angular?)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like your whisper font :)
I guess you are right, this task will fail if you set up circleci for your fork of Angular. And that seems like a reasonable thing to do. Will update...

@alexeagle alexeagle removed the action: merge The PR is ready for merge by the caretaker label May 2, 2018
@IgorMinar IgorMinar added the action: merge The PR is ready for merge by the caretaker label May 2, 2018
@IgorMinar IgorMinar closed this in b45fa5e May 2, 2018
alexeagle added a commit to alexeagle/angular that referenced this pull request May 4, 2018
alexeagle added a commit that referenced this pull request May 4, 2018
alexeagle added a commit to alexeagle/angular that referenced this pull request May 4, 2018
IgorMinar pushed a commit that referenced this pull request May 4, 2018
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: build & ci Related the build and CI infrastructure of the project cla: yes target: major This PR is targeted for the next major release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants