Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CodeQL for SAST #1623

Merged
merged 3 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci-latest-helm-chart-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
paths:
- "deployments/helm/**"

# Declare default permissions as read only.
permissions: read-all

jobs:
publish-chart:
name: Update Stable Helm Chart With Latest Changes
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci-latest-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ on:
branches:
- "v*"

# Declare default permissions as read only.
permissions: read-all

jobs:
check:
name: Check what pkg were updated
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci-operator-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ on:
branches:
- "v*"

# Declare default permissions as read only.
permissions: read-all

env:
PLATFORM: linux/amd64,linux/arm64/v8
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci-stable-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ on:
branches: [main]
paths:
- "STABLE-RELEASE"
# - ".github/workflows/ci-stable-release.yml"

# Declare default permissions as read only.
permissions: read-all

jobs:
push-stable-version:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ci-systemd-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
tags:
- "*"

permissions:
contents: write
# Declare default permissions as read only.
permissions: read-all

jobs:
goreleaser:
Expand All @@ -33,6 +33,8 @@ jobs:

- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
permissions:
contents: write
with:
distribution: goreleaser
version: v1.12.2
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/ci-test-controllers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
- "pkg/**"
- ".github/workflows/ci-test-controllers.yml"

# Declare default permissions as read only.
permissions: read-all

jobs:
kubearmor-controller-test:
name: Build and Test KubeArmorController Using Ginkgo
Expand Down Expand Up @@ -43,7 +46,7 @@ jobs:
run: |
go install -mod=mod github.com/onsi/ginkgo/v2/ginkgo
make -C tests/k8s_env/
timeout-minutes: 20
timeout-minutes: 30

- name: Get karmor sysdump
if: ${{ failure() }}
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/ci-test-ginkgo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ on:
- ".github/workflows/ci-test-ginkgo.yml"
- "pkg/KubeArmorOperator/**"
- "deployments/helm/**"

# Declare default permissions as read only.
permissions: read-all

jobs:
build:
name: Auto-testing Framework / ${{ matrix.os }} / ${{ matrix.runtime }}
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/ci-test-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,23 @@ name: ci-test-go
on:
push:
branches: [main]
paths:
- "KubeArmor/**"
- "tests/**"
- "protobuf/**"
- ".github/workflows/ci-test-go.yml"
- "pkg/KubeArmorOperator/**"
pull_request:
branches: [main]
paths:
- "KubeArmor/**"
- "tests/**"
- "protobuf/**"
- ".github/workflows/ci-test-go.yml"
- "pkg/KubeArmorOperator/**"

# Declare default permissions as read only.
permissions: read-all

jobs:
go-fmt:
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci-test-helm-charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ on:
- "deployments/helm/**"
- ".github/workflows/ci-test-helm-charts.yml"

# Declare default permissions as read only.
permissions: read-all

jobs:
lint:
name: Helm Chart Tests / ubuntu 20.04
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci-test-operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ on:
- "deployments/**"
- "KubeArmor/utils/**"

# Declare default permissions as read only.
permissions: read-all

jobs:
kubearmor-operator-test:
name: Build KubeArmor Operator
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci-test-systemd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ on:
- "protobuf/**"
- ".github/workflows/ci-test-systemd.yml"

# Declare default permissions as read only.
permissions: read-all

jobs:
build:
name: Test KubeArmor in Systemd Mode
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci-test-ubi-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ on:
- "protobuf/**"
- ".github/workflows/ci-test-ginkgo.yml"

# Declare default permissions as read only.
permissions: read-all

jobs:
build:
name: Auto-testing Framework / ${{ matrix.os }} / ${{ matrix.runtime }}
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
schedule:
- cron: '30 17 * * 5'

# Declare default permissions as read only.
permissions: read-all

jobs:
analyze:
name: Analyze
runs-on: 'ubuntu-latest'
timeout-minutes: 30
permissions:
# required for all workflows
security-events: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: 'go'

# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v3

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:go"
2 changes: 1 addition & 1 deletion KubeArmor/BPF/libbpf
Submodule libbpf updated 117 files
Loading