Description of problem:
UBI8 Ansible remediation tests fail before remediation or scanning begins. The target container installs its system python3, which is Python 3.6. The Ansible controller's fact-gathering module imports annotations from __future__; Python 3.6 cannot parse that import.
SCAP Security Guide Version:
0.1.82
Operating System Version:
UBI8 (registry.access.redhat.com/ubi8).
Steps to Reproduce:
-
Build the RHEL 8 data stream:
# Build the data stream consumed by the container test.
./build_product rhel8 --datastream
-
Build the UBI8 test target from the upstream UBI8 image, authorizing the existing local Ed25519 SSH key:
# Pass the key that Automatus will use for SSH to the target image.
podman build \
--build-arg "CLIENT_PUBLIC_KEY=$(<"<public_key_file>")" \
--tag ssg_test_suite_ubi8 \
--file Dockerfiles/test_suite-ubi8 \
Dockerfiles
-
Define both rules and confirm that Bash remediation passes:
# Test both user-initialization-file rules.
RULES=(
file_permission_user_init_files
file_permission_user_init_files_root
)
# Run Bash remediation against the UBI8 target.
python3 tests/automatus.py rule \
--product rhel8 \
--datastream build/ssg-rhel8-ds.xml \
--duplicate-templates \
--remove-platforms \
--remove-ocp4-only \
--remove-fips-certified \
--dontclean \
--logdir logs_ubi8_bash \
--remediate-using bash \
--container ssg_test_suite_ubi8 \
-- "${RULES[@]}"
-
Run the same tests with Ansible remediation:
# Run Ansible remediation against the same UBI8 target.
python3 tests/automatus.py rule \
--product rhel8 \
--datastream build/ssg-rhel8-ds.xml \
--duplicate-templates \
--remove-platforms \
--remove-ocp4-only \
--remove-fips-certified \
--dontclean \
--logdir logs_ubi8_ansible \
--remediate-using ansible \
--container ssg_test_suite_ubi8 \
-- "${RULES[@]}"
-
Inspect logs_ubi8_ansible/test_suite.log and the remediation verbose logs.
Actual Results:
The Ansible Gathering Facts task fails with:
SyntaxError: future feature annotations is not defined
Bash remediation tests pass for both rules. Ansible remediation fails for both rules when its setup module runs on the target Python 3.6 interpreter.
Expected Results:
The Ansible remediation test runs with an Ansible version and target Python interpreter that are mutually supported.
Additional Information/Debugging Steps:
Dockerfiles/test_suite-ubi8 installs python3 without selecting a newer interpreter.
- The target interpreter compatibility needs an explicit solution: use an Ansible version supported by Python 3.6, or configure a supported newer target interpreter.
- Do not install an arbitrary Python version without defining the supported UBI8 test matrix.
Description of problem:
UBI8 Ansible remediation tests fail before remediation or scanning begins. The target container installs its system
python3, which is Python 3.6. The Ansible controller's fact-gathering module importsannotationsfrom__future__; Python 3.6 cannot parse that import.SCAP Security Guide Version:
0.1.82
Operating System Version:
UBI8 (
registry.access.redhat.com/ubi8).Steps to Reproduce:
Build the RHEL 8 data stream:
# Build the data stream consumed by the container test. ./build_product rhel8 --datastreamBuild the UBI8 test target from the upstream UBI8 image, authorizing the existing local Ed25519 SSH key:
Define both rules and confirm that Bash remediation passes:
Run the same tests with Ansible remediation:
Inspect
logs_ubi8_ansible/test_suite.logand the remediation verbose logs.Actual Results:
The Ansible
Gathering Factstask fails with:Bash remediation tests pass for both rules. Ansible remediation fails for both rules when its setup module runs on the target Python 3.6 interpreter.
Expected Results:
The Ansible remediation test runs with an Ansible version and target Python interpreter that are mutually supported.
Additional Information/Debugging Steps:
Dockerfiles/test_suite-ubi8installspython3without selecting a newer interpreter.