Skip to content
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

Ubuntu Pro CLI tool cannot parse our kernel versions #6773

Closed
cfm opened this issue Mar 21, 2023 · 3 comments · Fixed by #6781
Closed

Ubuntu Pro CLI tool cannot parse our kernel versions #6773

cfm opened this issue Mar 21, 2023 · 3 comments · Fixed by #6781
Assignees

Comments

@cfm
Copy link
Member

cfm commented Mar 21, 2023

Description

Ubuntu Pro's pro utility runs some kind of nightly version check (or phones home?), but it chokes on our X.Y.Z-grsec-securedrop kernel versions.

Steps to Reproduce

Long-running QA instance with SecureDrop 2.5.2 and Ubuntu 20.04.6; no specific reproduction.

Expected Behavior

Not applicable

Actual Behavior

OSSEC alert:

OSSEC HIDS Notification.
2023 Mar 20 02:07:03

Received From: mon->/var/log/syslog
Rule: 1002 fired (level 2) -> "Unknown problem somewhere in the system."
Portion of the log(s):

Mar 20 02:07:02 mon python3[267258]: failed to process /proc/version_signature.



 --END OF NOTIFICATION



OSSEC HIDS Notification.
2023 Mar 20 02:07:03

Received From: mon->/var/log/syslog
Rule: 1002 fired (level 2) -> "Unknown problem somewhere in the system."
Portion of the log(s):

Mar 20 02:07:02 mon python3[267258]: Failed to parse kernel: 5.15.89-grsec-securedrop



 --END OF NOTIFICATION

Or manually:

sdadmin@mon:~$ pro status
failed to process /proc/version_signature.
Failed to parse kernel: 5.15.89-grsec-securedrop
SERVICE          AVAILABLE  DESCRIPTION
esm-apps         yes        Expanded Security Maintenance for Applications
esm-infra        yes        Expanded Security Maintenance for Infrastructure
fips             yes        NIST-certified core packages
fips-updates     yes        NIST-certified core packages with priority security updates
livepatch        yes        Canonical Livepatch service
usg              yes        Security compliance and audit tools

This machine is not attached to an Ubuntu Pro subscription.
See https://ubuntu.com/pro

Comments

At a minimum, we should silence this alert in securedrop/debian/ossec-server/var/ossec/rules/local_rules.xml. It might be worth time-boxing an investigation of the pro utility itself to see if it's phoning home, in which case we should consider removing ubuntu-advantage-tools during installation.

@legoktm
Copy link
Member

legoktm commented Mar 31, 2023

The kernel version parsing code is https://github.com/canonical/ubuntu-pro-client/blob/main/uaclient/system.py#L27 - this is basically the same problem as #6762 and will eventually be fixed by freedomofpress/kernel-builder#33

in which case we should consider removing ubuntu-advantage-tools during installation.

this seems sensible regardless.

@zenmonkeykstop
Copy link
Contributor

zenmonkeykstop commented Apr 13, 2023

Note that the approach of removing ubuntu-advantage-tools is infeasible due to dependencies in core Ubuntu packages. As per @legoktm's comment here: #6779 (comment) , it should be possible to disable and mask the timer triggering the pro tool, thereby preventing these errors.

@legoktm
Copy link
Member

legoktm commented Apr 13, 2023

From the discussion so far (with @nathandyer), we've identified two main areas where this comes into play.

  1. The ua-timer.service unit, which invokes timer.py, which I believe runs the uaclient stuff. Grepping for version_signature only finds hits in uaclient.
  2. an apt hook, 20apt-esm-hook.conf, which from reviewing the source code, appears to just be parsing the apt cache to see what, if any, updates are behind the paywall. it's not really phoning home, just hitting a few more apt repositories.

MaskingDisabling the systemd timer is trivial, we already do it for fwupd so I'll submit a PR shortly. Removing the apt hook is less so, we don't want to interfere with files other packages "own". So we would want to find a config setting to turn it off, or install a higher-numbered config file that somehow clobbers this one. Unclear if we need to go that far, it looks like part 1 should take care of the OSSEC notifications; I've applied to it to my prod instance and can report back tomorrow to see if they've stopped.

Source code link: https://git.launchpad.net/ubuntu/+source/ubuntu-advantage-tools/tree/?h=applied/ubuntu/focal-updates

legoktm added a commit that referenced this issue Apr 13, 2023
Ubuntu Pro's "uaclient" expects the Linux kernel package to be versioned
in a specific format that we are not currently compliant with. This
error message is triggering spurious OSSEC alerts.

While we do plan to fix our kernel versioning scheme, we really don't need
this Ubuntu Pro stuff, so let's disable it the same way we do with fwupd.

Fixes #6773.
@legoktm legoktm self-assigned this Apr 13, 2023
legoktm added a commit that referenced this issue May 5, 2023
…lerts

Ubuntu Pro's "uaclient" expects the Linux kernel package to be versioned
in a specific format that we are not currently compliant with. This
error message is triggering spurious OSSEC alerts.

While we do plan to fix our kernel versioning scheme, we really don't need
this Ubuntu Pro stuff, so let's disable it the same way we do with fwupd.

Since ua-timer is started by a timer, simply disabling it is enough.
But for esm-cache, it's invoked by an apt hook, so we need to mask it.

Fixes #6773.
legoktm added a commit that referenced this issue May 25, 2023
…lerts

Ubuntu Pro's "uaclient" expects the Linux kernel package to be versioned
in a specific format that we are not currently compliant with. This
error message is triggering spurious OSSEC alerts.

While we do plan to fix our kernel versioning scheme, we really don't need
this Ubuntu Pro stuff, so let's disable it the same way we do with fwupd.

Since ua-timer is started by a timer, simply disabling it is enough.
But for esm-cache, it's invoked by an apt hook, so we need to mask it.

Fixes #6773.
@cfm cfm closed this as completed in #6781 May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment