Skip to content

Update zen-internals to v0.1.74 - #760

Merged
hansott merged 10 commits into
mainfrom
update-zen-internals-v0.1.74
Oct 23, 2026
Merged

hansott merged 10 commits into
mainfrom
update-zen-internals-v0.1.74

Conversation

@iacobdaniel

Copy link
Copy Markdown
Contributor

Update zen-internals to v0.1.74 and load the right build per platform

Comment thread aikido_zen/helpers/zen_internals.py Outdated
Comment thread aikido_zen/helpers/zen_internals.py Outdated
monkeypatch.setattr("platform.system", lambda: "Linux")
monkeypatch.setattr("platform.machine", lambda: "x86_64")
monkeypatch.setattr("sysconfig.get_config_var", lambda name: "x86_64-pc-linux-gnu")
monkeypatch.setattr("platform.libc_ver", lambda: ("", ""))

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is never called in code or?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On purpose. The code used to use them and picked the wrong build.

)
return None
error = e
# A musl Python built without HOST_GNU_TYPE picks the glibc build, which musl

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have CI tests using alpine linux? If not, let's add?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, adding now

Comment on lines +64 to +67
musl_path = os.path.join(
os.path.dirname(binary_path),
os.path.basename(binary_path).replace("-gnu.so", "-musl.so"),
)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Building musl_path from the directory and basename needlessly decomposes and reassembles binary_path before replacing the suffix.

Show fix
Suggested change
musl_path = os.path.join(
os.path.dirname(binary_path),
os.path.basename(binary_path).replace("-gnu.so", "-musl.so"),
)
musl_path = binary_path.replace("-gnu.so", "-musl.so")
Details

✨ AI Reasoning
​The retry path is derived from binary_path. Splitting it into directory and basename and joining those parts again adds an unnecessary step without changing the resulting path.

Reply on this comment to give feedback or ignore the issue.
More info

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would bring back an earlier bug: replace changes every -gnu.so in the path, including folder names, so a library in a folder like app-gnu.so/ would never get the musl retry. test_load_falls_back_to_the_musl_build_when_the_glibc_build_fails covers this and fails with the suggested line.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⛔ You don't have permission to ignore issues.

Comment on lines +76 to +83
run: |
docker run --rm -v "$(pwd):/app" -w /app python:${{ matrix.python-version }}-alpine sh -eo pipefail -c "
apk add --no-cache build-base curl
curl -fsSL https://github.com/AikidoSec/safe-chain/releases/latest/download/install-safe-chain.sh | sh -s -- --ci
export PATH=\"\$HOME/.safe-chain/shims:\$HOME/.safe-chain/bin:\$PATH\"
pip install --root-user-action=ignore . pytest
python -m pytest aikido_zen/helpers/zen_internals_test.py
"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Binary, code or archive is pulled from a remote source without integrity verification - medium severity
A GitHub Actions Workflow was built using an artifact from a remote source without any integrity verification. If the remote artifact were silently replaced with a malicious version (for example, through a supply chain attack), the integrity and confidentiality of the environment in which the container is deployed could be compromised.

Show fix

Remediation: Validate the artifact against a trusted SHA-512 checksum in the CI/CD pipeline using sha512sum in check mode. Store the expected checksum in a file (e.g., artifact.sha512), then verify it with: sha512sum -c artifact.sha512. Enable strict error handling (for example, set -e in shell scripts) so the pipeline fails if verification fails or outputs errors.

Reply @AikidoSec ignore: [REASON] to ignore this issue.
More info

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same safe-chain install line used in the other 8 workflows here and in firewall-node, and none of them pin a version.

@hansott
hansott force-pushed the update-zen-internals-v0.1.74 branch from 3da11cb to 4b71dd6 Compare October 23, 2026 16:14
@hansott
hansott merged commit 8f35368 into main Oct 23, 2026
130 of 131 checks passed
@hansott
hansott deleted the update-zen-internals-v0.1.74 branch October 23, 2026 16:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants