Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/bridgecrewio/checkov into a…
Browse files Browse the repository at this point in the history
…dd_Image_Referencer_rustworkx_support
  • Loading branch information
bo156 committed Sep 26, 2023
2 parents 5d453af + f950c57 commit 03ec02f
Show file tree
Hide file tree
Showing 80 changed files with 8,404 additions and 5,448 deletions.
44 changes: 14 additions & 30 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,13 @@ jobs:
pipenv run pytest integration_tests
prisma-tests:
runs-on: [ self-hosted, public, linux, x64 ]
env:
PYTHON_VERSION: "3.8"
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v3
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4
with:
python-version: 3.7
python-version: ${{ env.PYTHON_VERSION }}
- name: Install pipenv
run: |
python -m pip install --no-cache-dir --upgrade pipenv
Expand All @@ -107,7 +109,7 @@ jobs:
run: |
# remove venv, if exists
pipenv --rm || true
pipenv --python 3.7
pipenv --python ${{ env.PYTHON_VERSION }}
pipenv run pip install pytest pytest-xdist
pipenv run python setup.py sdist bdist_wheel
pipenv run pip install dist/checkov-*.whl
Expand All @@ -122,12 +124,14 @@ jobs:
unit-tests:
timeout-minutes: 30
runs-on: ubuntu-latest
env:
PYTHON_VERSION: "3.8"
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v3
- name: Set up Python 3.7
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4
with:
python-version: 3.7
python-version: ${{ env.PYTHON_VERSION }}
- uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -141,7 +145,7 @@ jobs:
run: |
# remove venv, if exists
pipenv --rm || true
pipenv --python 3.7
pipenv --python ${{ env.PYTHON_VERSION }}
pipenv install --dev
- name: Test with pytest
env:
Expand All @@ -157,6 +161,8 @@ jobs:
# IMPORTANT: this permission is mandatory for trusted publishing to pypi
id-token: write
timeout-minutes: 30
env:
PYTHON_VERSION: "3.8"
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v3
with:
Expand All @@ -167,18 +173,18 @@ jobs:
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
- name: Set up Python 3.7
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4
with:
python-version: 3.7
python-version: ${{ env.PYTHON_VERSION }}
- name: Install pipenv
run: |
python -m pip install --no-cache-dir --upgrade pipenv
- name: Install dependencies
run: |
# remove venv, if exists
pipenv --rm || true
pipenv --python 3.7
pipenv --python ${{ env.PYTHON_VERSION }}
pipenv install
- name: Calculate version
run: |
Expand Down Expand Up @@ -300,28 +306,6 @@ jobs:
BC_API_KEY: ${{ secrets.BC_API_KEY }}
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
publish-checkov-pyston-dockerhub:
runs-on: [self-hosted, public, linux, x64]
needs: bump-version
environment: release
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v3
- name: Get release version
id: versions
run: |
checkov_version=${{ needs.bump-version.outputs.version }}
checkov_major_version=$(echo "${checkov_version}" | head -c1)
echo "version=$checkov_version" >> "$GITHUB_OUTPUT"
echo "major_version=$checkov_major_version" >> "$GITHUB_OUTPUT"
- name: Publish to Registry
uses: elgohr/Publish-Docker-Github-Action@43dc228e327224b2eda11c8883232afd5b34943b # v5
with:
name: bridgecrew/checkov
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_PASSWORD }}
tags: "pyston,${{ steps.versions.outputs.version }}-pyston,${{ steps.versions.outputs.major_version }}-pyston"
dockerfile: Dockerfile.pyston
buildoptions: "--no-cache"
update-bridgecrew-projects:
needs: publish-checkov-dockerhub
runs-on: [self-hosted, public, linux, x64]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@ jobs:
pipenv lock -r > requirements.txt
pip install -r requirements.txt
- name: Initialize CodeQL
uses: github/codeql-action/init@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8 # v2
uses: github/codeql-action/init@04daf014b50eaf774287bf3f0f1869d4b4c4b913 # v2
with:
languages: python
setup-python-dependencies: false
config-file: ./.github/codeql-config.yml
- name: Autobuild
uses: github/codeql-action/autobuild@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8 # v2
uses: github/codeql-action/autobuild@04daf014b50eaf774287bf3f0f1869d4b4c4b913 # v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@00e563ead9f72a8461b24876bee2d0c2e8bd2ee8 # v2
uses: github/codeql-action/analyze@04daf014b50eaf774287bf3f0f1869d4b4c4b913 # v2
8 changes: 5 additions & 3 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ jobs:
permissions:
contents: write
environment: release
env:
PYTHON_VERSION: "3.8"
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v3
with:
Expand All @@ -24,10 +26,10 @@ jobs:
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.PASSPHRASE }}
- name: Set up Python 3.7
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4
with:
python-version: 3.7
python-version: ${{ env.PYTHON_VERSION }}
- uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -41,7 +43,7 @@ jobs:
run: |
# remove venv, if exists
pipenv --rm || true
pipenv --python 3.7
pipenv --python ${{ env.PYTHON_VERSION }}
pipenv install --dev
pipenv run pip install pytest
- name: Test with pytest
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,16 @@ jobs:
runs-on: ${{ matrix.os }}
permissions:
contents: write
env:
PYTHON_VERSION: "3.8"
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v3
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4
with:
python-version: 3.7
python-version: ${{ env.PYTHON_VERSION }}
- name: Install pipenv
run: |
python -m pip install --no-cache-dir --upgrade pipenv
Expand Down Expand Up @@ -124,7 +126,7 @@ jobs:
if: needs.github-release.outputs.upload_url != ''
runs-on: [self-hosted, public, linux, arm64]
container:
image: arm64v8/python:3.7
image: arm64v8/python:3.8
permissions:
contents: write
steps:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pipenv-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ jobs:
permissions:
contents: write
pull-requests: write
env:
PYTHON_VERSION: "3.8"
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v3
with:
Expand All @@ -26,7 +28,7 @@ jobs:
passphrase: ${{ secrets.PASSPHRASE }}
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4
with:
python-version: 3.7
python-version: ${{ env.PYTHON_VERSION }}
- name: Install pipenv
run: |
python -m pip install --no-cache-dir --upgrade pipenv
Expand Down
28 changes: 18 additions & 10 deletions .github/workflows/pr-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ jobs:
danger ci --verbose --failOnErrors
cfn-lint:
runs-on: ubuntu-latest
env:
PYTHON_VERSION: "3.8"
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v3
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4
with:
python-version: 3.7
python-version: ${{ env.PYTHON_VERSION }}
- name: Install cfn-lint
run: |
pip install -U cfn-lint
Expand All @@ -52,7 +54,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python: ["3.7", "3.8", "3.9", "3.10", "3.11"] # TODO: remove 3.7 end of September
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
Expand All @@ -77,11 +79,20 @@ jobs:
# remove venv, if exists
pipenv --rm || true
pipenv --python ${{ matrix.python }}
pipenv install --dev -v
# TODO: remove 3.7 end of September
if [ ${{ matrix.python }} == '3.7' ]; then
pipenv install --skip-lock --dev -v
else
pipenv install --dev -v
fi
pipenv run pip install redefine --index-url https://pip.redefine.dev
- name: Unit tests
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REDEFINE_AUTH: ${{ secrets.REDEFINE_AUTH }}
run: |
pipenv run redefine config set stable_branch=main matrix_value=${{ matrix.python }}
pipenv run redefine start --pytest --discover
pipenv run python -m pytest tests
integration-tests:
Expand Down Expand Up @@ -137,18 +148,15 @@ jobs:
pipenv run pytest integration_tests -k 'not api_key'
performance-tests:
strategy:
fail-fast: false
matrix:
python: ["3.7"]
env:
PYTHON_VERSION: "3.8"
working-directory: ./performance_tests
runs-on: [self-hosted, public, linux, x64]
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v3
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1 # v4
with:
python-version: ${{ matrix.python }}
python-version: ${{ env.PYTHON_VERSION }}
cache: "pipenv"
cache-dependency-path: "Pipfile.lock"
- uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3
Expand All @@ -165,7 +173,7 @@ jobs:
run: |
# remove venv, if exists
pipenv --rm || true
pipenv --python ${{ matrix.python }}
pipenv --python ${{ env.PYTHON_VERSION }}
# 'py' package is used in 'pytest-benchmark', but 'pytest' removed it in their latest version
pipenv run pip install pytest pytest-benchmark py
pipenv run python setup.py sdist bdist_wheel
Expand All @@ -187,7 +195,7 @@ jobs:
dogfood-tests:
runs-on: ubuntu-latest
env:
PYTHON_VERSION: "3.7"
PYTHON_VERSION: "3.8"
WORKING_DIRECTORY: ./dogfood_tests
steps:
- uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v3
Expand Down
40 changes: 39 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,44 @@
# CHANGELOG

## [Unreleased](https://github.com/bridgecrewio/checkov/compare/2.4.33...HEAD)
## [Unreleased](https://github.com/bridgecrewio/checkov/compare/2.4.48...HEAD)

## [2.4.48](https://github.com/bridgecrewio/checkov/compare/2.4.47...2.4.48) - 2023-09-21

### Platform

- **general:** expose retry and timeout configuration for interaction with the platform - [#5585](https://github.com/bridgecrewio/checkov/pull/5585)

## [2.4.47](https://github.com/bridgecrewio/checkov/compare/2.4.39...2.4.47) - 2023-09-20

### Feature

- **sca:** creating alias mapping for javascript - [#5567](https://github.com/bridgecrewio/checkov/pull/5567)
- **sca:** creating alias mapping for javascript - [#5582](https://github.com/bridgecrewio/checkov/pull/5582)
- **sca:** revert creating alias mapping for javascript - [#5581](https://github.com/bridgecrewio/checkov/pull/5581)

### Bug Fix

- **general:** fix print to encode in windows - [#5572](https://github.com/bridgecrewio/checkov/pull/5572)
- **terraform:** Nested source_module_objects with missing foreach key - [#5580](https://github.com/bridgecrewio/checkov/pull/5580)

## [2.4.39](https://github.com/bridgecrewio/checkov/compare/2.4.36...2.4.39) - 2023-09-14

### Feature

- **arm:** implement CKV2_AZURE_27 for arm - [#5534](https://github.com/bridgecrewio/checkov/pull/5534)
- **terraform:** Add new policy for deprecated runtimes - [#5555](https://github.com/bridgecrewio/checkov/pull/5555)
- **terraform:** Ensure Event Hub Namespace uses at least TLS 1.2 - [#5535](https://github.com/bridgecrewio/checkov/pull/5535)
- **terraform:** Ensure that the Ledger feature is enabled on database that requires cryptographic proof and nonrepudiation of data integrity - [#5541](https://github.com/bridgecrewio/checkov/pull/5541)

## [2.4.36](https://github.com/bridgecrewio/checkov/compare/2.4.33...2.4.36) - 2023-09-13

### Feature

- **general:** add rustworkx - [#5511](https://github.com/bridgecrewio/checkov/pull/5511)

### Bug Fix

- **terraform:** Module from_dict func to static func - [#5562](https://github.com/bridgecrewio/checkov/pull/5562)

## [2.4.33](https://github.com/bridgecrewio/checkov/compare/2.4.32...2.4.33) - 2023-09-12

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.10-slim
FROM python:3.11-slim

ENV RUN_IN_DOCKER=True

Expand Down
41 changes: 0 additions & 41 deletions Dockerfile.pyston

This file was deleted.

2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,4 @@ license-expression = "*"
rustworkx = "*"

[requires]
python_version = "3.7"
python_version = "3.8"
Loading

0 comments on commit 03ec02f

Please sign in to comment.