Skip to content

ROX-12967: Introduce local-nodescanner #1027

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from

Conversation

Maddosaurus
Copy link
Contributor

@Maddosaurus Maddosaurus commented Dec 2, 2022

This PR introduces local-nodescanner in the tools directory.
Its goal is to run the code used for RHCOS node scanning, usually run by Compliance on a Node, locally.
As the local version expects a path to a filesystem as argument, it can either run in a live environment or on an unpacked filesystem on disk.

Testing:

  • Tested on live UBI8 image by executing with path=/
  • Tested on extracted RHCOS FS by executing with path=/path/to/extracted/dir

In case of the RHCOS FS, I copied a populated /var/lib/rpm/Packages file from an OpenShift Node running RHCOS 4.11 and manually added it to the right folder in the unpacked FS dump.
Results of both runs can be found in the comments below.

@Maddosaurus
Copy link
Contributor Author

Current dependencies on/for this PR:

This comment was auto-generated by Graphite.

@openshift-ci
Copy link

openshift-ci bot commented Dec 2, 2022

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@Maddosaurus
Copy link
Contributor Author

Run against a UBI 8.7 image:

Nodescan finished. Returned components: &{0xc000326c90 [] rhel:8 - [ ][ python3-pip-wheel:9.0.3-22.el8::noarch filesystem:3.8-6.el8::x86_64 pcre2:10.32-3.el8_6::x86_64 glibc-common:2.28-211.el8::x86_64 zlib:1.2.11-20.el8::x86_64 sqlite-libs:3.26.0-16.el8_6::x86_64 libxcrypt:4.1.1-6.el8::x86_64 expat:2.2.5-10.el8::x86_64 libuuid:2.32.1-38.el8::x86_64 libacl:2.2.53-1.el8::x86_64 sed:4.5-5.el8::x86_64 p11-kit:0.23.22-1.el8::x86_64 libgcrypt:1.8.5-7.el8_6::x86_64 lz4-libs:1.8.3-3.el8_4::x86_64 libtasn1:4.13-3.el8::x86_64 systemd-libs:239-68.el8::x86_64 libusbx:1.0.23-4.el8::x86_64 libutempter:1.1.6-14.el8::x86_64 cracklib:2.9.6-15.el8::x86_64 mpfr:3.1.6-1.el8::x86_64 brotli:1.0.6-3.el8::x86_64 libseccomp:2.5.2-1.el8::x86_64 libnsl2:1.2.0-2.20180605git4a062cf.el8::x86_64 crypto-policies:20211116-1.gitae470d6.el8::noarch python3-libs:3.6.8-48.el8_7::x86_64 python3-six:1.11.0-8.el8::noarch glib2:2.56.4-159.el8::x86_64 dbus-glib:0.110-2.el8::x86_64 virt-what:1.25-1.el8::x86_64 passwd:0.80-4.el8::x86_64 python3-libcomps:0.1.18-1.el8::x86_64 python3-decorator:4.2.1-2.el8::noarch python3-urllib3:1.24.2-5.el8::noarch kmod-libs:25-19.el8::x86_64 elfutils-default-yama-scope:0.187-4.el8::noarch systemd-pam:239-68.el8::x86_64 tpm2-tss:2.3.2-4.el8::x86_64 gnupg2:2.2.20-3.el8_6::x86_64 libssh:0.9.6-3.el8::x86_64 curl:7.61.1-25.el8::x86_64 libsolv:0.7.20-3.el8::x86_64 rpm-build-libs:4.14.3-24.el8_7::x86_64 dnf-data:4.7.0-11.el8::noarch dnf-plugin-subscription-manager:1.28.32-1.el8::x86_64 tar:2:1.30-6.el8::x86_64 rootfiles:8.1-22.el8::noarch libgcc:8.5.0-15.el8::x86_64 subscription-manager-rhsm-certificates:1.28.32-1.el8::x86_64 basesystem:11-5.el8::noarch libselinux:2.9-6.el8::x86_64 glibc:2.28-211.el8::x86_64 xz-libs:5.2.4-4.el8_6::x86_64 libxml2:2.9.7-15.el8::x86_64 libzstd:1.4.4-1.el8::x86_64 json-c:0.13.1-3.el8::x86_64 readline:7.0-10.el8::x86_64 coreutils-single:8.30-13.el8::x86_64 libsmartcols:2.32.1-38.el8::x86_64 chkconfig:1.19.1-1.el8::x86_64 file-libs:5.33-21.el8::x86_64 libassuan:2.5.1-3.el8::x86_64 p11-kit-trust:0.23.22-1.el8::x86_64 dbus-libs:1:1.12.8-23.el8::x86_64 gdbm:1:1.18-2.el8::x86_64 libpsl:0.20.2-6.el8::x86_64 cracklib-dicts:2.9.6-15.el8::x86_64 nettle:3.4.1-7.el8::x86_64 dmidecode:1:3.3-4.el8::x86_64 libsigsegv:2.11-5.el8::x86_64 libtirpc:1.1.4-8.el8::x86_64 crypto-policies-scripts:20211116-1.gitae470d6.el8::noarch libdb:5.3.28-42.el8_4::x86_64 util-linux:2.32.1-38.el8::x86_64 json-glib:1.4.4-1.el8::x86_64 python3-dbus:1.2.4-15.el8::x86_64 cyrus-sasl-lib:2.1.27-6.el8_5::x86_64 usermode:1.113-2.el8::x86_64 python3-libxml2:2.9.7-15.el8::x86_64 python3-idna:2.5-5.el8::noarch python3-requests:2.20.0-2.1.el8_1::noarch device-mapper:8:1.02.181-6.el8::x86_64 elfutils-libs:0.187-4.el8::x86_64 systemd:239-68.el8::x86_64 ima-evm-utils:1.3.2-12.el8::x86_64 gpgme:1.13.1-11.el8::x86_64 libcurl:7.61.1-25.el8::x86_64 rpm:4.14.3-24.el8_7::x86_64 libdnf:0.63.0-11.1.el8::x86_64 python3-rpm:4.14.3-24.el8_7::x86_64 python3-dnf:4.7.0-11.el8::noarch subscription-manager:1.28.32-1.el8::x86_64 vim-minimal:2:8.0.1763-19.el8_6.4::x86_64 tzdata:2022e-1.el8::noarch redhat-release:8.7-0.3.el8::x86_64 publicsuffix-list-dafsa:20180723-1.el8::noarch ncurses-libs:6.1-9.20180224.el8::x86_64 bash:4.4.20-4.el8_6::x86_64 bzip2-libs:1.0.6-26.el8::x86_64 info:6.5-7.el8::x86_64 popt:1.18-1.el8::x86_64 libcom_err:1.45.6-5.el8::x86_64 gmp:1:6.1.2-10.el8::x86_64 libblkid:2.32.1-38.el8::x86_64 libstdc++:8.5.0-15.el8::x86_64 libunistring:0.9.9-3.el8::x86_64 libcap-ng:0.7.11-1.el8::x86_64 gdbm-libs:1:1.18-2.el8::x86_64 pcre:8.42-6.el8::x86_64 ca-certificates:2022.2.54-80.2.el8_6::noarch libsemanage:2.9-9.el8::x86_64 libfdisk:2.32.1-38.el8::x86_64 which:2.21-18.el8::x86_64 libcomps:0.1.18-1.el8::x86_64 libnghttp2:1.33.0-3.el8_2.1::x86_64 gawk:4.2.1-4.el8::x86_64 krb5-libs:1.18.2-21.el8::x86_64 platform-python-setuptools:39.2.0-6.el8::noarch libpwquality:1.4.4-5.el8::x86_64 python3-dateutil:1:2.6.1-6.el8::noarch librhsm:0.0.3-4.el8::x86_64 gobject-introspection:1.56.1-1.el8::x86_64 openldap:2.4.46-18.el8::x86_64 libdb-utils:5.3.28-42.el8_4::x86_64 python3-dmidecode:3.12.2-15.el8::x86_64 python3-inotify:0.9.6-13.el8::noarch python3-cloud-what:1.28.32-1.el8::x86_64 device-mapper-libs:8:1.02.181-6.el8::x86_64 dbus-common:1:1.12.8-23.el8::noarch dbus:1:1.12.8-23.el8::x86_64 libyaml:0.1.7-5.el8::x86_64 python3-gpg:1.13.1-11.el8::x86_64 librepo:1.14.2-3.el8::x86_64 rpm-libs:4.14.3-24.el8_7::x86_64 python3-libdnf:0.63.0-11.1.el8::x86_64 python3-subscription-manager-rhsm:1.28.32-1.el8::x86_64 dnf:4.7.0-11.el8::noarch yum:4.7.0-11.el8::noarch findutils:1:4.6.0-20.el8::x86_64 python3-setuptools-wheel:39.2.0-6.el8::noarch setup:2.12.2-7.el8::noarch ncurses-base:6.1-9.20180224.el8::noarch glibc-minimal-langpack:2.28-211.el8::x86_64 libsepol:2.9-3.el8::x86_64 libgpg-error:1.31-1.el8::x86_64 libcap:2.48-4.el8::x86_64 elfutils-libelf:0.187-4.el8::x86_64 libffi:3.1-23.el8::x86_64 libattr:2.4.48-3.el8::x86_64 libmount:2.32.1-38.el8::x86_64 lua-libs:5.3.4-12.el8::x86_64 libidn2:2.2.0-1.el8::x86_64 audit-libs:3.0.7-4.el8::x86_64 keyutils-libs:1.5.10-9.el8::x86_64 grep:3.1-6.el8::x86_64 dbus-tools:1:1.12.8-23.el8::x86_64 shadow-utils:2:4.6-17.el8::x86_64 gzip:1.9-13.el8_5::x86_64 acl:2.2.53-1.el8::x86_64 libksba:1.3.5-8.el8_6::x86_64 libnl3:3.7.0-1.el8::x86_64 libverto:0.3.2-2.el8::x86_64 openssl-libs:1:1.1.1k-7.el8_6::x86_64 platform-python:3.6.8-48.el8_7::x86_64 pam:1.3.1-22.el8::x86_64 gnutls:3.6.16-5.el8_6::x86_64 python3-iniparse:0.4-31.el8::noarch python3-gobject-base:3.28.3-2.el8::x86_64 libuser:0.62-24.el8::x86_64 python3-ethtool:0.14-5.el8::x86_64 python3-chardet:3.0.4-7.el8::noarch python3-pysocks:1.6.8-3.el8::noarch python3-syspurpose:1.28.32-1.el8::x86_64 cryptsetup-libs:2.3.7-2.el8::x86_64 dbus-daemon:1:1.12.8-23.el8::x86_64 libarchive:3.3.3-4.el8::x86_64 npth:1.5-4.el8::x86_64 libssh-config:0.9.6-3.el8::noarch python3-librepo:1.14.2-3.el8::x86_64 libmodulemd:2.13.0-1.el8::x86_64 python3-hawkey:0.63.0-11.1.el8::x86_64 libreport-filesystem:2.9.5-15.el8::x86_64 python3-dnf-plugins-core:4.0.21-14.1.el8::noarch gdb-gdbserver:8.2-19.el8::x86_64 langpacks-en:1.0-12.el8::noarch ] []}

@Maddosaurus
Copy link
Contributor Author

Run against the unpacked RHCOS 4.11 ISO image with a live-copy rpm Packages DB:

Nodescan finished. Returned components: &{0xc00046c540 [] rhcos:4.11 - [ ][ mozjs60:60.9.0-4.el8::x86_64 geolite2-country:20180605-1.el8::noarch make:1:4.2.1-11.el8::x86_64 redhat-release:8.6-0.1.el8::x86_64 libsmbios:2.4.1-2.el8::x86_64 glibc-all-langpacks:2.28-189.5.el8_6::x86_64 platform-python-pip:9.0.3-22.el8::noarch popt:1.18-1.el8::x86_64 coreutils:8.30-12.el8::x86_64 libtalloc:2.3.3-1.el8::x86_64 kmod:25-19.el8::x86_64 libtdb:1.4.4-1.el8::x86_64 openldap:2.4.46-18.el8::x86_64 libzstd:1.4.4-1.el8::x86_64 libusbx:1.0.23-4.el8::x86_64 sed:4.5-5.el8::x86_64 bind-libs-lite:32:9.11.36-3.el8_6.1::x86_64 libsss_idmap:2.6.2-4.el8_6.1::x86_64 libverto-libevent:0.3.0-5.el8::x86_64 findutils:1:4.6.0-20.el8::x86_64 perl-Data-Dumper:2.167-399.el8::x86_64 efivar-libs:37-4.el8::x86_64 perl-IO-Socket-SSL:2.066-4.el8::noarch xmlsec1:1.2.25-4.el8::x86_64 perl-Text-ParseWords:3.30-395.el8::noarch libbpf:0.4.0-3.el8::x86_64 perl-parent:1:0.237-1.el8::noarch e2fsprogs-libs:1.45.6-4.el8::x86_64 perl-threads:1:2.21-2.el8::x86_64 grep:3.1-6.el8::x86_64 rpm-ostree-libs:2022.2-2.el8::x86_64 gdbm:1:1.18-1.el8::x86_64 libkcapi-hmaccalc:1.2.0-2.el8::x86_64 vim-minimal:2:8.0.1763-19.el8_6.4::x86_64 rpcbind:1.2.5-8.el8::x86_64 ethtool:2:5.13-1.el8::x86_64 unbound-libs:1.7.3-17.el8::x86_64 less:530-1.el8::x86_64 libwbclient:0:4.15.5-10.el8_6::x86_64 libtirpc:1.1.4-6.el8::x86_64 cryptsetup:2.3.7-2.el8::x86_64 openssl:1:1.1.1k-7.el8_6::x86_64 authselect:1.2.2-3.el8::x86_64 systemd-libs:239-58.el8_6.8::x86_64 afterburn-dracut:5.3.0-1.rhaos4.11.el8::x86_64 libevent:2.1.8-5.el8::x86_64 kernel:4.18.0-372.32.1.el8_6::x86_64 fuse:2.9.7-15.el8::x86_64 NetworkManager-ovs:1:1.36.0-9.el8_6::x86_64 libpwquality:1.4.4-3.el8::x86_64 conntrack-tools:1.4.4-10.el8::x86_64 python3-setools:4.3.0-3.el8::x86_64 cryptsetup-reencrypt:2.3.7-2.el8::x86_64 tpm2-tss:2.3.2-4.el8::x86_64 sg3_utils:1.44-5.el8::x86_64 perl-Time-Local:1:1.280-1.el8::noarch nmap-ncat:2:7.70-6.el8::x86_64 perl-HTTP-Tiny:0.074-1.el8::noarch WALinuxAgent-udev:2.3.0.2-2.el8_6.3::noarch perl-Socket:4:2.027-3.el8::x86_64 python3-setuptools-wheel:39.2.0-6.el8::noarch perl-Text-Tabs+Wrap:2013.0523-395.el8::noarch ncurses-base:6.1-9.20180224.el8::noarch fuse-common:3.3.0-15.el8::x86_64 libselinux:2.9-5.el8::x86_64 xkeyboard-config:2.28-1.el8::noarch zlib:1.2.11-19.el8_6::x86_64 linux-firmware:20220210-108.git6342082c.el8_6::noarch info:6.5-7.el8::x86_64 redhat-release-eula:8.6-0.1.el8::x86_64 elfutils-libelf:0.186-1.el8::x86_64 efi-filesystem:3-3.el8::noarch sqlite-libs:3.26.0-16.el8_6::x86_64 ncurses-libs:6.1-9.20180224.el8::x86_64 libattr:2.4.48-3.el8::x86_64 glibc:2.28-189.5.el8_6::x86_64 libgcrypt:1.8.5-7.el8_6::x86_64 libcom_err:1.45.6-4.el8::x86_64 libxslt:1.1.32-6.el8::x86_64 libgpg-error:1.31-1.el8::x86_64 gdbm-libs:1:1.18-1.el8::x86_64 libuuid:2.32.1-35.el8::x86_64 libmaxminddb:1.2.0-10.el8::x86_64 readline:7.0-10.el8::x86_64 tar:2:1.30-5.el8::x86_64 keyutils-libs:1.5.10-9.el8::x86_64 libksba:1.3.5-8.el8_6::x86_64 libref_array:0.1.5-39.el8::x86_64 userspace-rcu:0.10.1-4.el8::x86_64 libdhash:0.5.0-39.el8::x86_64 squashfs-tools:4.3-20.el8::x86_64 jansson:2.14-1.el8::x86_64 groff-base:1.22.3-18.el8::x86_64 libacl:2.2.53-1.el8::x86_64 libnetfilter_cttimeout:1.0.0-11.el8::x86_64 libseccomp:2.5.2-1.el8::x86_64 freetype:2.9.1-4.el8_3.1::x86_64 grub2-common:1:2.02-123.el8_6.8::noarch gawk:4.2.1-4.el8::x86_64 libnfnetlink:1.0.1-13.el8::x86_64 crypto-policies-scripts:20211116-1.gitae470d6.el8::noarch nettle:3.4.1-7.el8::x86_64 libblkid:2.32.1-35.el8::x86_64 libselinux-utils:2.9-5.el8::x86_64 kmod-libs:25-19.el8::x86_64 libtool-ltdl:2.4.6-25.el8::x86_64 libnfsidmap:1:2.3.3-51.el8::x86_64 libffi:3.1-23.el8::x86_64 cracklib:2.9.6-15.el8::x86_64 fstrm:0.6.1-2.el8::x86_64 adcli:0.8.2-12.el8::x86_64 libibverbs:37.2-1.el8::x86_64 libfdisk:2.32.1-35.el8::x86_64 keyutils:1.5.10-9.el8::x86_64 perl-URI:1.73-3.el8::noarch iptables:1.8.4-22.el8::x86_64 perl-Term-Cap:1.17-395.el8::noarch bubblewrap:0.4.0-1.el8::x86_64 perl-Storable:1:3.11-3.el8::x86_64 libyaml:0.1.7-5.el8::x86_64 perl-libs:4:5.26.3-421.el8::x86_64 pcre:8.42-6.el8::x86_64 fuse3-libs:3.3.0-15.el8::x86_64 libteam:1.31-2.el8::x86_64 mpfr:3.1.6-1.el8::x86_64 coreos-installer:0.15.0-2.rhaos4.11.el8::x86_64 attr:2.4.48-3.el8::x86_64 mokutil:1:0.3.0-11.el8_6.1::x86_64 gdisk:1.0.3-9.el8::x86_64 python3-ply:3.9-9.el8::noarch libipa_hbac:2.6.2-4.el8_6.1::x86_64 python3-sssdconfig:2.6.2-4.el8_6.1::noarch libpng:2:1.6.34-5.el8::x86_64 dosfstools:4.1-6.el8::x86_64 libpath_utils:0.2.1-39.el8::x86_64 newt:0.52.20-11.el8::x86_64 libsigsegv:2.11-5.el8::x86_64 sg3_utils-libs:1.44-5.el8::x86_64 libnsl2:1.2.0-2.20180605git4a062cf.el8::x86_64 libldb:2.4.1-1.el8::x86_64 platform-python:3.6.8-47.el8_6::x86_64 libndp:1.7-6.el8::x86_64 openssl-pkcs11:0.4.10-2.el8::x86_64 util-linux:2.32.1-35.el8::x86_64 shadow-utils:2:4.6-16.el8::x86_64 libsss_nss_idmap:2.6.2-4.el8_6.1::x86_64 dbus-libs:1:1.12.8-18.el8_6.1::x86_64 yajl:2.1.0-10.el8::x86_64 which:2.21-17.el8::x86_64 oniguruma:6.8.2-2.el8::x86_64 libsss_certmap:2.6.2-4.el8_6.1::x86_64 kbd-misc:2.0.4-10.el8::noarch python3-libselinux:2.9-5.el8::x86_64 pkgconf-m4:1.4.2-1.el8::noarch fuse-overlayfs:1.9-1.rhaos4.11.el8::x86_64 libpsl:0.20.2-6.el8::x86_64 gzip:1.9-13.el8_5::x86_64 rpm-libs:4.14.3-24.el8_6::x86_64 pam:1.3.1-16.el8_6.1::x86_64 selinux-policy-targeted:3.14.3-95.el8_6.4::noarch jose:10-2.el8::x86_64 openvswitch-selinux-extra-policy:1.0-29.el8fdp::noarch python3-libsemanage:2.9-8.el8::x86_64 device-mapper:8:1.02.181-3.el8_6.2::x86_64 dbus-tools:1:1.12.8-18.el8_6.1::x86_64 elfutils-default-yama-scope:0.186-1.el8::noarch perl-Digest:1.17-395.el8::noarch dbus-daemon:1:1.12.8-18.el8_6.1::x86_64 perl-Net-SSLeay:1.88-1.el8::x86_64 trousers:0.3.15-1.el8::x86_64 perl-Mozilla-CA:20160104-7.el8::noarch sssd-krb5-common:2.6.2-4.el8_6.1::x86_64 perl-File-Temp:0.230.600-1.el8::noarch NetworkManager-libnm:1:1.36.0-9.el8_6::x86_64 perl-podlators:4.11-1.el8::noarch os-prober:1.74-9.el8::x86_64 perl-MIME-Base64:3.15-396.el8::x86_64 kpartx:0.8.4-22.el8_6.2::x86_64 perl-Errno:0:1.28-421.el8::x86_64 grub2-tools-extra:1:2.02-123.el8_6.8::x86_64 perl-Exporter:5.72-396.el8::noarch polkit-pkla-compat:0.1-12.el8::x86_64 perl-Unicode-Normalize:1.25-396.el8::x86_64 sssd-proxy:2.6.2-4.el8_6.1::x86_64 perl-File-Path:2.15-2.el8::noarch libgusb:0.3.0-1.el8::x86_64 gpgme:1.13.1-11.el8::x86_64 pinentry:1.1.0-2.el8::x86_64 librepo:1.14.2-1.el8::x86_64 ostree-libs:2022.1-2.el8::x86_64 afterburn:5.3.0-1.rhaos4.11.el8::x86_64 libmodulemd:2.13.0-1.el8::x86_64 kernel-core:4.18.0-372.32.1.el8_6::x86_64 libkcapi:1.2.0-2.el8::x86_64 grub2-pc:1:2.02-123.el8_6.8::x86_64 kernel-modules:4.18.0-372.32.1.el8_6::x86_64 iscsi-initiator-utils-iscsiuio:6.2.1.4-4.git095f59c.el8::x86_64 dracut-squash:049-202.git20220511.el8_6::x86_64 dracut-network:049-202.git20220511.el8_6::x86_64 iscsi-initiator-utils:6.2.1.4-4.git095f59c.el8::x86_64 runc:3:1.1.2-1.rhaos4.11.el8::x86_64 gssproxy:0.8.0-20.el8::x86_64 libmicrohttpd:1:0.9.59-2.el8::x86_64 containers-common:2:1-21.rhaos4.11.el8::noarch samba-client-libs:0:4.15.5-10.el8_6::x86_64 cups-libs:1:2.2.6-45.el8_6.2::x86_64 sssd-ad:2.6.2-4.el8_6.1::x86_64 sssd-common-pac:2.6.2-4.el8_6.1::x86_64 luksmeta:9-4.el8::x86_64 sssd:2.6.2-4.el8_6.1::x86_64 device-mapper-multipath:0.8.4-22.el8_6.2::x86_64 clevis-luks:15-8.el8::x86_64 systemd-journal-remote:239-58.el8_6.8::x86_64 clevis-dracut:15-8.el8::x86_64 openvswitch2.17:2.17.0-62.el8fdp::x86_64 toolbox:0.1.0-1.rhaos4.11.el8::noarch kexec-tools:2.0.20-68.el8::x86_64 nfs-utils:1:2.3.3-51.el8::x86_64 rpm-ostree:2022.2-2.el8::x86_64 glusterfs-fuse:6.0-56.4.el8::x86_64 passwd:0.80-4.el8::x86_64 kernel-modules-extra:4.18.0-372.32.1.el8_6::x86_64 console-login-helper-messages-issuegen:0.20.4-1.rhaos4.11.el8::noarch shim-x64:15.6-1.el8::x86_64 NetworkManager-tui:1:1.36.0-9.el8_6::x86_64 console-login-helper-messages-profile:0.20.4-1.rhaos4.11.el8::noarch qemu-guest-agent:15:6.2.0-11.module+el8.6.0+16538+01ea313d.6:virt:rhel:x86_64 NetworkManager-cloud-setup:1:1.36.0-9.el8_6::x86_64 openssh-server:8.0p1-13.el8::x86_64 bootupd:0.2.5-3.rhaos4.11.el8::x86_64 stalld:1.17-3.el8_6::x86_64 mdadm:4.2-2.el8::x86_64 git-core:2.31.1-2.el8::x86_64 strace:5.13-4.el8::x86_64 cloud-utils-growpart:0.31-3.el8::noarch openshift-clients:4.11.0-202211072116.p0.g142cb44.assembly.stream.el8::x86_64 sudo:1.8.29-8.el8::x86_64 rdma-core:37.2-1.el8::x86_64 e2fsprogs:1.45.6-4.el8::x86_64 tmux:2.7-1.el8::x86_64 nano:2.9.8-1.el8::x86_64 compat-openssl10:1:1.0.2o-4.el8_6::x86_64 cri-tools:1.24.2-6.el8::x86_64 rsync:3.1.3-14.el8_6.3::x86_64 perl-interpreter:4:5.26.3-421.el8::x86_64 nss-altfiles:2.18.1-12.el8::x86_64 trousers-lib:0.3.15-1.el8::x86_64 perl-macros:4:5.26.3-421.el8::x86_64 socat:1.7.4.1-1.el8::x86_64 perl-IO:0:1.38-421.el8::x86_64 bind-utils:32:9.11.36-3.el8_6.1::x86_64 logrotate:3.14.0-4.el8::x86_64 libdaemon:0.14-15.el8::x86_64 isns-utils-libs:0.99-1.el8::x86_64 libssh:0.9.6-3.el8::x86_64 xmlsec1-openssl:1.2.25-4.el8::x86_64 python3-pyyaml:3.12-12.el8::x86_64 python3-bind:32:9.11.36-3.el8_6.1::noarch python3-audit:3.0.7-2.el8.2::x86_64 npth:1.5-4.el8::x86_64 teamd:1.31-2.el8::x86_64 libpkgconf:1.4.2-1.el8::x86_64 slang:2.3.2-3.el8::x86_64 libpciaccess:0.14-1.el8::x86_64 checkpolicy:2.9-1.el8::x86_64 libnghttp2:1.33.0-3.el8_2.1::x86_64 lmdb-libs:0.9.24-1.el8::x86_64 pciutils-libs:3.7.0-1.el8::x86_64 brotli:1.0.6-3.el8::x86_64 cpio:2.12-11.el8::x86_64 libsmartcols:2.32.1-35.el8::x86_64 openssh:8.0p1-13.el8::x86_64 libsss_autofs:2.6.2-4.el8_6.1::x86_64 sssd-client:2.6.2-4.el8_6.1::x86_64 libnet:1.1.6-15.el8::x86_64 crun:1.4.2-1.rhaos4.11.el8::x86_64 libmspack:0.7-0.3.alpha.el8.4::x86_64 jq:1.6-3.el8::x86_64 quota:1:4.04-14.el8::x86_64 libreport-filesystem:2.9.5-15.el8::x86_64 kbd:2.0.4-10.el8::x86_64 pkgconf-pkg-config:1.4.2-1.el8::x86_64 publicsuffix-list-dafsa:20180723-1.el8::noarch libcurl:7.61.1-22.el8_6.4::x86_64 rpm:4.14.3-24.el8_6::x86_64 policycoreutils:2.9-19.el8::x86_64 selinux-policy:3.14.3-95.el8_6.4::noarch python3-policycoreutils:2.9-19.el8::noarch container-selinux:2:2.188.0-1.rhaos4.11.el8::noarch libsolv:0.7.20-1.el8::x86_64 clevis:15-8.el8::x86_64 device-mapper-libs:8:1.02.181-3.el8_6.2::x86_64 elfutils-debuginfod-client:0.186-1.el8::x86_64 elfutils-libs:0.186-1.el8::x86_64 dbus-common:1:1.12.8-18.el8_6.1::noarch systemd-pam:239-58.el8_6.8::x86_64 dbus:1:1.12.8-18.el8_6.1::x86_64 glib2:2.56.4-158.el8_6.1::x86_64 sssd-common:2.6.2-4.el8_6.1::x86_64 polkit-libs:0.115-13.el8_5.2::x86_64 json-glib:1.4.4-1.el8::x86_64 NetworkManager:1:1.36.0-9.el8_6::x86_64 device-mapper-event-libs:8:1.02.181-3.el8_6.2::x86_64 conmon:2:2.1.2-2.rhaos4.11.el8::x86_64 console-login-helper-messages:0.20.4-1.rhaos4.11.el8::noarch gettext-libs:0.19.8.1-17.el8::x86_64 grub2-tools-minimal:1:2.02-123.el8_6.8::x86_64 device-mapper-event:8:1.02.181-3.el8_6.2::x86_64 polkit:0.115-13.el8_5.2::x86_64 timedatex:0.5-3.el8::x86_64 sssd-krb5:2.6.2-4.el8_6.1::x86_64 libxmlb:0.1.15-1.el8::x86_64 slirp4netns:1.1.8-1.rhaos4.11.el8::x86_64 libgudev:232-4.el8::x86_64 libsecret:0.18.6-1.el8::x86_64 gnupg2-smime:2.2.20-3.el8_6::x86_64 grub2-pc-modules:1:2.02-123.el8_6.8::noarch pkgconf:1.4.2-1.el8::x86_64 libdrm:2.4.108-1.el8::x86_64 memstrack:0.1.11-1.el8::x86_64 pciutils:3.7.0-1.el8::x86_64 c-ares:1.13.0-6.el8::x86_64 openssh-clients:8.0p1-13.el8::x86_64 libsss_sudo:2.6.2-4.el8_6.1::x86_64 libxkbcommon:0.9.1-1.el8::x86_64 quota-nls:1:4.04-14.el8::noarch kbd-legacy:2.0.4-10.el8::noarch bash-completion:1:2.7-5.el8::noarch curl:7.61.1-22.el8_6.4::x86_64 rpm-plugin-selinux:4.14.3-24.el8_6::x86_64 policycoreutils-python-utils:2.9-19.el8::noarch tpm2-tools:4.1.1-5.el8::x86_64 cryptsetup-libs:2.3.7-2.el8::x86_64 gnutls:3.6.16-5.el8_6::x86_64 systemd:239-58.el8_6.8::x86_64 shared-mime-info:1.9-3.el8::x86_64 systemd-udev:239-58.el8_6.8::x86_64 samba-common:0:4.15.5-10.el8_6::noarch libcroco:0.6.12-4.el8_2.1::x86_64 gettext:0.19.8.1-17.el8::x86_64 lvm2-libs:8:2.03.14-3.el8_6.2::x86_64 sssd-ldap:2.6.2-4.el8_6.1::x86_64 libslirp:4.4.0-2.rhaos4.11.el8::x86_64 libgcab1:1.1-1.el8::x86_64 gnupg2:2.2.20-3.el8_6::x86_64 fwupd:1.7.4-2.el8::x86_64 initscripts:10.00.17-1.el8_6.2::x86_64 dracut:049-202.git20220511.el8_6::x86_64 grub2-tools:1:2.02-123.el8_6.8::x86_64 glusterfs:6.0-56.4.el8::x86_64 iputils:20180629-9.el8::x86_64 criu:3.15-4.rhaos4.11.el8::x86_64 podman:2:4.0.2-6.rhaos4.11.el8::x86_64 samba-common-libs:0:4.15.5-10.el8_6::x86_64 libsmbclient:0:4.15.5-10.el8_6::x86_64 libluksmeta:9-4.el8::x86_64 device-mapper-multipath-libs:0.8.4-22.el8_6.2::x86_64 cifs-utils:6.8-3.el8::x86_64 skopeo:2:1.5.2-3.rhaos4.11.el8::x86_64 ignition:2.14.0-4.rhaos4.11.el8::x86_64 grub2-efi-x64:1:2.02-123.el8_6.8::x86_64 audit:3.0.7-2.el8.2::x86_64 lvm2:8:2.03.14-3.el8_6.2::x86_64 NetworkManager-team:1:1.36.0-9.el8_6::x86_64 open-vm-tools:11.3.5-1.el8_6.1::x86_64 net-tools:2.0-0.52.20160912git.el8::x86_64 dnsmasq:2.79-21.el8_6.1::x86_64 xfsprogs:5.0.0-10.el8::x86_64 nvme-cli:1.16-3.el8::x86_64 coreos-installer-bootinfra:0.15.0-2.rhaos4.11.el8::x86_64 bsdtar:3.3.3-3.el8_5::x86_64 efibootmgr:16-1.el8::x86_64 hostname:3.20-6.el8::x86_64 subscription-manager-rhsm-certificates:1.28.29-3.el8::x86_64 perl-threads-shared:1.58-2.el8::x86_64 acl:2.2.53-1.el8::x86_64 hwdata:0.314-8.12.el8::noarch libnetfilter_cthelper:1.0.0-15.el8::x86_64 libssh-config:0.9.6-3.el8::noarch pigz:2.4-4.el8::x86_64 basesystem:11-5.el8::noarch krb5-libs:1.18.2-14.el8::x86_64 bash:4.4.20-4.el8_6::x86_64 crypto-policies:20211116-1.gitae470d6.el8::noarch libxcrypt:4.1.1-6.el8::x86_64 libmount:2.32.1-35.el8::x86_64 libmnl:1.0.4-6.el8::x86_64 iproute:5.15.0-4.el8_6.1::x86_64 libbasicobjects:0.1.1-39.el8::x86_64 cyrus-sasl-gssapi:2.1.27-6.el8_5::x86_64 libidn2:2.2.0-1.el8::x86_64 cracklib-dicts:2.9.6-15.el8::x86_64 expat:2.2.5-8.el8_6.3::x86_64 sssd-nfs-idmap:2.6.2-4.el8_6.1::x86_64 libaio:0.3.112-1.el8::x86_64 libutempter:1.1.6-14.el8::x86_64 libtasn1:4.13-3.el8::x86_64 perl-Pod-Escapes:1:1.07-395.el8::noarch p11-kit:0.23.22-1.el8::x86_64 perl-Pod-Simple:1:3.35-395.el8::noarch libpcap:14:1.9.1-5.el8::x86_64 perl-Getopt-Long:1:2.50-4.el8::noarch diffutils:3.6-6.el8::x86_64 perl-Scalar-List-Utils:3:1.49-2.el8::x86_64 lzo:2.08-14.el8::x86_64 perl-constant:1.33-396.el8::noarch fuse3:3.3.0-15.el8::x86_64 libuser:0.62-24.el8::x86_64 shadow-utils-subid:2:4.6-16.el8::x86_64 ostree:2022.1-2.el8::x86_64 snappy:1.1.8-3.el8::x86_64 authselect-libs:1.2.2-3.el8::x86_64 libss:1.45.6-4.el8::x86_64 podman-catatonit:2:4.0.2-6.rhaos4.11.el8::x86_64 hardlink:1:1.3-6.el8::x86_64 sssd-ipa:2.6.2-4.el8_6.1::x86_64 python3-libs:3.6.8-47.el8_6::x86_64 clevis-systemd:15-8.el8::x86_64 ca-certificates:2022.2.54-80.2.el8_6::noarch cri-o:1.24.3-5.rhaos4.11.gitc4567c0.el8::x86_64 libarchive:3.3.3-3.el8_5::x86_64 ostree-grub2:2022.1-2.el8::x86_64 glusterfs-libs:6.0-56.4.el8::x86_64 chrony:4.1-1.el8::x86_64 procps-ng:3.3.15-6.el8::x86_64 irqbalance:2:1.4.0-6.el8::x86_64 bind-libs:32:9.11.36-3.el8_6.1::x86_64 microcode_ctl:4:20220207-1.20220510.1.el8_6::x86_64 libdb-utils:5.3.28-42.el8_4::x86_64 openshift-hyperkube:4.11.0-202211072116.p0.g5157800.assembly.stream.el8::x86_64 perl-libnet:3.11-3.el8::noarch iproute-tc:5.15.0-4.el8_6.1::x86_64 perl-Term-ANSIColor:4.06-396.el8::noarch bzip2:1.0.6-26.el8::x86_64 perl-Pod-Usage:4:1.69-395.el8::noarch bind-license:32:9.11.36-3.el8_6.1::noarch perl-Carp:1.42-396.el8::noarch tzdata:2022f-1.el8::noarch libgcc:8.5.0-10.1.el8_6::x86_64 filesystem:3.8-6.el8::x86_64 python3-pip-wheel:9.0.3-22.el8::noarch glibc-common:2.28-189.5.el8_6::x86_64 geolite2-city:20180605-1.el8::noarch libcap:2.48-2.el8::x86_64 firewalld-filesystem:0.9.3-13.el8::noarch libunistring:0.9.9-3.el8::x86_64 setup:2.12.2-6.el8::noarch chkconfig:1.19.1-1.el8::x86_64 pcre2:10.32-3.el8_6::x86_64 audit-libs:3.0.7-2.el8.2::x86_64 glibc-gconv-extra:2.28-189.5.el8_6::x86_64 libnl3:3.5.0-1.el8::x86_64 libsepol:2.9-3.el8::x86_64 json-c:0.13.1-3.el8::x86_64 xz-libs:5.2.4-4.el8_6::x86_64 file:5.33-20.el8::x86_64 libxml2:2.9.7-13.el8_6.1::x86_64 fuse-libs:2.9.7-15.el8::x86_64 bzip2-libs:1.0.6-26.el8::x86_64 libnl3-cli:3.5.0-1.el8::x86_64 libtevent:0.11.0-0.el8::x86_64 nftables:1:0.9.3-25.el8::x86_64 libstdc++:8.5.0-10.1.el8_6::x86_64 libedit:3.1-23.20170329cvs.el8::x86_64 libcollection:0.7.0-39.el8::x86_64 ncurses:6.1-9.20180224.el8::x86_64 libcap-ng:0.7.11-1.el8::x86_64 libnetfilter_queue:1.0.4-3.el8::x86_64 libassuan:2.5.1-3.el8::x86_64 libicu:60.3-2.el8_1::x86_64 gmp:1:6.1.2-10.el8::x86_64 coreutils-common:8.30-12.el8::x86_64 libsemanage:2.9-8.el8::x86_64 libini_config:1.3.1-39.el8::x86_64 lz4-libs:1.8.3-3.el8_4::x86_64 platform-python-setuptools:39.2.0-6.el8::noarch protobuf-c:1.3.0-6.el8::x86_64 openssl-libs:1:1.1.1k-7.el8_6::x86_64 file-libs:5.33-20.el8::x86_64 libdb:5.3.28-42.el8_4::x86_64 libverto:0.3.0-5.el8::x86_64 cyrus-sasl-lib:2.1.27-6.el8_5::x86_64 lua-libs:5.3.4-12.el8::x86_64 avahi-libs:0.7-20.el8::x86_64 p11-kit-trust:0.23.22-1.el8::x86_64 libjose:10-2.el8::x86_64 libnetfilter_conntrack:1.0.6-5.el8::x86_64 glusterfs-client-xlators:6.0-56.4.el8::x86_64 iptables-libs:1.8.4-22.el8::x86_64 perl-Digest-MD5:2.55-396.el8::x86_64 libnftnl:1.1.5-5.el8::x86_64 perl-IO-Socket-IP:0.39-5.el8::noarch libgomp:8.5.0-10.1.el8_6::x86_64 perl-Pod-Perldoc:3.28-396.el8::noarch containernetworking-plugins:1.0.1-5.rhaos4.11.el8::x86_64 perl-Encode:4:2.97-3.el8::x86_64 psmisc:23.1-5.el8::x86_64 perl-PathTools:3.74-1.el8::x86_64 numactl-libs:2.0.12-13.el8::x86_64 xz:5.2.4-4.el8_6::x86_64 device-mapper-persistent-data:0.9.0-6.el8::x86_64 ] []}

@Maddosaurus Maddosaurus marked this pull request as ready for review December 2, 2022 16:04
@Maddosaurus Maddosaurus requested review from vikin91 and RTann December 2, 2022 16:04
Copy link
Contributor

@vikin91 vikin91 left a comment

Choose a reason for hiding this comment

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

This looks okay, but I see potential in documenting how this could be used without downloading the RHCOS iso.
I have also minor comments in the code.
I think we can merge this as a helper.

Maybe we could remove it from the Graphite stack and consider it separately (it does not depend on the code in #1026)?

flag.Parse()

logrus.Infof("%v", path)
if path == "" {
Copy link
Contributor

Choose a reason for hiding this comment

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

We could validate this with path.Exists() (need to check the func, writing this from memory)

flag.BoolVar(&uncertifiedRHEL, "uncertifiedRHEL", false, "Whether to treat this run as uncertified RHEL FS")
flag.Parse()

logrus.Infof("%v", path)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe let's write here some reasonable text? Will scan %s maybe?
And I would go for %s and add nil check.


components, err := nodes.Analyze("localnode", path, uncertifiedRHEL)
if err != nil {
logrus.Fatal(err)
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe some prefix here: Fatalf("Nodescan failed: %v", err)?

// local-nodescanner is an application that allows you to run the node scan / inventory code locally on you machine.

// Required:
// Extracted filesystem from an RHCOS live .ISO (https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/latest/)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is optional, right? We could also use this on RHCOS or other mounted filesystem.

Comment on lines +18 to +21
// How To:
// Download the ISO, extract with 7z x <iso-name>, then extract images/pxeboot/root.squashfs with 7z as well
// The root fs will be in ostree/deploy/rhcos/deploy/
// Caveat: The image doesn't contain a populated rpm Package DB. You still need to get that from a running system, e.g. a node.
Copy link
Contributor

Choose a reason for hiding this comment

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

This looks also optional for me.

Maybe we should convert these comments into a small readme in the tools/local-nodescanner?

- Roll back RegEx change
- Introduce IsRHCOSNamespace
- RHCOS has its RPM DB in a different path
- RHCOS provides a CPE json in a different path
@Maddosaurus Maddosaurus force-pushed the mm/rox-12967-fix-rhcos-detection branch from 8cd5f2a to 9fcc0a7 Compare January 3, 2023 13:58
Base automatically changed from mm/rox-12967-fix-rhcos-detection to master January 3, 2023 15:21
@openshift-ci
Copy link

openshift-ci bot commented Jan 3, 2023

@Maddosaurus: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/store-genesis-dump 8086ba0 link false /test store-genesis-dump
ci/prow/slim-e2e-tests 8086ba0 link false /test slim-e2e-tests
ci/prow/unit-tests 8086ba0 link true /test unit-tests
ci/prow/push-images 8086ba0 link true /test push-images
ci/prow/store-db-dump 8086ba0 link false /test store-db-dump
ci/prow/scale-tests 8086ba0 link false /test scale-tests
ci/prow/e2e-tests 8086ba0 link false /test e2e-tests
ci/prow/images 8086ba0 link true /test images
ci/prow/diff-dumps 8086ba0 link false /test diff-dumps
ci/prow/style-checks 8086ba0 link true /test style-checks
ci/prow/db-integration-tests 8086ba0 link false /test db-integration-tests

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@vikin91
Copy link
Contributor

vikin91 commented Jan 13, 2023

@Maddosaurus I still have this PR on my list - do we want to merge it or can it be dropped?

@Maddosaurus
Copy link
Contributor Author

Closing this PR to restart the process with a fresh main branch and slightly different methodology.

@RTann RTann deleted the mm/rox-12967-introduce-local-nodescanner branch August 21, 2024 17:12
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.

2 participants