1*643c525dSBrad Bishop# Continuous integration and authorization for OpenBMC 2*643c525dSBrad Bishop 3*643c525dSBrad BishopAuthor: 4*643c525dSBrad Bishop Brad Bishop !radsquirrel 5*643c525dSBrad BishopPrimary assignee: 6*643c525dSBrad Bishop Brad Bishop !radsquirrel 7*643c525dSBrad BishopOther contributors: 8*643c525dSBrad Bishop None 9*643c525dSBrad BishopCreated: 10*643c525dSBrad Bishop 2019-01-30 11*643c525dSBrad Bishop 12*643c525dSBrad Bishop## Problem Description 13*643c525dSBrad BishopThe OpenBMC project maintains a number of Jenkins CI jobs to ensure incoming 14*643c525dSBrad Bishopcontributions to the project source code meet a level of quality. Incoming 15*643c525dSBrad Bishopcontributions can be made by the general public - anyone with a GitHub account. 16*643c525dSBrad BishopHowever unlikely, it is possible for a bad actor to make code submissions that 17*643c525dSBrad Bishopattempt to compromise project resources, e.g. build systems, and as such some 18*643c525dSBrad Bishopamount of authorization of contributors must occur to provide some level of 19*643c525dSBrad Bishopprotection from potential bad actors. 20*643c525dSBrad Bishop 21*643c525dSBrad Bishop 22*643c525dSBrad BishopThe project already has contributor authorization for CI. This proposal serves 23*643c525dSBrad Bishopto describe the drawbacks of the current solution and propose an alternative 24*643c525dSBrad Bishopthat addresses those drawbacks. 25*643c525dSBrad Bishop 26*643c525dSBrad Bishop## Background and References 27*643c525dSBrad BishopThe current authorization solution checks the user for membership in the 28*643c525dSBrad Bishopopenbmc/general-developers GitHub team. If the contributor is a member of the 29*643c525dSBrad Bishopteam (or a general-developers sub-team), the automated CI processes are 30*643c525dSBrad Bishoptriggered without any human intervention. If the contributor is not a member of 31*643c525dSBrad Bishopthe general-developers team, manual intervention (ok-to-test) is required by a 32*643c525dSBrad Bishopproject maintainer to trigger the automated CI processes. 33*643c525dSBrad Bishop 34*643c525dSBrad Bishop 35*643c525dSBrad BishopAdditonal reading: 36*643c525dSBrad Bishophttps://en.wikipedia.org/wiki/Continuous_integration 37*643c525dSBrad Bishophttps://jenkins.io/ 38*643c525dSBrad Bishophttps://help.github.com/articles/about-organizations/ 39*643c525dSBrad Bishop 40*643c525dSBrad Bishop## Requirements 41*643c525dSBrad BishopThe existing method for authorization has a singular problem - the GitHub 42*643c525dSBrad Bishoporganization owner role. In order for contributors to be added to the 43*643c525dSBrad Bishopopenbmc/general-developers GitHub team, the contributor must first be a member 44*643c525dSBrad Bishopof the openbmc GitHub organization. Only organization owners can invite GitHub 45*643c525dSBrad Bishopusers to become members of an organization. Organization owners have 46*643c525dSBrad Bishopunrestricted access to all aspects of the project - it would be unwise to bestow 47*643c525dSBrad Bishoporganization ownership for the sole purpose of enabling 48*643c525dSBrad Bishopopenbmc/general-developers group membership administrative capability. 49*643c525dSBrad Bishop 50*643c525dSBrad Bishop 51*643c525dSBrad BishopAn alternative authorization method for CI should: 52*643c525dSBrad Bishop - Not require the GitHub organization owner role to administer the list of 53*643c525dSBrad Bishop users authorized for CI. 54*643c525dSBrad Bishop - Enable a hierarchical trust model for user authorization (groups nested 55*643c525dSBrad Bishop within groups). 56*643c525dSBrad Bishop 57*643c525dSBrad Bishop## Proposed Design 58*643c525dSBrad BishopThe proposal is to simply migrate the current openbmc/general-developers GitHub 59*643c525dSBrad Bishopteam, and all subordinate teams, to Gerrit groups: 60*643c525dSBrad Bishop 61*643c525dSBrad Bishopgroup: `openbmc/ci-authorized` 62*643c525dSBrad Bishop 63*643c525dSBrad Bishopgroup: `xyzcorp/ci-authorized` 64*643c525dSBrad Bishop 65*643c525dSBrad Bishopgroup: `abccorp/ci-authorized` 66*643c525dSBrad Bishop 67*643c525dSBrad BishopThe openbmc/ci-authorized group can contain users that are not associated with 68*643c525dSBrad Bishopany specific organization, as well as organizational groups: 69*643c525dSBrad Bishop 70*643c525dSBrad Bishopgroup: `openbmc/ci-authorized` contains -> 71*643c525dSBrad Bishop 72*643c525dSBrad Bishop group `xyzcorp/ci-authorized` 73*643c525dSBrad Bishop 74*643c525dSBrad Bishop group `abccorp/ci-authorized` 75*643c525dSBrad Bishop 76*643c525dSBrad Bishop user `nancy` 77*643c525dSBrad Bishop 78*643c525dSBrad Bishop user `joe` 79*643c525dSBrad Bishop 80*643c525dSBrad BishopThis proposal also specifies a convention for administration of organizational 81*643c525dSBrad Bishopgroups: 82*643c525dSBrad Bishop 83*643c525dSBrad Bishopgroup: `xyzcorp/ci-authorized-owners` administers -> `xyzcorp/ci-authorized` 84*643c525dSBrad Bishop 85*643c525dSBrad Bishopgroup: `abccorp/ci-authorized-owners` administers -> `abccorp/ci-authorized` 86*643c525dSBrad Bishop 87*643c525dSBrad Bishopgroup: `openbmc/ci-authorized` administers -> `openbmc/ci-authorized` 88*643c525dSBrad Bishop 89*643c525dSBrad BishopFinally, any Jenkins CI jobs must be updated to test for membership of the 90*643c525dSBrad BishopGerrit group instead of the GitHub team. 91*643c525dSBrad Bishop 92*643c525dSBrad BishopNew organizational groups (and associated owner groups) will be created when a 93*643c525dSBrad BishopCCLA is signed and accepted by the project. 94*643c525dSBrad Bishop 95*643c525dSBrad Bishop## Alternatives Considered 96*643c525dSBrad BishopAssigning GitHub organization owner roles to organizational group administrators 97*643c525dSBrad Bishopwas considered but is a major violation of the least-privilege-required 98*643c525dSBrad Bishopprinciple. 99*643c525dSBrad Bishop 100*643c525dSBrad Bishop## Impacts 101*643c525dSBrad BishopGitHub has vastly superior load balancing and backup capability so there is a 102*643c525dSBrad Bishoppotential for decreased service availability and data loss. 103*643c525dSBrad Bishop 104*643c525dSBrad Bishop## Testing 105*643c525dSBrad BishopDeploy on a live production server 106