Skip to content

Commit b2d7cd1

Browse files
authored
Merge branch 'master' into hadolint_and_config
2 parents d9993be + f61a87e commit b2d7cd1

File tree

9 files changed

+46
-31
lines changed

9 files changed

+46
-31
lines changed

.github/workflows/build-image-test.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ jobs:
3838

3939
- name: Get changed Docker related files
4040
id: changed-files-specific
41-
uses: tj-actions/changed-files@dcc7a0cba800f454d79fff4b993e8c3555bcc0a8 # v45.0.7
41+
uses: tj-actions/changed-files@2f7c5bfce28377bc069a65ba478de0a74aa0ca32 # v46.0.1
4242
with:
4343
files: |
44-
Dockerfile
4544
.dockerignore
46-
tools/entrypoint.sh
4745
.github/workflows/build-image-test.yaml
48-
tools/*.sh
46+
Dockerfile
47+
tools/entrypoint.sh
48+
tools/install/*.sh
4949
5050
- name: Set IMAGE environment variable
5151
if: steps.changed-files-specific.outputs.any_changed == 'true'
@@ -56,12 +56,12 @@ jobs:
5656
>> $GITHUB_ENV
5757
5858
- name: Set up Docker Buildx
59-
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3.9.0
59+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
6060
if: steps.changed-files-specific.outputs.any_changed == 'true'
6161

6262
- name: Build if Dockerfile changed
6363
if: steps.changed-files-specific.outputs.any_changed == 'true'
64-
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
64+
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
6565
with:
6666
context: .
6767
build-args: |
@@ -100,7 +100,7 @@ jobs:
100100
101101
- name: Dive - check image for waste files
102102
if: steps.changed-files-specific.outputs.any_changed == 'true'
103-
uses: MaxymVlasov/dive-action@94506fd846be3ec26406118c3878ccd2ad2b0150 # v1.3.0
103+
uses: MaxymVlasov/dive-action@43dafd0015826beaca5110157c9262c5dc10672a # v1.4.0
104104
with:
105105
image: ${{ env.IMAGE }}
106106
config-file: ${{ github.workspace }}/.github/.dive-ci.yaml
@@ -112,7 +112,7 @@ jobs:
112112
if: >-
113113
steps.changed-files-specific.outputs.any_changed == 'true'
114114
&& matrix.os == 'ubuntu-latest'
115-
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
115+
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
116116
with:
117117
context: .
118118
build-args: |

.github/workflows/build-image.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ jobs:
2222
- name: Checkout code
2323
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
2424
- name: Set up Docker Buildx
25-
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3.9.0
25+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
2626
- name: Login to GitHub Container Registry
27-
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
27+
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
2828
with:
2929
registry: ghcr.io
3030
username: ${{ github.repository_owner }}
@@ -43,11 +43,11 @@ jobs:
4343
run: >-
4444
echo "IMAGE_REPO=ghcr.io/${GITHUB_REPOSITORY@L}" >> $GITHUB_ENV
4545
- name: Set up Docker Buildx
46-
uses: docker/setup-buildx-action@f7ce87c1d6bead3e36075b2ce75da1f6cc28aaca # v3.9.0
46+
uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
4747

4848
- name: Build and Push release
4949
if: github.event_name != 'schedule'
50-
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
50+
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
5151
with:
5252
context: .
5353
build-args: |
@@ -64,7 +64,7 @@ jobs:
6464
6565
- name: Build and Push nightly
6666
if: github.event_name == 'schedule'
67-
uses: docker/build-push-action@ca877d9245402d1537745e0e356eab47c3520991 # v6.13.0
67+
uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
6868
with:
6969
context: .
7070
build-args: |

.github/workflows/ci-cd.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ jobs:
161161
echo "dir=$(python -m pip cache dir)" >> "${GITHUB_OUTPUT}"
162162
shell: bash
163163
- name: Set up pip cache
164-
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
164+
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
165165
with:
166166
path: ${{ steps.pip-cache-dir.outputs.dir }}
167167
key: >-
@@ -307,7 +307,7 @@ jobs:
307307
run: >-
308308
echo "dir=$(python -m pip cache dir)" >> "${GITHUB_OUTPUT}"
309309
- name: Set up pip cache
310-
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
310+
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
311311
with:
312312
path: ${{ steps.pip-cache-dir.outputs.dir }}
313313
key: >-
@@ -372,7 +372,7 @@ jobs:
372372
>> "${GITHUB_OUTPUT}"
373373
working-directory: dist
374374
- name: Store the distribution packages
375-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
375+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
376376
with:
377377
name: >-
378378
${{ needs.pre-setup.outputs.dists-artifact-name }}

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646

4747
# Initializes the CodeQL tools for scanning.
4848
- name: Initialize CodeQL
49-
uses: github/codeql-action/init@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9
49+
uses: github/codeql-action/init@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
5050
with:
5151
languages: ${{ matrix.language }}
5252
# If you wish to specify custom queries, you can do so here or in
@@ -58,7 +58,7 @@ jobs:
5858
# If this step fails, then you should remove it and run the build
5959
# manually (see below)
6060
- name: Autobuild
61-
uses: github/codeql-action/autobuild@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9
61+
uses: github/codeql-action/autobuild@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
6262

6363
# ℹ️ Command-line programs to run using the OS shell.
6464
# yamllint disable-line rule:line-length
@@ -73,6 +73,6 @@ jobs:
7373
# ./location_of_script_within_repo/buildscript.sh
7474

7575
- name: Perform CodeQL Analysis
76-
uses: github/codeql-action/analyze@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9
76+
uses: github/codeql-action/analyze@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
7777
with:
7878
category: /language:${{matrix.language}}

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
fetch-depth: 0
3737

3838
- name: Release
39-
uses: cycjimmy/semantic-release-action@b1b432f13acb7768e0c8efdec416d363a57546f2 # v4.1.1
39+
uses: cycjimmy/semantic-release-action@0a51e81a6baff2acad3ee88f4121c589c73d0f0e # v4.2.0
4040
with:
4141
semantic_version: 18.0.0
4242
extra_plugins: |

.github/workflows/reusable-tox.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ jobs:
181181

182182
- name: Cache pre-commit.com virtualenvs
183183
if: inputs.toxenv == 'pre-commit'
184-
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
184+
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
185185
with:
186186
path: ~/.cache/pre-commit
187187
key: >-
@@ -239,7 +239,7 @@ jobs:
239239
shell: bash
240240
- name: Set up pip cache
241241
if: fromJSON(steps.py-abi.outputs.is-stable-abi)
242-
uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
242+
uses: actions/cache@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
243243
with:
244244
path: ${{ steps.pip-cache-dir.outputs.dir }}
245245
key: >-
@@ -266,7 +266,7 @@ jobs:
266266
- name: Download all the dists
267267
if: >-
268268
contains(fromJSON('["metadata-validation", "pytest"]'), inputs.toxenv)
269-
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
269+
uses: actions/download-artifact@b14cf4c92620c250e1c074ab0a5800e37df86765 # v4.2.0
270270
with:
271271
name: ${{ inputs.dists-artifact-name }}
272272
path: dist/

.github/workflows/scorecards.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242
persist-credentials: false
4343

4444
- name: Run analysis
45-
uses: ossf/scorecard-action@62b2cac7ed8198b15735ed49ab1e5cf35480ba46 # v2.4.0
45+
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
4646
with:
4747
results_file: results.sarif
4848
results_format: sarif
@@ -66,14 +66,14 @@ jobs:
6666
# Upload the results as artifacts (optional). Commenting out will disable
6767
# uploads of run results in SARIF format to the repository Actions tab.
6868
- name: Upload artifact
69-
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
69+
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 # v4.6.1
7070
with:
7171
name: SARIF file
7272
path: results.sarif
7373
retention-days: 5
7474

7575
# Upload the results to GitHub's code scanning dashboard.
7676
- name: Upload to code-scanning
77-
uses: github/codeql-action/upload-sarif@9e8d0789d4a0fa9ceb6b1738f7e269594bdd67f0 # v3.28.9
77+
uses: github/codeql-action/upload-sarif@6bb031afdd8eb862ea3fc1848194185e076637e5 # v3.28.11
7878
with:
7979
sarif_file: results.sarif

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ repos:
4343

4444
# Detect hardcoded secrets
4545
- repo: https://github.com/gitleaks/gitleaks
46-
rev: v8.23.3
46+
rev: v8.24.0
4747
hooks:
4848
- id: gitleaks
4949

@@ -66,7 +66,7 @@ repos:
6666
- --implicit_start
6767

6868
- repo: https://github.com/adrienverge/yamllint.git
69-
rev: v1.35.1
69+
rev: v1.36.2
7070
hooks:
7171
- id: yamllint
7272
types:

README.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ If you want to support the development of `pre-commit-terraform` and [many other
7070
* [terragrunt\_providers\_lock](#terragrunt_providers_lock)
7171
* [terragrunt\_validate\_inputs](#terragrunt_validate_inputs)
7272
* [Docker Usage](#docker-usage)
73+
* [About Docker image security](#about-docker-image-security)
7374
* [File Permissions](#file-permissions)
7475
* [Download Terraform modules from private GitHub repositories](#download-terraform-modules-from-private-github-repositories)
7576
* [GitHub Actions](#github-actions)
@@ -129,9 +130,12 @@ docker pull ghcr.io/antonbabenko/pre-commit-terraform:$TAG
129130

130131
All available tags [here](https://github.com/antonbabenko/pre-commit-terraform/pkgs/container/pre-commit-terraform/versions).
131132

133+
Check [About Docker image security](#about-docker-image-security) section to learn more about possible security issues and why you probably want to build and maintain your own image.
134+
135+
132136
**Build from scratch**:
133137

134-
> [!IMPORTANT]
138+
> **IMPORTANT**
135139
> To build image you need to have [`docker buildx`](https://docs.docker.com/build/install-buildx/) enabled as default builder.
136140
> Otherwise - provide `TARGETOS` and `TARGETARCH` as additional `--build-arg`'s to `docker build`.
137141
@@ -226,8 +230,8 @@ curl -L "$(curl -s https://api.github.com/repos/minamijoyo/hcledit/releases/late
226230

227231
We highly recommend using [WSL/WSL2](https://docs.microsoft.com/en-us/windows/wsl/install) with Ubuntu and following the Ubuntu installation guide. Or use Docker.
228232

229-
> [!IMPORTANT]
230-
> We won't be able to help with issues that can't be reproduced in Linux/Mac.
233+
> **IMPORTANT**
234+
> We won't be able to help with issues that can't be reproduced in Linux/Mac.
231235
> So, try to find a working solution and send PR before open an issue.
232236
233237
Otherwise, you can follow [this gist](https://gist.github.com/etiennejeanneaurevolve/1ed387dc73c5d4cb53ab313049587d09):
@@ -1182,6 +1186,17 @@ Example:
11821186

11831187
## Docker Usage
11841188

1189+
### About Docker image security
1190+
1191+
Pre-built Docker images contain the latest versions of tools available at the time of their build and remain unchanged afterward. Tags should be immutable whenever possible, and it is highly recommended to pin them using hash sums for security and reproducibility.
1192+
1193+
This means that most Docker images will include known CVEs, and the longer an image exists, the more CVEs it may accumulate. This applies even to the latest `vX.Y.Z` tags.
1194+
To address this, you can use the `nightly` tag, which rebuilds nightly with the latest versions of all dependencies and latest `pre-commit-terraform` hooks. However, using mutable tags introduces different security concerns.
1195+
1196+
Note: Currently, we DO NOT test third-party tools or their dependencies for security vulnerabilities, corruption, or injection (including obfuscated content). If you have ideas for introducing image scans or other security improvements, please open an issue or submit a PR. Some ideas are already tracked in [#835](https://github.com/antonbabenko/pre-commit-terraform/issues/835).
1197+
1198+
From a security perspective, the best approach is to manage the Docker image yourself and update its dependencies as needed. This allows you to remove unnecessary dependencies, reducing the number of potential CVEs and improving overall security.
1199+
11851200
### File Permissions
11861201

11871202
A mismatch between the Docker container's user and the local repository file ownership can cause permission issues in the repository where `pre-commit` is run. The container runs as the `root` user by default, and uses a `tools/entrypoint.sh` script to assume a user ID and group ID if specified by the environment variable `USERID`.

0 commit comments

Comments
 (0)