Skip to content

Commit

Permalink
push changes
Browse files Browse the repository at this point in the history
  • Loading branch information
karankohli-cf committed Apr 4, 2024
2 parents 520c18c + 3d71f35 commit b9618cd
Show file tree
Hide file tree
Showing 41 changed files with 5,287 additions and 200 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: release

on:
push:
tags:
- '*'

permissions:
id-token: write # Undocumented OIDC support.
packages: write # To publish container images to GHCR
contents: write # To create a release

jobs:
release:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4 # v3.5.2

- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: '1.20'
check-latest: true

- uses: sigstore/cosign-installer@e1523de7571e31dbe865fd2e80c5c7c23ae71eb4 # v3.4.0

- uses: ko-build/setup-ko@ace48d793556083a76f1e3e6068850c1f4a369aa # v0.6

- run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.workflow }} --password-stdin

- run: ko publish -B ./cmd/allstar --tags ${{ github.ref_name }} --image-refs allstar.ref
env:
KO_DOCKER_REPO: ghcr.io/${{ github.repository_owner }}
- run: ko publish -B ./cmd/allstar --tags ${{ github.ref_name }}-busybox --image-refs allstar-busybox.ref
env:
KO_DOCKER_REPO: ghcr.io/${{ github.repository_owner }}
KO_DEFAULTBASEIMAGE: cgr.dev/chainguard/busybox
- run: |
echo "signing $(cat allstar.ref)"
cosign sign --yes -a git_sha="$GITHUB_SHA" "$(cat allstar.ref)"
echo "signing $(cat allstar-busybox.ref)"
cosign sign --yes -a git_sha="$GITHUB_SHA" "$(cat allstar-busybox.ref)"
- run: |
gh release create ${{ github.ref_name }} --notes "Images:
* ghcr.io/${{ github.repository_owner }}/allstar:${{ github.ref_name }}
* ghcr.io/${{ github.repository_owner }}/allstar:${{ github.ref_name }}-busybox"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Binary file added allstar
Binary file not shown.
13 changes: 13 additions & 0 deletions app-prod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
runtime: custom
env: flex
manual_scaling:
instances: 1
resources:
cpu: 2
memory_gb: 12
disk_size_gb: 100
env_variables:
APP_ID: 119816
KEY_SECRET: "gcpsecretmanager://projects/allstar-ossf/secrets/allstar-private-key?decoder=bytes"
DO_NOTHING_ON_OPT_OUT: true
ALLSTAR_NUM_WORKERS: 1
13 changes: 13 additions & 0 deletions app-staging.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
runtime: custom
env: flex
service: staging
manual_scaling:
instances: 1
resources:
cpu: 2
memory_gb: 12
disk_size_gb: 100
env_variables:
APP_ID: 166485
KEY_SECRET: "gcpsecretmanager://projects/allstar-ossf/secrets/allstar-staging-private-key?decoder=bytes"
ALLSTAR_NUM_WORKERS: 1
5 changes: 3 additions & 2 deletions cmd/allstar/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ func main() {
supportedPoliciesMsg += policyName
}
}
boolArgPtr := flag.Bool("once", false, "Run EnforceAll once, instead of in a continuous loop.")
var runOnce bool
flag.BoolVar(&runOnce, "once", false, "Run EnforceAll once, instead of in a continuous loop.")

specificPolicyArg := flag.String("policy", "", fmt.Sprintf("Run a specific policy check. Supported policies: %s", supportedPoliciesMsg))
specificRepoArg := flag.String("repo", "", "Run on a specific \"owner/repo\". For example \"ossf/allstar\"")
Expand All @@ -79,7 +80,7 @@ func main() {
Msg(fmt.Sprintf("Allstar will only run on repository %s", *specificRepoArg))
}

if *boolArgPtr {
if runOnce {
_, err := enforce.EnforceAll(ctx, ghc, *specificPolicyArg, *specificRepoArg)
if err != nil {
log.Fatal().
Expand Down
73 changes: 34 additions & 39 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,20 @@ toolchain go1.21.4
require (
github.com/Masterminds/semver/v3 v3.2.1
github.com/bradleyfalzon/ghinstallation/v2 v2.10.0
github.com/evanphx/json-patch v5.9.0+incompatible
github.com/evanphx/json-patch/v5 v5.9.0
github.com/gobwas/glob v0.2.3
github.com/google/go-cmp v0.6.0
github.com/google/go-github/v50 v50.2.0
github.com/google/go-github/v59 v59.0.0
github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79
github.com/ossf/scorecard/v4 v4.10.5
github.com/ossf/allstar v0.0.0-20240327225642-3d71f351242f
github.com/ossf/scorecard/v4 v4.13.1
github.com/rhysd/actionlint v1.6.27
github.com/rs/zerolog v1.32.0
github.com/shurcooL/githubv4 v0.0.0-20210725200734-83ba7b4c9228
gocloud.dev v0.37.0
golang.org/x/sync v0.6.0
sigs.k8s.io/yaml v1.3.0
sigs.k8s.io/yaml v1.4.0
)

require (
Expand All @@ -28,11 +30,13 @@ require (
cloud.google.com/go/iam v1.1.6 // indirect
cloud.google.com/go/secretmanager v1.11.5 // indirect
cloud.google.com/go/storage v1.39.1 // indirect
github.com/BurntSushi/toml v1.2.1 // indirect
github.com/CycloneDX/cyclonedx-go v0.7.0 // indirect
dario.cat/mergo v1.0.0 // indirect
github.com/BurntSushi/toml v1.3.2 // indirect
github.com/CycloneDX/cyclonedx-go v0.7.2 // indirect
github.com/Microsoft/go-winio v0.6.1 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230217124315-7d5c6f04bbb8 // indirect
github.com/acomagu/bufpipe v1.0.3 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20230923063757-afb1ddc0824c // indirect
github.com/acomagu/bufpipe v1.0.4 // indirect
github.com/anchore/go-struct-converter v0.0.0-20230627203149-c72ef8859ca9 // indirect
github.com/aws/aws-sdk-go v1.50.36 // indirect
github.com/aws/aws-sdk-go-v2 v1.25.3 // indirect
github.com/aws/aws-sdk-go-v2/config v1.27.7 // indirect
Expand All @@ -49,75 +53,69 @@ require (
github.com/aws/aws-sdk-go-v2/service/sts v1.28.4 // indirect
github.com/aws/smithy-go v1.20.1 // indirect
github.com/bombsimon/logrusr/v2 v2.0.1 // indirect
github.com/cloudflare/circl v1.3.7 // indirect
github.com/cloudflare/circl v1.3.3 // indirect
github.com/containerd/stargz-snapshotter/estargz v0.14.3 // indirect
github.com/containerd/typeurl v1.0.2 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/docker/cli v23.0.5+incompatible // indirect
github.com/containerd/typeurl/v2 v2.1.1 // indirect
github.com/cyphar/filepath-securejoin v0.2.4 // indirect
github.com/docker/cli v24.0.4+incompatible // indirect
github.com/docker/distribution v2.8.2+incompatible // indirect
github.com/docker/docker v25.0.0+incompatible // indirect
github.com/docker/docker-credential-helpers v0.7.0 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/fatih/color v1.16.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/frankban/quicktest v1.14.5 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.4.1 // indirect
github.com/go-git/go-git/v5 v5.5.2 // indirect
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 // indirect
github.com/go-git/go-billy/v5 v5.5.0 // indirect
github.com/go-git/go-git/v5 v5.9.0 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/goark/errs v1.3.2 // indirect
github.com/goark/go-cvss v1.6.6 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/google/go-containerregistry v0.15.2 // indirect
github.com/google/go-github/v38 v38.1.0 // indirect
github.com/google/go-containerregistry v0.16.1 // indirect
github.com/google/go-github/v53 v53.2.0 // indirect
github.com/google/go-github/v60 v60.0.0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/osv-scanner v1.2.1-0.20230302232134-592acbc2539b // indirect
github.com/google/pprof v0.0.0-20240117000934-35fc243c5815 // indirect
github.com/google/osv-scanner v1.4.1 // indirect
github.com/google/s2a-go v0.1.7 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/google/wire v0.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.2 // indirect
github.com/h2non/filetype v1.1.3 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-hclog v1.5.0 // indirect
github.com/hashicorp/go-retryablehttp v0.7.4 // indirect
github.com/imdario/mergo v0.3.16 // indirect
github.com/ianlancetaylor/demangle v0.0.0-20230524184225-eabc099b10ab // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jedib0t/go-pretty/v6 v6.4.4 // indirect
github.com/jedib0t/go-pretty/v6 v6.4.7 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/kevinburke/ssh_config v1.2.0 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/matryer/is v1.4.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-runewidth v0.0.15 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/moby/buildkit v0.11.4 // indirect
github.com/onsi/ginkgo/v2 v2.9.4 // indirect
github.com/onsi/gomega v1.27.6 // indirect
github.com/moby/buildkit v0.12.2 // indirect
github.com/opencontainers/go-digest v1.0.0 // indirect
github.com/opencontainers/image-spec v1.1.0-rc3 // indirect
github.com/package-url/packageurl-go v0.1.1-0.20220428063043-89078438f170 // indirect
github.com/pjbgf/sha1cd v0.2.3 // indirect
github.com/owenrumney/go-sarif/v2 v2.2.2 // indirect
github.com/package-url/packageurl-go v0.1.1 // indirect
github.com/pjbgf/sha1cd v0.3.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/rogpeppe/go-internal v1.12.0 // indirect
github.com/sergi/go-diff v1.3.1 // indirect
github.com/shurcooL/graphql v0.0.0-20200928012149-18c5c3165e3a // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/skeema/knownhosts v1.1.0 // indirect
github.com/skeema/knownhosts v1.2.1 // indirect
github.com/spdx/gordf v0.0.0-20221230105357-b735bd5aac89 // indirect
github.com/spdx/tools-golang v0.4.0 // indirect
github.com/stretchr/testify v1.9.0 // indirect
github.com/spdx/tools-golang v0.5.3 // indirect
github.com/vbatts/tar-split v0.11.3 // indirect
github.com/xanzy/go-gitlab v0.83.0 // indirect
github.com/xanzy/go-gitlab v0.93.1 // indirect
github.com/xanzy/ssh-agent v0.3.3 // indirect
go.opencensus.io v0.24.0 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.49.0 // indirect
Expand All @@ -131,11 +129,10 @@ require (
golang.org/x/net v0.22.0 // indirect
golang.org/x/oauth2 v0.18.0 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.18.0 // indirect
golang.org/x/text v0.14.0 // indirect
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.17.0 // indirect
golang.org/x/vuln v0.0.0-20230118164824-4ec8867cc0e6 // indirect
golang.org/x/vuln v1.0.1 // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
google.golang.org/api v0.169.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
Expand All @@ -145,8 +142,6 @@ require (
google.golang.org/grpc v1.62.1 // indirect
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
gotest.tools/v3 v3.5.1 // indirect
mvdan.cc/sh/v3 v3.6.0 // indirect
mvdan.cc/sh/v3 v3.7.0 // indirect
)
Loading

0 comments on commit b9618cd

Please sign in to comment.