github-advanced-security[bot] commented on code in PR #73095:
URL: https://github.com/apache/airflow/pull/73095#discussion_r4000048648


##########
.github/workflows/ci-image-build.yml:
##########
@@ -151,20 +164,50 @@
         with:
           ref: ${{ inputs.checkout-ref }}
           persist-credentials: false
+      - name: "Install Breeze"
+        uses: ./.github/actions/breeze
+      - name: "Resolve compatible main CI image"

Review Comment:
   ## CodeQL / Cache Poisoning via execution of untrusted code
   
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([schedule](2)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([schedule](3)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([workflow_dispatch](4)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([workflow_dispatch](5)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([schedule](6)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([workflow_dispatch](7)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([workflow_dispatch](8)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([workflow_dispatch](9)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([workflow_dispatch](10)).
   
   [Show more 
details](https://github.com/apache/airflow/security/code-scanning/647)



##########
.github/actions/resolve_main_image/action.yml:
##########
@@ -0,0 +1,76 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+---
+name: Resolve a compatible main image
+description: Fingerprint the checkout and select a verified main artifact 
without downloading its image
+inputs:
+  kind:
+    description: Artifact kind
+    required: true
+  python:
+    description: Python version
+    required: true
+  platform:
+    description: Docker platform
+    required: true
+  base-image:
+    description: Previously resolved immutable Debian base reference
+    default: ""
+  constraints-file:
+    description: Actual production constraints used by the build
+    default: ""
+  publish:
+    description: Compute publication inputs even when reuse is disabled
+    default: "false"
+  disabled:
+    description: Force a normal build
+    default: "false"
+outputs:
+  publication-exists:
+    description: Whether this publisher run already uploaded the exact image 
identity
+    value: ${{ steps.resolve.outputs.publication-exists }}
+  built-image-name:
+    description: Name for this run's fallback image artifact
+    value: ${{ steps.resolve.outputs.built-image-name }}
+  base-image:
+    description: Immutable Debian base reference used for this fingerprint
+    value: ${{ steps.resolve.outputs.base-image }}
+  hit:
+    description: Whether a compatible artifact was selected
+    value: ${{ steps.resolve.outputs.hit }}
+  artifact-name:
+    description: Name for publishing an image with these inputs
+    value: ${{ steps.resolve.outputs.artifact-name }}
+  selection-name:
+    description: Name of the per-run selection artifact
+    value: ${{ steps.resolve.outputs.selection-name }}
+runs:
+  using: composite
+  steps:
+    - name: Fingerprint and resolve
+      id: resolve
+      shell: bash
+      env:
+        IMAGE_KIND: ${{ inputs.kind }}
+        IMAGE_PYTHON: ${{ inputs.python }}
+        IMAGE_PLATFORM: ${{ inputs.platform }}
+        IMAGE_BASE: ${{ inputs.base-image }}
+        IMAGE_CONSTRAINTS_FILE: ${{ inputs.constraints-file }}
+        IMAGE_PUBLISH: ${{ inputs.publish }}
+        IMAGE_REUSE_DISABLED: ${{ inputs.disabled }}
+      run: ./scripts/ci/resolve_main_image.sh

Review Comment:
   ## CodeQL / Cache Poisoning via execution of untrusted code
   
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([schedule](2)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([schedule](3)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([workflow_dispatch](4)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([workflow_dispatch](5)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([schedule](6)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([workflow_dispatch](7)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([workflow_dispatch](8)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([workflow_dispatch](9)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([workflow_dispatch](10)).
   
   [Show more 
details](https://github.com/apache/airflow/security/code-scanning/646)



##########
.github/workflows/ci-image-build.yml:
##########
@@ -151,20 +164,50 @@
         with:
           ref: ${{ inputs.checkout-ref }}
           persist-credentials: false
+      - name: "Install Breeze"
+        uses: ./.github/actions/breeze
+      - name: "Resolve compatible main CI image"
+        id: main-image
+        if: inputs.use-selected-image || inputs.publish-main-image
+        uses: ./.github/actions/resolve_main_image
+        with:
+          kind: ci
+          publish: ${{ inputs.publish-main-image }}
+          python: ${{ matrix.python-version }}
+          platform: ${{ inputs.platform }}
+          disabled: >-
+            ${{
+            !inputs.use-selected-image || !inputs.reuse-main-image || 
inputs.publish-main-image ||
+            inputs.push-image == 'true' ||
+            inputs.upgrade-to-newer-dependencies != 'false' || 
inputs.docker-cache == 'disabled' ||
+            inputs.branch != 'main' || inputs.constraints-branch != 
'constraints-main' ||
+            inputs.install-mysql-client-type != 'mariadb' || 
inputs.debian-version != 'bookworm' ||
+            inputs.use-uv != 'true' || secrets.CONSTRAINTS_GITHUB_REPOSITORY 
!= '' ||
+            inputs.image-stash-ref != '' || 
inputs.seed-cache-from-stashed-image == 'true'
+            }}
+      - name: "Publish selected CI image reference"

Review Comment:
   ## CodeQL / Cache Poisoning via execution of untrusted code
   
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([schedule](2)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([schedule](3)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([workflow_dispatch](4)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([workflow_dispatch](5)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([schedule](6)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([workflow_dispatch](7)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([workflow_dispatch](8)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([workflow_dispatch](9)).
   Potential cache poisoning in the context of the default branch due to 
privilege checkout of untrusted code from [inputs.checkout-ref](1). 
([workflow_dispatch](10)).
   
   [Show more 
details](https://github.com/apache/airflow/security/code-scanning/648)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to