diff --git a/.github/workflows/test_custom_executor.yml b/.github/workflows/test_custom_executor.yml index ff42d5e..1ab0321 100644 --- a/.github/workflows/test_custom_executor.yml +++ b/.github/workflows/test_custom_executor.yml @@ -18,3 +18,10 @@ jobs: uses: actions/checkout@v4 - run: | echo "Job is run after YSNP verification using image + job checks!" + + Test-job-only-ask-mfa-YSNP: + runs-on: self-hosted + steps: + - name: Check out Repository + uses: actions/checkout@v4 + - run: echo "Job is run after YSNP verification using only user check!" \ No newline at end of file diff --git a/README.md b/README.md index aed00d2..3e7dc35 100644 --- a/README.md +++ b/README.md @@ -497,19 +497,18 @@ Currently, we are experimenting with Github support for YouShallNotPass. This Gi ### Setup -Note that the current limitation is this works for public repositories. For private repos, you will need to modify the `before_script.sh` to provide the appropriate token. +1. Follow [GitHub Self-Hosted Runner Instructions](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/adding-self-hosted-runners) -0. Follow [GitHub Self-Hosted Runner Instructions](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/adding-self-hosted-runners) +2. Download the relevant release from the release section of this project, copy and extract the contents into another folder than actions-runner on your GitHub runner. -1. Download the relevant release from the release section of this project, copy and extract the contents into another folder than actions-runner on your GitHub runner. The following scripts should now exist in the actions-runner folder of your GitHub runner. + - before_script.sh + - generate_jwt.sh + - profile.sh + - youshallnotpass - - before_script.sh <- from YouShallNotPass - - generate_jwt.sh <- from YouShallNotPass - - profile.sh <- from YouShallNotPass +3. Make sure before_script.sh, generate_jwt.sh, and profile.sh have the correct execution privileges (namely make sure they can be executed). -2. Make sure before_script.sh, generate_jwt.sh, and profile.sh have the correct execution privileges (namely make sure they can be executed). - -3. Edit the .env file from the actions-runner folder to contain the following: +4. Edit the .env file from the actions-runner folder to contain the following: ```sh ACTIONS_RUNNER_HOOK_JOB_STARTED=/your/absolute/path/to/before_script.sh @@ -517,15 +516,15 @@ ACTIONS_RUNNER_HOOK_JOB_STARTED=/your/absolute/path/to/before_script.sh According to [GitHub documentation](https://docs.github.com/en/actions/hosting-your-own-runners/managing-self-hosted-runners/running-scripts-before-or-after-a-job#triggering-the-scripts), these scripts should not be in the actions-runner folder. -4. Run before_script.sh to download the necessary dependencies and generate a public-private key pair for the runner. +5. Run before_script.sh to download the necessary dependencies and generate a public-private key pair for the runner. -5. Enable JWT Authentication with your Hashicorp Vault Instance +6. Enable JWT Authentication with your Hashicorp Vault Instance ```sh vault auth enable -path=jwt/github.com jwt ``` -6. Configure JWT authentication to use the public key you just generated in the *certs/public-key.pem* file. +7. Configure JWT authentication to use the public key you just generated in the *certs/public-key.pem* file. ```sh vault write auth/jwt/github.com/config \ @@ -534,7 +533,7 @@ vault write auth/jwt/github.com/config \ jwt_validation_pubkeys="$(cat path/to/certs/public-key.pem)" ``` -7. Configure the default role you created in step 6 using your GitLab projects namespace path. +8. Configure the default role you created in step 6 using your GitLab projects namespace path. ```sh vault write auth/jwt/github.com/role/your-default-role -<