diff --git a/.github/codeql/codeql-config.yaml b/.github/codeql/codeql-config.yaml new file mode 100644 index 000000000..b2b754cef --- /dev/null +++ b/.github/codeql/codeql-config.yaml @@ -0,0 +1,8 @@ +# Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/. + +name: CodeQL configuration +paths: +- cd3_automation_toolkit +- othertools +- .github/workflows diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 000000000..5bd453b9d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,40 @@ +# Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/. + +# This configuration enables Dependabot version updates. +# https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/about-dependabot-version-updates + +version: 2 +updates: +- package-ecosystem: pip + directory: / + schedule: + interval: weekly + commit-message: + prefix: chore + prefix-development: chore + include: scope + open-pull-requests-limit: 5 + target-branch: main + +- package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + commit-message: + prefix: chore + prefix-development: chore + include: scope + open-pull-requests-limit: 5 + target-branch: main + +- package-ecosystem: docker + directory: / + schedule: + interval: weekly + commit-message: + prefix: chore + prefix-development: chore + include: scope + open-pull-requests-limit: 5 + target-branch: main \ No newline at end of file diff --git a/.github/workflows/codeql-analysis.yaml b/.github/workflows/codeql-analysis.yaml new file mode 100644 index 000000000..fda2b5fd4 --- /dev/null +++ b/.github/workflows/codeql-analysis.yaml @@ -0,0 +1,52 @@ +# Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/. + +# Run CodeQL over the repository. For more configuration options see .github/codeql/codeql-config.yaml +# and: https://github.com/github/codeql-action + +name: CodeQL +on: + push: + branches: + - main + - develop + pull_request: + branches: + - main + - develop + schedule: + - cron: 20 15 * * 3 +permissions: + contents: read + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write + strategy: + fail-fast: false + matrix: + # Learn more about CodeQL language support at https://git.io/codeql-language-support + language: [python, actions] + steps: + + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15 + with: + languages: ${{ matrix.language }} + config-file: .github/codeql/codeql-config.yaml + # Override the default behavior so that the action doesn't attempt + # to auto-install Python dependencies. + setup-python-dependencies: false + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15 + \ No newline at end of file diff --git a/.github/workflows/macaron-analysis.yaml b/.github/workflows/macaron-analysis.yaml new file mode 100644 index 000000000..92042640d --- /dev/null +++ b/.github/workflows/macaron-analysis.yaml @@ -0,0 +1,46 @@ +# Copyright (c) 2026 - 2026, Oracle and/or its affiliates. All rights reserved. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/. + +# Run Macaron's policies and generate Verification Summary Attestation reports. +# See https://github.com/oracle/macaron + +name: Run Macaron to check supply chain security issues + +on: + push: + branches: + - main + paths: + - .github/workflows/** + pull_request: + paths: + - .github/workflows/** + schedule: + - cron: 20 15 * * 3 + workflow_dispatch: + +permissions: + contents: read + +jobs: + run_macaron: + runs-on: ubuntu-latest + + steps: + - name: Check out repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + fetch-depth: 0 + persist-credentials: false + + # Check the GitHub Actions workflows in the repository for vulnerabilities. + # Note: policy_purl is adapted for the CD3 Automation Toolkit repository. + - name: Run Macaron action + id: run_macaron + continue-on-error: true + uses: oracle/macaron@4ddb55e3c9ef2c77b548be55c557078c4476fd9c # v0.24.0 + with: + repo_path: ./ + policy_file: check-github-actions + policy_purl: pkg:github.com/oracle-devrel/cd3-automation-toolkit@.* + reports_retention_days: 3 \ No newline at end of file diff --git a/.github/workflows/scorecards-analysis.yaml b/.github/workflows/scorecards-analysis.yaml new file mode 100644 index 000000000..2d1225a17 --- /dev/null +++ b/.github/workflows/scorecards-analysis.yaml @@ -0,0 +1,43 @@ +# Copyright (c) 2026, Oracle and/or its affiliates. All rights reserved. +# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/. + +# Run Scorecard for this repository to further check and harden software and process. + +name: Scorecards supply-chain security +on: + branch_protection_rule: + schedule: + - cron: 27 20 * * 1 + push: + branches: [main] + +permissions: read-all + +jobs: + analysis: + name: Scorecards analysis + runs-on: ubuntu-latest + permissions: + # Needed to upload the results to code-scanning dashboard. + security-events: write + actions: read + contents: read + # Needed to access OIDC token. + id-token: write + steps: + - name: Check out repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Run analysis + uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.4.2 + with: + results_file: results.sarif + results_format: sarif + publish_results: true + + - name: Upload analysis results + uses: github/codeql-action/upload-sarif@45775bd8235c68ba998cffa5171334d58593da47 # v3.28.15 + with: + sarif_file: results.sarif \ No newline at end of file