dotCMS / core

Headless/Hybrid Content Management System for Enterprises
http://dotcms.com
Other
812 stars 461 forks source link

Create GH User for CI/CD #27392

Open dsilvam opened 5 months ago

dsilvam commented 5 months ago

Parent Issue

No response

Task

There's a need for a new GH User to be used to run the different GH actions on the CICD pipeline. It will need a PAT with limited scope, including pushing to master. This one the CICD_GITHUB_TOKEN can go away.

Proposed Objective

Core Features

Proposed Priority

Priority 2 - Important

Acceptance Criteria

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

### Tasks
- [ ] Create new secrets in core repo
- [x] Create new github user to be our machine user
- [x] Store credentials for new machine user in password DB
- [ ] Update references in github actions
- [ ] Cleanup: Delete old secrets in core repo
sfreudenthaler commented 5 months ago

Ok folks, here's the plan. I spoke with Cloud Eng and they're good with the general approach.

erickgonzalez commented 5 months ago

Keep in mind that when we remove all existing PAT it will affect LTS as well

sfreudenthaler commented 5 months ago

Keep in mind that when we remove all existing PAT it will affect LTS as well

Oh good point @erickgonzalez . So the existing ones would work till we nuked victors old PATs. But I should add that to the scope of this ticket.

As for making sure things keep working... What's the playbook to update the LTS pipelines? Are they just more places in the yaml on master? Or do I have to go into a specific branch and put up a PR there?

sfreudenthaler commented 5 months ago
  • [x] Add the new machine user to our dotCMS github org

Note on this one that I just added to the org. I did not add to any existing group because none stood out as an obvious fit

sfreudenthaler commented 5 months ago

We created new secrets in core repo

image

sfreudenthaler commented 5 months ago

All set... A few notes here

FYI @cobbg and @mbiuki

  1. Key rotation should be easy (just update the CI_MACHINE_TOKEN value and voilà, but it's not automated so rotation will be manual at this point in time
  2. The credentials, MFA, and PAT for the github account are stored in Keeper under the GitHub Machine User folder. All of the cloud engineering team has access to it. You can ask them for help if you need to get into the account for whatever reason.
  3. Scope of the PAT was limited to repo:status, repo_deployment, and public_repo
  4. We granted the machine user Writer role to the core repo.
erickgonzalez commented 5 months ago

Keep in mind that when we remove all existing PAT it will affect LTS as well

Oh good point @erickgonzalez . So the existing ones would work till we nuked victors old PATs. But I should add that to the scope of this ticket.

As for making sure things keep working... What's the playbook to update the LTS pipelines? Are they just more places in the yaml on master? Or do I have to go into a specific branch and put up a PR there?

I think @victoralfaro-dotcms is the one can answer this better

sfreudenthaler commented 5 months ago

Also added secrets to plugin-seeds repo by slack request from @victoralfaro-dotcms and @dsilvam

NOTE

Used the same values for user and token as I did with core since it's for the same use
sfreudenthaler commented 5 months ago

Request by @victoralfaro-dotcms to alos add the secret to the enterprise repo

sfreudenthaler commented 5 months ago

Request by @victoralfaro-dotcms to alos add the secret to the enterprise repo

✅ Done

sfreudenthaler commented 4 months ago

added workflow permission to the existing token by @victoralfaro-dotcms's request