Repository navigation
Create kubernetes sidecar Manifest #5332
|
Hello team. How do i use GitHub app to authenticate for a scan? From the documentation I get that it is possible by using :
I am implementing a page running on Kubernetes, and trying to make Scorecard run as a sidecar-job when a scan is called. This have worked with PAT, but I want the GitHub App for better ratelimit and reliability. This is my creation of the job: |
Replies: 4 comments 4 replies
|
It's just three environment variables. There's no CLI flag for it: export GITHUB_APP_ID=123456 # App ID, from the app's settings page
export GITHUB_APP_INSTALLATION_ID=7890123 # from the installation URL: github.com/settings/installations/<id>
export GITHUB_APP_KEY_PATH=/path/to/app.private-key.pem # the .pem you generated for the app
scorecard --repo=github.com/OWNER/REPOTwo gotchas, from
The App needs to be installed on the account or org that owns the repos you scan, with read access to repository contents and metadata. The installation ID is per account it's installed on. |
|
Store the App ID and installation ID as plain env vars in the Job spec, since they aren't secret. Keep the .pem in a Kubernetes Secret and mount it as a file, which is what your manifest already does. If you use GitOps, sealed-secrets or external-secrets is cleaner than a plain .env. Also make sure GITHUB_TOKEN isn't set in the pod, or the App settings get ignored. |
|
How can i create my own checks. Is there documentation about this somewhere? Can I create a file formatted so that it gets read and outputted like the standard scorecard checks? |
|
Is it possible to scan private repos? |
yes but keep them out of the source code itself. Read the app ID and installation ID from your config or environment when you build the Job, then put them into the manifest's env. The key file stays in the mounted secret, and GITHUB_APP_KEY_PATH should point to its path.
Scorecard only reads GITHUB_APP_ID, GITHUB_APP_INSTALLATION_ID and GITHUB_APP_KEY_PATH from the environment (roundtripper.go ) so as long as the manifest sets those three, your code does not need to hold any secret.