Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package sca-patterns-sle15 for openSUSE:Factory checked in at 2021-07-28 19:19:57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/sca-patterns-sle15 (Old) and /work/SRC/openSUSE:Factory/.sca-patterns-sle15.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "sca-patterns-sle15" Wed Jul 28 19:19:57 2021 rev:16 rq:908669 version:1.0.6 Changes: -------- --- /work/SRC/openSUSE:Factory/sca-patterns-sle15/sca-patterns-sle15.changes 2021-07-03 20:51:09.328627230 +0200 +++ /work/SRC/openSUSE:Factory/.sca-patterns-sle15.new.1899/sca-patterns-sle15.changes 2021-07-28 19:20:56.111565060 +0200 @@ -1,0 +2,8 @@ +Tue Jul 27 21:18:37 UTC 2021 - Jason Record <jason.rec...@suse.com> + +- Changes in version 1.0.6 + - New regular patterns (2) + + sle15all/cronlimit-000020338.py: crontab - More than 1000 entries in crontab file, can't install (bsc#1187508) + + sle15all/scc-expired.py: Identify if SCC registrations have expired + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sca-patterns-sle15-1.0.6.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sca-patterns-sle15-1.0.6/patterns/SLE/sle15all/cronlimit-000020338.py new/sca-patterns-sle15-1.0.6/patterns/SLE/sle15all/cronlimit-000020338.py --- old/sca-patterns-sle15-1.0.6/patterns/SLE/sle15all/cronlimit-000020338.py 1970-01-01 01:00:00.000000000 +0100 +++ new/sca-patterns-sle15-1.0.6/patterns/SLE/sle15all/cronlimit-000020338.py 2021-07-22 19:38:34.448046324 +0200 @@ -0,0 +1,118 @@ +#!/usr/bin/python +# +# Title: Pattern for TID000020338 +# Description: crontab - More than 1000 entries in crontab file, can't install +# Source: Package Version Pattern Template v0.3.8 +# Options: SLE,Cron,Limits,cronlimit,000020338,1187508,cronie,0,1.5.1-6.12.2,1 +# Distro: SLES15* +# Modified: 2021 Jul 22 +# +############################################################################## +# Copyright (C) 2021, SUSE LLC +############################################################################## +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <http://www.gnu.org/licenses/>. +# +# Authors/Contributors: +# Jason Record <jason.rec...@suse.com> +# +############################################################################## + +import re +import os +import Core +import SUSE + +META_CLASS = "SLE" +META_CATEGORY = "Cron" +META_COMPONENT = "Limits" +PATTERN_ID = os.path.basename(__file__) +PRIMARY_LINK = "META_LINK_TID" +OVERALL = Core.TEMP +OVERALL_INFO = "NOT SET" +OTHER_LINKS = "META_LINK_TID=https://www.suse.com/support/kb/doc/?id=000020338|META_LINK_BUG=https://bugzilla.suse.com/show_bug.cgi?id=1187508" + +Core.init(META_CLASS, META_CATEGORY, META_COMPONENT, PATTERN_ID, PRIMARY_LINK, OVERALL, OVERALL_INFO, OTHER_LINKS) + +############################################################################## +# Local Function Definitions +############################################################################## + +def bigUserCron(): + BIG_ENTRY_LIMIT = 100 + + FILE_OPEN = "cron.txt" + CONTENT = [] + IN_STATE = False + ENTRIES = 0 + if Core.loadFullFile(FILE_OPEN, CONTENT): + for LINE in CONTENT: + if( IN_STATE ): + if LINE.startswith("#==["): + IN_STATE = False + if( ENTRIES >= BIG_ENTRY_LIMIT ): + return True + else: + ENTRIES += 1 + elif LINE.startswith("# /var/spool/cron/tabs/"): + IN_STATE = True + ENTRIES = 0 + else: + Core.updateStatus(Core.ERROR, "ERROR: Empty file - " + FILE_OPEN) + + return False + +def systemLogError(): + AFFECTED_LIST = {} + IDX_LAST = -2 + fileOpen = "cron.txt" + section = "/bin/systemctl status cron.service" + content = [] + CONFIRMED = re.compile("CRON.*too many entries \(.*", re.IGNORECASE) + if Core.getRegExSection(fileOpen, section, content): + for line in content: + if CONFIRMED.search(line): + FILE = re.split(r'[()]', line) + AFFECTED_LIST[FILE[IDX_LAST]] = True + return AFFECTED_LIST + +############################################################################## +# Main Program Execution +############################################################################## + +RPM_NAME = 'cronie' +RPM_VERSION_FIXED = '2.0' +RPM_VERSION_BROKE = '1.5.1-6.12.2' +if( SUSE.packageInstalled(RPM_NAME) ): + INSTALLED_VERSION = SUSE.compareRPM(RPM_NAME, RPM_VERSION_FIXED) + if( INSTALLED_VERSION >= 0 ): + Core.updateStatus(Core.IGNORE, "Bug fixes applied for " + RPM_NAME) + else: + INSTALLED_VERSION = SUSE.compareRPM(RPM_NAME, RPM_VERSION_BROKE) + if( INSTALLED_VERSION == 0 ): + if( bigUserCron() ): + Core.updateStatus(Core.WARN, "User cron table files will be limited to 1000 entries") + else: + CRON_TABLES = systemLogError() + if( len(CRON_TABLES) > 0 ): + Core.updateStatus(Core.CRIT, "User cron table files have exceeded the entry limit: " + ' '.join(CRON_TABLES.keys())) + else: + Core.updateStatus(Core.IGNORE, "No individual cron entries to worry about") + else: + Core.updateStatus(Core.IGNORE, "Previously unaffected version of " + RPM_NAME + " installed") +else: + Core.updateStatus(Core.ERROR, "ERROR: " + RPM_NAME + " not installed") + + +Core.printPatternResults() + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sca-patterns-sle15-1.0.6/patterns/SLE/sle15all/scc-expired.py new/sca-patterns-sle15-1.0.6/patterns/SLE/sle15all/scc-expired.py --- old/sca-patterns-sle15-1.0.6/patterns/SLE/sle15all/scc-expired.py 1970-01-01 01:00:00.000000000 +0100 +++ new/sca-patterns-sle15-1.0.6/patterns/SLE/sle15all/scc-expired.py 2021-07-27 23:20:10.159468843 +0200 @@ -0,0 +1,101 @@ +#!/usr/bin/python + +# Title: Expired SCC Registrations +# Description: Identify if SCC registrations have expired +# Modified: 2015 May 07 +# +############################################################################## +# Copyright (C) 2015 SUSE LLC +############################################################################## +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see <http://www.gnu.org/licenses/>. +# +# Authors/Contributors: +# Jason Record (jrec...@suse.com) +# +############################################################################## + +############################################################################## +# Module Definition +############################################################################## + +import os +import Core +import SUSE +import datetime + +############################################################################## +# Overriden (eventually or in part) from Core.py Module +############################################################################## + +META_CLASS = "Basic Health" +META_CATEGORY = "SLE" +META_COMPONENT = "Registration" +PATTERN_ID = os.path.basename(__file__) +PRIMARY_LINK = "META_LINK_SCC" +OVERALL = Core.TEMP +OVERALL_INFO = "NOT SET" +OTHER_LINKS = "META_LINK_SCC=https://scc.suse.com/dashboard|META_LINK_Renew=https://www.suse.com/products/server/how-to-buy/" + +Core.init(META_CLASS, META_CATEGORY, META_COMPONENT, PATTERN_ID, PRIMARY_LINK, OVERALL, OVERALL_INFO, OTHER_LINKS) + +############################################################################## +# Main Program Execution +############################################################################## + +SCC_INFO = SUSE.getSCCInfo() +REG_EXPIRED = [] +REG_EXPIRING = [] +REG_VALID = [] +WARNING_DAYS = 60 +EXPIRE_DATE_FOUND = False +TODAY = datetime.datetime.today() +if( SCC_INFO ): + for PRODUCT in SCC_INFO: + #print "PRODUCT: " + str(PRODUCT) + EXPIRE_DATE = '' + EXPIRE_STR = '' + if 'expires_at' in PRODUCT: + EXPIRE_DATE_FOUND = True + TMP = PRODUCT['expires_at'].split() + del TMP[-1] + EXPIRE_DATE = TMP[0] + EXPIRE_STR = ' '.join(TMP) + EXPIRATION = datetime.datetime.strptime(EXPIRE_STR, "%Y-%m-%d %H:%M:%S") + EXPIRATION_WARNING = EXPIRATION - datetime.timedelta(days=int(WARNING_DAYS)) + if( EXPIRE_STR ): + if( TODAY > EXPIRATION ): + REG_EXPIRED.append(str(PRODUCT['identifier']) + " " + str(PRODUCT['version']) + ": " + str(EXPIRE_DATE)) + elif( TODAY > EXPIRATION_WARNING ): + REG_EXPIRING.append(str(PRODUCT['identifier']) + " " + str(PRODUCT['version']) + ": " + str(EXPIRE_DATE)) + else: + REG_VALID.append(str(PRODUCT['identifier']) + " " + str(PRODUCT['version']) + ": " + str(EXPIRE_DATE)) + + if( EXPIRE_DATE_FOUND ): + if( REG_EXPIRED ): + if( REG_EXPIRING ): + Core.updateStatus(Core.CRIT, "Detected expired product registrations: " + ' '.join(REG_EXPIRED) + "; expiring within " + str(WARNING_DAYS) + " days: " + ' '.join(REG_EXPIRING)) + else: + Core.updateStatus(Core.CRIT, "Detected expired product registrations: " + ' '.join(REG_EXPIRED)) + elif( REG_EXPIRING ): + Core.updateStatus(Core.WARN, "Detected product registrations expiring within " + str(WARNING_DAYS) + " days: " + ' '.join(REG_EXPIRING)) + else: + Core.updateStatus(Core.SUCC, "No product registrations have expired or will expire within " + str(WARNING_DAYS) + " days, " + ' '.join(REG_VALID)) + else: + Core.updateStatus(Core.ERROR, "SCC Status: No expire dates found") +else: + Core.updateStatus(Core.ERROR, "SCC Status: Not Found") + +Core.printPatternResults() + +