Author: gs
Date: Tue Sep 2 12:34:50 2008
New Revision: 50562
URL: http://svn.opensuse.org/viewcvs/yast?rev=50562&view=rev
Log:
configuration of LAF Auditing (auditd module renamde to
audit-laf)
Added:
trunk/audit-laf/
trunk/audit-laf/.cvsignore
trunk/audit-laf/MAINTAINER
trunk/audit-laf/Makefile.cvs
trunk/audit-laf/RPMNAME
trunk/audit-laf/VERSION
trunk/audit-laf/agents/
trunk/audit-laf/agents/.cvsignore
trunk/audit-laf/agents/Makefile.am
trunk/audit-laf/agents/auditd.scr
trunk/audit-laf/configure.in.in
trunk/audit-laf/doc/
trunk/audit-laf/doc/.cvsignore
trunk/audit-laf/doc/Makefile.am
trunk/audit-laf/doc/autodocs/
trunk/audit-laf/doc/autodocs/.cvsignore
trunk/audit-laf/doc/autodocs/Makefile.am
trunk/audit-laf/package/
trunk/audit-laf/package/.cvsignore
trunk/audit-laf/package/yast2-audit-laf.changes
trunk/audit-laf/src/
trunk/audit-laf/src/.cvsignore
trunk/audit-laf/src/AuditLaf.ycp
trunk/audit-laf/src/Makefile.am
trunk/audit-laf/src/audit-laf.desktop
trunk/audit-laf/src/audit-laf.ycp
trunk/audit-laf/src/audit-laf_auto.ycp
trunk/audit-laf/src/audit-laf_proposal.ycp
trunk/audit-laf/src/complex.ycp
trunk/audit-laf/src/dialogs.ycp
trunk/audit-laf/src/helps.ycp
trunk/audit-laf/src/wizards.ycp
trunk/audit-laf/testsuite/
trunk/audit-laf/testsuite/.cvsignore
trunk/audit-laf/testsuite/Makefile.am
trunk/audit-laf/testsuite/tests/
trunk/audit-laf/testsuite/tests/.cvsignore
trunk/audit-laf/testsuite/tests/TestModule.err
trunk/audit-laf/testsuite/tests/TestModule.out
trunk/audit-laf/testsuite/tests/TestModule.ycp
trunk/audit-laf/yast2-audit-laf.spec.in
Added: trunk/audit-laf/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/.cvsignore?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/.cvsignore (added)
+++ trunk/audit-laf/.cvsignore Tue Sep 2 12:34:50 2008
@@ -0,0 +1,20 @@
+Makefile
+Makefile.am
+Makefile.am.common
+Makefile.in
+aclocal.m4
+config.cache
+config.guess
+config.h.in
+config.log
+config.status
+config.sub
+configure
+configure.in
+depcomp
+install-sh
+missing
+mkinstalldirs
+stamp-h
+sshd.pot
+autom4te.cache
Added: trunk/audit-laf/MAINTAINER
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/MAINTAINER?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/MAINTAINER (added)
+++ trunk/audit-laf/MAINTAINER Tue Sep 2 12:34:50 2008
@@ -0,0 +1 @@
+Gabriele Mohr
Added: trunk/audit-laf/Makefile.cvs
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/Makefile.cvs?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/Makefile.cvs (added)
+++ trunk/audit-laf/Makefile.cvs Tue Sep 2 12:34:50 2008
@@ -0,0 +1,22 @@
+#
+# Makefile.cvs
+#
+PREFIX = /usr
+
+LIB = $(shell y2tool get-lib)
+
+configure: all
+ ./configure --prefix=$(PREFIX) --libdir=$(PREFIX)/$(LIB)
+
+all:
+ y2tool y2autoconf
+ y2tool y2automake
+ autoreconf --force --install
+
+install: configure
+ make
+ make install
+
+reconf: all
+ ./config.status --recheck
+ ./config.status
Added: trunk/audit-laf/RPMNAME
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/RPMNAME?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/RPMNAME (added)
+++ trunk/audit-laf/RPMNAME Tue Sep 2 12:34:50 2008
@@ -0,0 +1 @@
+yast2-audit-laf
Added: trunk/audit-laf/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/VERSION?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/VERSION (added)
+++ trunk/audit-laf/VERSION Tue Sep 2 12:34:50 2008
@@ -0,0 +1 @@
+2.15.0
Added: trunk/audit-laf/agents/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/agents/.cvsignore?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/agents/.cvsignore (added)
+++ trunk/audit-laf/agents/.cvsignore Tue Sep 2 12:34:50 2008
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Added: trunk/audit-laf/agents/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/agents/Makefile.am?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/agents/Makefile.am (added)
+++ trunk/audit-laf/agents/Makefile.am Tue Sep 2 12:34:50 2008
@@ -0,0 +1,5 @@
+# Makefile.am for laf-audit/agents
+
+scrconf_DATA = $(wildcard *.scr)
+
+EXTRA_DIST = $(scrconf_DATA)
Added: trunk/audit-laf/agents/auditd.scr
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/agents/auditd.scr?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/agents/auditd.scr (added)
+++ trunk/audit-laf/agents/auditd.scr Tue Sep 2 12:34:50 2008
@@ -0,0 +1,41 @@
+/**
+ * File:
+ * auditd.scr
+ * Summary:
+ * SCR Agent for reading/writing /etc/audit/auditd.conf
+ * using the ini-agent
+ * Access:
+ * read/write
+ * Authors:
+ * Gabriele Mohr
+ * Example:
+ * Dir(.auditd)
+ * (["log_file", "log_format", "priority_boost", "flush", ...])
+ *
+ * Read(.auditd.log_format)
+ * (["RAW"])
+ *
+ * Write(.auditd.max_log_file, 5)
+ * (true)
+ *
+ * $Id: auditd.scr
+ *
+ */
+
+.auditd
+
+`ag_ini(
+ `IniAgent( "/etc/audit/auditd.conf",
+ $[
+ "options" : [ "global_values", "repeat_names", "flat" ],
+ "comments" : [ "^[ \t]*#.*$", "^[ \t]*$" ],
+ "params" : [
+ // Options with one value ('yes' / 'no')
+ $[ "match" : [ "^[ \t]*([^ \t]+)[ \t = ]+([^ \t]+)[ \t]+$", "%s = %s" ]],
+ // Options with more possible values
+ $[ "match" : [ "^[ \t]*([^ \t]+)[ \t = ]+(.+)[ \t]*$", "%s = %s" ]],
+ ],
+ "subindent" : " ",
+ ]
+ )
+)
Added: trunk/audit-laf/configure.in.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/configure.in.in?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/configure.in.in (added)
+++ trunk/audit-laf/configure.in.in Tue Sep 2 12:34:50 2008
@@ -0,0 +1,12 @@
+## YCP module configure.in.in
+
+## Initialize
+@YAST2-INIT-COMMON@
+@YAST2-INIT-YCP@
+
+## some common checks
+@YAST2-CHECKS-COMMON@
+@YAST2-CHECKS-YCP@
+
+## and generate the output...
+@YAST2-OUTPUT@
Added: trunk/audit-laf/doc/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/doc/.cvsignore?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/doc/.cvsignore (added)
+++ trunk/audit-laf/doc/.cvsignore Tue Sep 2 12:34:50 2008
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Added: trunk/audit-laf/doc/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/doc/Makefile.am?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/doc/Makefile.am (added)
+++ trunk/audit-laf/doc/Makefile.am Tue Sep 2 12:34:50 2008
@@ -0,0 +1,10 @@
+# Makefile.am for audit-laf/doc
+
+SUBDIRS = autodocs
+
+htmldir = $(docdir)
+
+doc_DATA =
+html_DATA =
+
+EXTRA_DIST = $(doc_DATA) $(html_DATA)
Added: trunk/audit-laf/doc/autodocs/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/doc/autodocs/.cvsignore?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/doc/autodocs/.cvsignore (added)
+++ trunk/audit-laf/doc/autodocs/.cvsignore Tue Sep 2 12:34:50 2008
@@ -0,0 +1,3 @@
+Makefile
+Makefile.in
+*.html
Added: trunk/audit-laf/doc/autodocs/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/doc/autodocs/Makefile.am?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/doc/autodocs/Makefile.am (added)
+++ trunk/audit-laf/doc/autodocs/Makefile.am Tue Sep 2 12:34:50 2008
@@ -0,0 +1,3 @@
+# Makefile.am for audit-laf/doc/autodocs
+
+include $(top_srcdir)/autodocs-ycp.ami
Added: trunk/audit-laf/package/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/package/.cvsignore?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/package/.cvsignore (added)
+++ trunk/audit-laf/package/.cvsignore Tue Sep 2 12:34:50 2008
@@ -0,0 +1,2 @@
+*.spec
+*.bz2
Added: trunk/audit-laf/package/yast2-audit-laf.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/package/yast2-audit-laf.changes?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/package/yast2-audit-laf.changes (added)
+++ trunk/audit-laf/package/yast2-audit-laf.changes Tue Sep 2 12:34:50 2008
@@ -0,0 +1,4 @@
+-------------------------------------------------------------------
+Tue Sep 2 10:28:35 2008 - gs@suse.de
+
+- initial version
Added: trunk/audit-laf/src/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/.cvsignore?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/src/.cvsignore (added)
+++ trunk/audit-laf/src/.cvsignore Tue Sep 2 12:34:50 2008
@@ -0,0 +1,4 @@
+Makefile
+Makefile.in
+*.ybc
+.dep
Added: trunk/audit-laf/src/AuditLaf.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/AuditLaf.ycp?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/src/AuditLaf.ycp (added)
+++ trunk/audit-laf/src/AuditLaf.ycp Tue Sep 2 12:34:50 2008
@@ -0,0 +1,530 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * 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, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: modules/AuditLaf.ycp
+ * Package: Configuration of audit-laf
+ * Summary: AuditLaf settings, input and output functions
+ * Authors: Gabriele Mohr
+ *
+ *
+ * Representation of the configuration of audit-laf.
+ * Input and output routines.
+ */
+
+{
+
+module "AuditLaf";
+textdomain "audit-laf";
+
+import "Progress";
+import "Report";
+import "Summary";
+import "Message";
+import "Popup";
+import "Mode";
+import "FileUtils";
+import "Service";
+
+
+/**
+ * Prototypes
+ */
+global boolean Modified();
+
+/**
+ * Data was modified?
+ */
+boolean modified = false;
+
+/**
+ */
+boolean proposal_valid = false;
+
+/**
+ * Filename (path) rules file
+ */
+string rules_file = "/etc/audit/audit.rules";
+
+/**
+ * Filename (path) config file
+ */
+string config_file = "/etc/audit/auditd.conf";
+
+/**
+ * Write only, used during autoinstallation.
+ * Don't run services and SuSEconfig, it's all done at one place.
+ */
+boolean write_only = false;
+
+boolean rules_locked = false;
+
+global void SetRulesLocked( boolean value ) {
+ rules_locked = value;
+}
+
+global boolean RulesLocked() {
+ return rules_locked;
+}
+
+/**
+ * Return rules file path
+ */
+global string GetRulesFile() {
+ return rules_file;
+}
+
+global string GetConfigFile() {
+ return config_file;
+}
+
+global list <string> GetWatches() {
+ return ( [ "exit,always watch=/etc/passwd perm=rwx",
+ "entry,always watch=/etc/sysconfig/yast2 perm=rwx"] );
+}
+
+/**
+ * Data was modified?
+ * @return true if modified
+ */
+global boolean Modified() {
+ y2milestone("modified=%1",modified);
+ return modified;
+}
+
+/**
+ * Mark as modified, for Autoyast.
+ */
+global void SetModified(boolean value) {
+ modified = true;
+ }
+
+global boolean ProposalValid() {
+ return proposal_valid;
+}
+
+global void SetProposalValid(boolean value) {
+ proposal_valid = value;
+}
+
+/**
+ * @return true if module is marked as "write only" (don't start services etc...)
+ */
+global boolean WriteOnly() {
+ return write_only;
+}
+
+/**
+ * Set write_only flag (for autoinstalation).
+ */
+global void SetWriteOnly(boolean value) {
+ write_only = value;
+}
+
+/**
+ Returns a confirmation popup dialog whether user wants to really abort.
+ */
+global boolean Abort() {
+ return Popup::ReallyAbort(Modified());
+}
+
+/**
+ * Checks whether an Abort button has been pressed.
+ * If so, calls function to confirm the abort call.
+ *
+ * @return boolean true if abort confirmed
+ */
+global boolean PollAbort() {
+ // Do not check UI when running in CommandLine mode
+ if (Mode::commandline())
+ return false;
+
+ if (UI::PollInput() == `abort)
+ return Abort();
+
+ return false;
+}
+
+//
+// Settings: Define all variables needed for configuration of auditd
+//
+
+/**
+ * map of audit settings (from /etc/audit/auditd.conf)
+ */
+map SETTINGS = $[];
+
+/**
+ * default settings for /etc/audit/auditd.conf
+ */
+map DEFAULT_CONFIG = $[
+ "log_file" : ["/var/log/audit/audit.log"],
+ "log_format" : ["RAW"],
+ "priority_boost" : ["3"],
+ "flush" : ["INCREMENTAL"],
+ "freq" : ["20"],
+ "num_logs" : ["4"],
+ "dispatcher" : ["/sbin/audispd"],
+ "disp_qos" : ["lossy"],
+ "max_log_file" : ["5"],
+ "max_log_file_action" : ["ROTATE"],
+ "space_left" : ["75"],
+ "space_left_action" : ["SYSLOG"],
+ "action_mail_acct" : ["root"],
+ "admin_space_left": ["50"],
+ "admin_space_left_action" : ["SUSPEND"],
+ "disk_full_action" : ["SUSPEND"],
+ "disk_error_action" : ["SUSPEND"]
+];
+
+/**
+ * Rules for the subsystem audit (passed via auditctl)
+ * are read from /etc/audit/audit.rules
+ */
+string RULES = "";
+
+/**
+ * Get value of given option from SEETINGS
+ */
+global string GetAuditdOption( string key) {
+ list <string> option_list = SETTINGS[key]:DEFAULT_CONFIG[key]:[];
+
+ if ( option_list != [] )
+ return option_list[0]:"";
+ else
+ return "";
+}
+
+/**
+ * Set option to given value in SETTINGS
+ */
+
+global boolean SetAuditdOption( string key, string value ) {
+ list <string> option_list = [];
+
+ if ( value != "" )
+ {
+ option_list = add( option_list, value );
+ SETTINGS[key] = option_list;
+ y2milestone( "Setting %1 to %2", key, option_list );
+ return true;
+ }
+ else
+ return false;
+}
+
+/**
+ * Get all rules
+ */
+global string GetRules() {
+ return RULES;
+}
+
+/*
+ * Set rules
+ */
+global boolean SetRules( string rules ) {
+ if ( rules != nil && rules != "" )
+ {
+ RULES = rules;
+ return true;
+ }
+ else
+ return false;
+}
+
+/**
+ * Read rules from audit.rules
+ */
+boolean ReadAuditRules() {
+
+ string rules = (string)SCR::Read(.target.string, rules_file );
+
+ if ( rules != nil && rules != "" )
+ {
+ RULES = rules;
+ return true;
+ }
+ else
+ return false;
+}
+
+/**
+ * Write rules to audit.rules
+ */
+boolean WriteAuditRules() {
+ boolean success = (boolean)SCR::Write(.target.string, rules_file, RULES );
+ return success;
+}
+
+
+/**
+ * Read settings from auditd.conf
+ * @return true on success
+ */
+boolean ReadAuditdSettings() {
+
+ if ( ! FileUtils::Exists ( config_file) )
+ return false;
+
+ list <string> optionsList = (list <string>) SCR::Dir(.auditd);
+ y2milestone( "List of options: %1", optionsList );
+
+ // list all options set in auditd.conf
+ foreach (string key, (list <string>) SCR::Dir(.auditd),
+ {
+ // and read the value for each of them
+ list <string> val = (list <string>) SCR::Read(add(.auditd, key));
+ if (val != nil) SETTINGS[key] = val;
+ });
+
+ y2milestone("%1 has been read: %2", config_file, SETTINGS);
+ return true;
+}
+
+/**
+ * Read all auditd settings
+ * @return true on success
+ */
+global boolean Read() {
+ boolean success = true;
+
+ /* AuditLaf read dialog caption */
+ string caption = _("Initializing Audit Configuration");
+
+ // Set the right number of stages
+ integer steps = 3;
+
+ integer sl = 500;
+ sleep(sl);
+
+ // We do not set help text here, because it was set outside
+ Progress::New( caption, " ", steps, [
+ /* Progress stage 1/4 */
+ _("Read the configuration for auditd"),
+ /* Progress stage 2/4 */
+ _("Read the rules file"),
+ /* Progress stage 3/4 */
+ _("Check status of auditd")
+ /* Progress stage 3/4 */
+ ], [
+ /* Progress step 1/3 */
+ _("Reading the configuration..."),
+ /* Progress step 2/3 */
+ _("Reading the rules file..."),
+ /* Progress step 3/3 */
+ _("Cecking status..." ),
+ Message::Finished()
+ ],
+ ""
+ );
+
+ // read database
+ if(PollAbort()) return false;
+ Progress::NextStage();
+
+ success = ReadAuditdSettings();
+
+ // Report error
+ if( !success) Report::Error(_("Cannot read auditd.conf."));
+ sleep(sl);
+
+ // read another database
+ if(PollAbort()) return false;
+ Progress::NextStep();
+
+ success = ReadAuditRules();
+
+ /* Error message */
+ if(!success) Report::Error(_("Cannot read audit.rules."));
+ sleep(sl);
+
+ // read current settings
+ if(PollAbort()) return false;
+ Progress::NextStage();
+ /* Error message */
+ if(false) Report::Error(Message::CannotReadCurrentSettings());
+ sleep(sl);
+
+ Progress::NextStage();
+ integer auditd_stat = Service::Status( "auditd" );
+ y2milestone( "Auditd running: %1", (auditd_stat == 0 )?"yes":"no" );
+
+ integer apparmor_stat = (integer)SCR::Execute(.target.bash, "rcapparmor status" );
+ y2milestone( "Apparmor loaded: %1", (apparmor_stat == 0 )?"yes":"no" );
+
+ if ( apparmor_stat == 0 && auditd_stat != 0 )
+ {
+ Popup::LongText( _("Auditd not running"),
+ `RichText(_("<p>The <i>apparmor</i> kernel module is loaded
+but the daemon <i>auditd</i> doesn't run.<br>
+Please start the YaST module 'System Services' (Runlevel Editor), and
+activate (start) <i>auditd</i>.<p>")), 40, 12 );
+ return false;
+ }
+
+ if(PollAbort()) return false;
+ modified = false;
+ return true;
+}
+
+/**
+ * Write settings to auditd.conf
+ * @return true on success
+ */
+boolean WriteAuditdSettings() {
+ boolean success = true;
+
+ if ( ! FileUtils::Exists ( config_file ) )
+ return false;
+
+ // list all options set in auditd.conf
+ foreach (string key, list <string> value, SETTINGS, {
+ // and write each value
+ success = (boolean)SCR::Write(add(.auditd, key), value );
+ });
+
+ // This is very important
+ // it flushes the cache, and stores the configuration on the disk
+ SCR::Write(.etc.ssh.sshd_config, nil);
+ y2milestone("%1 has been written: %2", config_file, SETTINGS);
+
+ return true;
+}
+
+/**
+ * Write all auditd settings
+ * @return true on success
+ */
+global boolean Write() {
+ boolean success = true;
+
+ /* Auditd read dialog caption */
+ string caption = _("Saving Audit Configuration");
+
+ // set the right number of stages
+ integer steps = 2;
+
+ integer sl = 500;
+ sleep(sl);
+
+ // Names of the stages
+ // We do not set help text here, because it was set outside
+ Progress::New(caption, " ", steps, [
+ /* Progress stage 1/2 */
+ _("Write the settings"),
+ /* Progress stage 2/2 */
+ _("Write the rules")
+ ], [
+ /* Progress step 1/2 */
+ _("Writing the settings..."),
+ /* Progress step 2/2 */
+ _("Writing the rules..."),
+ Message::Finished()
+ ],
+ ""
+ );
+
+ // write settings
+ if(PollAbort()) return false;
+ Progress::NextStage();
+
+ success = WriteAuditdSettings();
+ /* Error message */
+ if(!success) Report::Error (_("Cannot write settings to auditd.conf.") );
+ sleep(sl);
+
+ // restart auditd
+ integer exitCode = Service::RunInitScript( "auditd", "restart" );
+
+ if(PollAbort()) return false;
+ Progress::NextStage ();
+ success = WriteAuditRules();
+ /* Error message */
+ if(!success) Report::Error (_("Cannot write settings to auditd.rules.") );
+ sleep(sl);
+
+ // call auditctl -R audit.rules
+ map output = (map)SCR::Execute( .target.bash_output, "auditctl -R /etc/audit/audit.rules" );
+
+ if ( output["exit"]:0 != 0 )
+ {
+ Report::Error( sformat( "%1\n%2",
+ output["stderr"]:"",
+ _("Please start yast2-audit-laf again and check the rules") ) );
+ }
+
+ if(PollAbort()) return false;
+ return true;
+}
+
+/**
+ * Get all auditd settings from the first parameter
+ * (For use by autoinstallation.)
+ * @param settings The YCP structure to be imported.
+ * @return boolean True on success
+ */
+global boolean Import (map settings) {
+ // TODO FIXME: your code here (fill the above mentioned variables)...
+ return true;
+}
+
+/**
+ * Dump the auditd settings to a single map
+ * (For use by autoinstallation.)
+ * @return map Dumped settings (later acceptable by Import ())
+ */
+global map Export () {
+ // TODO FIXME: your code here (return the above mentioned variables)...
+ return $[];
+}
+
+/**
+ * Create a textual summary and a list of unconfigured cards
+ * @return summary of the current configuration
+ */
+global list Summary() {
+ // TODO FIXME: your code here...
+ /* Configuration summary text for autoyast */
+ return [ _("Configuration summary..."), [] ];
+}
+
+/**
+ * Create an overview table with all configured cards
+ * @return table items
+ */
+global list Overview() {
+ // TODO FIXME: your code here...
+ return [];
+}
+
+/**
+ * Return packages needed to be installed and removed during
+ * Autoinstallation to insure module has all needed software
+ * installed.
+ * @return map with 2 lists.
+ */
+global map AutoPackages() {
+ // TODO FIXME: your code here...
+ return $[ "install":[], "remove":[] ];
+}
+
+/* EOF */
+}
Added: trunk/audit-laf/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/Makefile.am?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/src/Makefile.am (added)
+++ trunk/audit-laf/src/Makefile.am Tue Sep 2 12:34:50 2008
@@ -0,0 +1,29 @@
+# Makefile.am for audit-laf/src
+
+yncludedir = @yncludedir@/audit-laf
+
+client_DATA = \
+ audit-laf.ycp \
+ audit-laf_auto.ycp \
+ audit-laf_proposal.ycp
+
+ynclude_DATA = \
+ helps.ycp \
+ wizards.ycp \
+ dialogs.ycp \
+ complex.ycp
+
+desktop_DATA = \
+ audit-laf.desktop
+
+module_DATA = \
+ AuditLaf.ycp
+
+# create a symlink for local build, #145327
+audit-laf:
+ ln -sf . $@
+ycpchook = audit-laf
+
+EXTRA_DIST = $(client_DATA) $(ynclude_DATA) $(module_DATA) $(desktop_DATA)
+
+include $(top_srcdir)/Makefile.am.common
Added: trunk/audit-laf/src/audit-laf.desktop
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/audit-laf.desktop?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/src/audit-laf.desktop (added)
+++ trunk/audit-laf/src/audit-laf.desktop Tue Sep 2 12:34:50 2008
@@ -0,0 +1,25 @@
+[Desktop Entry]
+Type=Application
+Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Misc;
+
+X-KDE-ModuleType=Library
+X-KDE-RootOnly=true
+X-KDE-HasReadOnlyMode=true
+X-KDE-Library=yast2
+X-SuSE-YaST-Call=audit-laf
+
+X-SuSE-YaST-Group=Misc
+X-SuSE-YaST-Argument=
+X-SuSE-YaST-RootOnly=true
+X-SuSE-YaST-AutoInst=
+X-SuSE-YaST-Geometry=
+X-SuSE-YaST-SortKey=
+X-SuSE-YaST-AutoInstResource=audit-laf
+
+Icon=yast-audit-laf
+Exec=/sbin/yast2 audit-laf
+
+Name=AuditLaf
+GenericName=audit-laf
+X-KDE-SubstituteUID=true
+StartupNotify=true
Added: trunk/audit-laf/src/audit-laf.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/audit-laf.ycp?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/src/audit-laf.ycp (added)
+++ trunk/audit-laf/src/audit-laf.ycp Tue Sep 2 12:34:50 2008
@@ -0,0 +1,93 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * 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, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: clients/audit-laf.ycp
+ * Package: Configuration of audit-laf
+ * Summary: Main file
+ * Authors: Gabriele Mohr
+ *
+ *
+ * Main file for audit-laf configuration. Uses all other files.
+ */
+
+{
+
+/***
+ * <h3>Configuration of audit-laf</h3>
+ */
+
+textdomain "audit-laf";
+
+/* The main () */
+y2milestone ("----------------------------------------");
+y2milestone ("yast2-audit-laf module started");
+
+import "Progress";
+import "Report";
+import "Summary";
+
+import "CommandLine";
+
+include "audit-laf/wizards.ycp";
+
+map cmdline_description = $[
+ "id" : "audit-laf",
+ /* Command line help text for the Xaudit-laf module */
+ "help" : _("Configuration of audit-laf"),
+ "guihandler" : AuditLafSequence,
+ "initialize" : AuditLaf::Read,
+ "finish" : AuditLaf::Write,
+ "actions" : $[
+ // FIXME TODO: fill the functionality description here
+ ],
+ "options" : $[
+ // FIXME TODO: fill the option descriptions here
+ ],
+ "mappings" : $[
+ // FIXME TODO: fill the mappings of actions and options here
+ ]
+];
+
+/* is this proposal or not? */
+boolean propose = false;
+list args = WFM::Args();
+if(size(args) > 0) {
+ if(is(WFM::Args(0), path) && WFM::Args(0) == .propose) {
+ y2milestone("Using PROPOSE mode");
+ propose = true;
+ }
+}
+
+/* main ui function */
+any ret = nil;
+
+if(propose) ret = AuditLafAutoSequence();
+else ret = CommandLine::Run(cmdline_description);
+y2debug("ret=%1", ret);
+
+/* Finish */
+y2milestone("yast2-audit-laf module finished");
+y2milestone("----------------------------------------");
+
+return ret;
+
+/* EOF */
+}
Added: trunk/audit-laf/src/audit-laf_auto.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/audit-laf_auto.ycp?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/src/audit-laf_auto.ycp (added)
+++ trunk/audit-laf/src/audit-laf_auto.ycp Tue Sep 2 12:34:50 2008
@@ -0,0 +1,134 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * 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, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: clients/audit-laf_auto.ycp
+ * Package: Configuration of audit-laf
+ * Summary: Client for autoinstallation
+ * Authors: Gabriele Mohr
+ *
+ * $Id: audit-laf_auto.ycp 41350 2007-10-10 16:59:00Z dfiser $
+ *
+ * This is a client for autoinstallation. It takes its arguments,
+ * goes through the configuration and return the setting.
+ * Does not do any changes to the configuration.
+ */
+
+/**
+ * @param function to execute
+ * @param map/list of audit-laf settings
+ * @return map edited settings, Summary or boolean on success depending on called function
+ * @example map mm = $[ "FAIL_DELAY" : "77" ];
+ * @example map ret = WFM::CallFunction ("audit-laf_auto", [ "Summary", mm ]);
+ */
+
+{
+
+textdomain "audit-laf";
+
+y2milestone("----------------------------------------");
+y2milestone("AuditLaf auto started");
+
+import "AuditLaf";
+include "audit-laf/wizards.ycp";
+
+any ret = nil;
+string func = "";
+map param = $[];
+
+/* Check arguments */
+if(size(WFM::Args()) > 0 && is(WFM::Args(0), string)) {
+ func = (string)WFM::Args(0);
+ if(size(WFM::Args()) > 1 && is(WFM::Args(1), map))
+ param = (map) WFM::Args(1);
+}
+y2debug("func=%1", func);
+y2debug("param=%1", param);
+
+/* Create a summary*/
+if(func == "Summary") {
+ ret = select(AuditLaf::Summary(), 0, "");
+}
+/* Reset configuration */
+else if (func == "Reset") {
+ AuditLaf::Import($[]);
+ ret = $[];
+}
+/* Change configuration (run AutoSequence) */
+else if (func == "Change") {
+ ret = AuditLafAutoSequence();
+}
+/* Import configuration */
+else if (func == "Import") {
+ ret = AuditLaf::Import(param);
+}
+/* Return actual state */
+else if (func == "Export") {
+ ret = AuditLaf::Export();
+}
+/* Return needed packages */
+else if (func == "Packages") {
+ ret = AuditLaf::AutoPackages();
+}
+/* Read current state */
+else if (func == "Read") {
+ import "Progress";
+ boolean progress_orig = Progress::set (false);
+ ret = AuditLaf::Read();
+ Progress::set (progress_orig);
+}
+/* Write givven settings */
+else if (func == "Write") {
+ import "Progress";
+ boolean progress_orig = Progress::set (false);
+ AuditLaf::SetWriteOnly (true);
+ ret = AuditLaf::Write();
+ Progress::set (progress_orig);
+}
+/**
+ * did configuration changed
+ * return boolean
+ */
+else if (func == "GetModified") {
+ ret = AuditLaf::Modified ();
+}
+/**
+ * set configuration as changed
+ * return boolean
+ */
+else if (func == "SetModified") {
+ AuditLaf::SetModified (true);
+ ret = true;
+}
+
+/* Unknown function */
+else {
+ y2error("Unknown function: %1", func);
+ ret = false;
+}
+
+y2debug("ret=%1", ret);
+y2milestone("AuditLaf auto finished");
+y2milestone("----------------------------------------");
+
+return ret;
+
+/* EOF */
+}
Added: trunk/audit-laf/src/audit-laf_proposal.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/audit-laf_proposal.ycp?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/src/audit-laf_proposal.ycp (added)
+++ trunk/audit-laf/src/audit-laf_proposal.ycp Tue Sep 2 12:34:50 2008
@@ -0,0 +1,107 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * 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, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: clients/audit-laf_proposal.ycp
+ * Package: Configuration of audit-laf
+ * Summary: Proposal function dispatcher.
+ * Authors: Gabriele Mohr
+ *
+ * $Id: audit-laf_proposal.ycp 41350 2007-10-10 16:59:00Z dfiser $
+ *
+ * Proposal function dispatcher for audit-laf configuration.
+ * See source/installation/proposal/proposal-API.txt
+ */
+
+{
+
+textdomain "audit-laf";
+
+import "AuditLaf";
+import "Progress";
+
+/* The main () */
+y2milestone("----------------------------------------");
+y2milestone("AuditLaf proposal started");
+
+string func = (string) WFM::Args(0);
+map param = (map) WFM::Args(1);
+map ret = $[];
+
+/* create a textual proposal */
+if(func == "MakeProposal") {
+ string proposal = "";
+ string warning = nil;
+ symbol warning_level = nil;
+ boolean force_reset = param["force_reset"]:false;
+
+ if(force_reset || !AuditLaf::ProposalValid()) {
+ AuditLaf::SetProposalValid (true);
+ boolean progress_orig = Progress::set (false);
+ AuditLaf::Read();
+ Progress::set (progress_orig);
+ }
+ list sum = AuditLaf::Summary();
+ proposal = sum[0]:"";
+
+ ret = $[
+ "preformatted_proposal" : proposal,
+ "warning_level" : warning_level,
+ "warning" : warning,
+ ];
+}
+/* run the module */
+else if(func == "AskUser") {
+ map stored = AuditLaf::Export();
+ symbol seq = (symbol) WFM::CallFunction("audit-laf", [.propose]);
+ if(seq != `next) AuditLaf::Import(stored);
+ y2debug("stored=%1",stored);
+ y2debug("seq=%1",seq);
+ ret = $[
+ "workflow_sequence" : seq
+ ];
+}
+/* create titles */
+else if(func == "Description") {
+ ret = $[
+ /* Rich text title for AuditLaf in proposals */
+ "rich_text_title" : _("AuditLaf"),
+ /* Menu title for AuditLaf in proposals */
+ "menu_title" : _("&AuditLaf"),
+ "id" : "audit-laf",
+ ];
+}
+/* write the proposal */
+else if(func == "Write") {
+ AuditLaf::Write();
+}
+/* unknown function */
+else {
+ y2error("unknown function: %1", func);
+}
+
+/* Finish */
+y2debug("ret=%1",ret);
+y2milestone("AuditLaf proposal finished");
+y2milestone("----------------------------------------");
+return ret;
+
+/* EOF */
+}
Added: trunk/audit-laf/src/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/complex.ycp?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/src/complex.ycp (added)
+++ trunk/audit-laf/src/complex.ycp Tue Sep 2 12:34:50 2008
@@ -0,0 +1,414 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * 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, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/audit-laf/complex.ycp
+ * Package: Configuration of LAF Auditing
+ * Summary: Dialogs definitions
+ * Authors: Gabriele Mohr
+ *
+ */
+
+{
+
+textdomain "audit-laf";
+
+import "Label";
+import "Popup";
+import "Wizard";
+import "Wizard_hw";
+import "Confirm";
+import "AuditLaf";
+
+
+include "audit-laf/helps.ycp";
+
+/**
+ * Return a modification status
+ * @return true if data was modified
+ */
+boolean Modified() {
+ return AuditLaf::Modified();
+}
+
+boolean ReallyAbort() {
+ return !AuditLaf::Modified() || Popup::ReallyAbort(true);
+}
+
+boolean PollAbort() {
+ return UI::PollInput() == `abort;
+}
+
+/**
+ * Read settings dialog
+ * @return `abort if aborted and `next otherwise
+ */
+symbol ReadDialog() {
+ Wizard::RestoreHelp(HELPS["read"]:"");
+ // AuditLaf::SetAbortFunction(PollAbort);
+ if (!Confirm::MustBeRoot()) return `abort;
+ boolean ret = AuditLaf::Read();
+ return ret ? `next : `abort;
+}
+
+/**
+ * Write settings dialog
+ * @return `abort if aborted and `next otherwise
+ */
+symbol WriteDialog() {
+ Wizard::RestoreHelp(HELPS["write"]:"");
+ // AuditLaf::SetAbortFunction(PollAbort);
+ boolean ret = AuditLaf::Write();
+ return ret ? `next : `abort;
+}
+
+void InitLogfileSettingsDialog (string id) {
+
+ UI::ChangeWidget( `id("max_log_file"), `ValidChars, "0123456789" );
+
+ // Set all values to values read from /etc/audit/auditd.conf
+ UI::ChangeWidget( `id("freq"), `Value, tointeger( AuditLaf::GetAuditdOption("freq")) );
+ UI::ChangeWidget( `id("num_logs"), `Value, tointeger( AuditLaf::GetAuditdOption("num_logs")) );
+ foreach (string key, ["log_file",
+ "max_log_file",
+ "action_mail_acct",
+ "name"
+ ], {
+ UI::ChangeWidget(`id(key), `Value, (AuditLaf::GetAuditdOption(key)));
+ });
+
+ foreach (string key, ["log_format",
+ "flush",
+ "max_log_file_action",
+ "name_format"
+ ], {
+ UI::ChangeWidget(`id(key), `Value, toupper(AuditLaf::GetAuditdOption(key)) );
+ });
+
+
+ y2milestone( "Init logfile settings");
+}
+
+symbol HandleLogfileSettingsDialog(string id, map event) {
+ any action = event["ID"]:nil;
+
+ if ( action == "select_file" )
+ {
+ string file_name = UI::AskForExistingFile("/var/log/audit", "*.log", _("Select the log file") );
+
+ UI::ChangeWidget( `id("log_file"), `Value, file_name );
+ y2milestone( "Logfile set to: %1", file_name );
+ }
+ return nil;
+}
+
+boolean ReallyExit () {
+ // yes-no popup
+ return Popup::YesNo (_("Really exit?
+All changes will be lost."));
+}
+
+void StoreLogfileSettingsDialog (string id, map event) {
+
+ AuditLaf::SetModified( true );
+
+ // Store all values in SETTINGS
+ AuditLaf::SetAuditdOption( "freq", tostring( (integer)UI::QueryWidget( `id("freq"), `Value ) ) );
+ AuditLaf::SetAuditdOption( "num_logs", tostring( (integer)UI::QueryWidget( `id("num_logs"), `Value ) ) );
+
+ foreach (string key, ["log_file",
+ "log_format",
+ "max_log_file",
+ "flush",
+ "max_log_file_action",
+ "action_mail_acct",
+ "name_format",
+ "name"
+ ], {
+ AuditLaf::SetAuditdOption( key, (string) UI::QueryWidget(`id(key), `Value) );
+ });
+ y2milestone( "Store logfile settings" );
+
+}
+void InitDispatcherDialog (string id) {
+
+ // Set all values to values read from /etc/audit/auditd.conf
+ foreach (string key, ["dispatcher",
+ "disp_qos" ], {
+ UI::ChangeWidget(`id(key), `Value, (AuditLaf::GetAuditdOption(key)));
+ });
+
+ y2milestone( "Init dispatcher dialog" );
+}
+
+symbol HandleDispatcherDialog(string id, map event) {
+ any action = event["ID"]:nil;
+
+ if ( action == "select_disp" )
+ {
+ string file_name = UI::AskForExistingFile("/sbin", "*", _("Select the dispatcher program") );
+
+ UI::ChangeWidget( `id("dispatcher"), `Value, file_name );
+ y2milestone( "Dispatcher program set to: %1", file_name );
+ }
+ return nil;
+}
+
+void StoreDispatcherDialog (string id, map event) {
+
+ AuditLaf::SetModified( true );
+
+ // Store all values in SETTINGS
+ foreach (string key, ["dispatcher",
+ "disp_qos"], {
+ AuditLaf::SetAuditdOption( key, (string) UI::QueryWidget(`id(key), `Value) );
+ });
+
+ y2milestone( "Store dispatcher dialog" );
+}
+
+
+void InitDiskspaceSettingsDialog (string id) {
+ UI::ChangeWidget( `id("space_left"), `ValidChars, "0123456789" );
+ UI::ChangeWidget( `id("admin_space_left"), `ValidChars, "0123456789" );
+
+ // Set all values to values read from /etc/audit/auditd.conf
+ foreach (string key, ["space_left",
+ "admin_space_left"
+ ], {
+ UI::ChangeWidget(`id(key), `Value, (AuditLaf::GetAuditdOption(key)));
+ });
+
+ foreach (string key, ["space_left_action",
+ "admin_space_left_action",
+ "disk_full_action",
+ "disk_error_action"
+ ], {
+ UI::ChangeWidget(`id(key), `Value, toupper(AuditLaf::GetAuditdOption(key)) );
+ });
+
+
+ y2milestone( "Init diskspace settings" );
+}
+
+void StoreDiskspaceSettingsDialog (string id, map event) {
+ AuditLaf::SetModified( true );
+
+ foreach (string key, ["space_left",
+ "admin_space_left",
+ "space_left_action",
+ "admin_space_left_action",
+ "disk_full_action",
+ "disk_error_action"
+ ], {
+ AuditLaf::SetAuditdOption( key, (string) UI::QueryWidget(`id(key), `Value) );
+ });
+
+ y2milestone( "Store diskspace settings" );
+}
+
+void InitRulesDialog( string id ) {
+ string rules = AuditLaf::GetRules();
+ string combo_box_id = "disabled";
+
+ UI::ChangeWidget( `id( "rules"), `Value, rules );
+ list <string> rules_list = splitstring( rules, "\n" );
+
+ foreach ( string rule, rules_list, {
+ if ( regexpmatch( rule, "^[ /t]*-e[ /t]*2" ) )
+ {
+ combo_box_id = "locked";
+ }
+ else if ( regexpmatch( rule, "^[ /t]*-e[ /t]*1" ) )
+ {
+ combo_box_id = "enabled";
+ }
+ else if ( regexpmatch( rule, "^[ /t]*-e[ /t]*0" ) )
+ {
+ combo_box_id = "disabled";
+ }
+ } );
+ UI::ChangeWidget( `id( "audit_enabled"), `Value, combo_box_id );
+
+ y2milestone ( "Init rules dialog" );
+}
+
+symbol HandleRulesDialog(string id, map event) {
+ any action = event["ID"]:nil;
+
+ if ( action == "audit_enabled" )
+ {
+ string value = (string)UI::QueryWidget( `id("audit_enabled"), `Value );
+ string rule = "";
+ string rules = AuditLaf::GetRules();
+ list <string> rules_list = [];
+
+ y2milestone( "Setting status to: %1", value );
+
+ switch ( value )
+ {
+ case "locked": {
+ rule = "-e 2";
+ break;
+ }
+ case "enabled": {
+ rule = "-e 1";
+ break;
+ }
+ case "disabled": {
+ rule = "-e 0";
+ break;
+ }
+ }
+
+ if ( rules != nil && rules != "")
+ {
+ rules_list = splitstring( rules, "\n");
+ }
+
+ boolean rule_found = false;
+
+ if ( rules_list != [] )
+ {
+ list<string> new_rules = maplist( string line, rules_list, {
+ if ( regexpmatch( line, "^[ /t]*-e" ) )
+ {
+ rule_found = true;
+ return rule;
+ }
+ else
+ {
+ return line;
+ }
+ });
+ if ( !rule_found )
+ new_rules = add( new_rules, rule );
+
+ UI::ChangeWidget(`id("rules"), `Value, mergestring( new_rules, "\n" ) );
+ }
+ }
+ else if ( action == "restore" )
+ {
+ UI::ChangeWidget( `id("rules"), `Value, AuditLaf::GetRules() );
+ }
+ else if ( action == "reset" )
+ {
+ UI::ChangeWidget( `id("rules"), `Value, AuditLaf::GetRules() );
+ integer exit_code = (integer)SCR::Execute( .target.bash, "auditctl -D" );
+ if ( exit_code == 0 )
+ exit_code = (integer)SCR::Execute( .target.bash, "auditctl -R /etc/audit/audit.rules" );
+ if ( exit_code == 0 )
+ Popup::Message( _("Rules successfully restored" ) );
+ else
+ Report::Error( _("Cannot reset rules, please test again" ) );
+ }
+ else if ( action == "test" )
+ {
+ boolean go_on = true;
+
+ string rules = (string)UI::QueryWidget( `id("rules"), `Value );
+ list <string> rules_list = splitstring( rules, "\n");
+
+ foreach ( string rule, rules_list, {
+ if ( regexpmatch( rule, "^[ /t]*-e[ /t]*2" ) )
+ {
+ boolean yes = Report::Warning( _("Lock is set in audit.rules (-e 2).\n
+It doesn't make sense to continue, because the rules would
+be locked until next boot.") );
+ go_on = false;
+ }
+ } );
+
+ if ( go_on )
+ {
+ string tmpfile = (string) SCR::Read (.target.tmpdir) + "/rules_test_file";
+
+ boolean success = (boolean)SCR::Write(.target.string, tmpfile, rules );
+ if ( success )
+ {
+ map output = (map)SCR::Execute(.target.bash_output, sformat( "auditctl -R %1", tmpfile ) );
+ if ( output["exit"]:0 != 0 )
+ {
+ Report::Error( sformat( output["stderr"]:"" ) );
+ }
+ else
+ {
+ Popup::Message( "Success");
+ }
+ }
+ else
+ {
+ Report::Error( _("Cannnot create tmp file for rules" ) );
+ }
+ }
+ }
+ else if ( action == "load" )
+ {
+ string file_name = UI::AskForExistingFile("/usr/share/doc/packages/audit", "*.rules", _("Select an example") );
+ string example_rules = (string)SCR::Read(.target.string, file_name );
+
+ UI::ChangeWidget( `id("rules"), `Value, example_rules );
+ y2milestone( "Example rules loaded: %1", file_name );
+ }
+
+ return nil;
+}
+
+void StoreRulesDialog( string id, map event) {
+ string rules = (string)UI::QueryWidget( `id("rules"), `Value );
+
+ AuditLaf::SetRules( rules );
+
+ y2debug( "RULES: %1", rules );
+ y2milestone( "Store rules dialog" );
+}
+
+symbol CheckSettings() {
+ symbol ret = `next;
+ AuditLaf::SetRulesLocked( false );
+
+ string rules = AuditLaf::GetRules();
+ list <string> rules_list = splitstring( rules, "\n");
+
+ y2milestone( "Checking rules..." );
+
+ foreach ( string rule, rules_list, {
+ if ( regexpmatch( rule, "^[ /t]*-e[ /t]*2" ) )
+ {
+ boolean yes = Popup::AnyQuestion( _("Lock set"), _("The audit configuration is locked (option -e 2).
+This means the rules are locked next boot! In this case
+the lock option must be the last entry in the rules file.
+If you want to check or to change the rules,
+please go back to rules editor."),
+ Label::ContinueButton(),
+ Label::BackButton(),
+ `focus_no );
+ if ( yes )
+ ret = `next;
+ else
+ ret = `back;
+ AuditLaf::SetRulesLocked( true );
+ }
+ } );
+ return ret;
+}
+
+/* EOF */
+}
Added: trunk/audit-laf/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/dialogs.ycp?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/src/dialogs.ycp (added)
+++ trunk/audit-laf/src/dialogs.ycp Tue Sep 2 12:34:50 2008
@@ -0,0 +1,284 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * 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, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/audit-laf/dialogs.ycp
+ * Package: Configuration of LAF Auditing
+ * Summary: Dialogs definitions
+ * Authors: Gabriele Mohr
+ *
+ */
+
+{
+
+textdomain "audit-laf";
+
+import "Label";
+import "Wizard";
+import "AuditLaf";
+
+include "audit-laf/helps.ycp";
+
+map current_ui_settings = UI::GetDisplayInfo();
+
+integer mbox_x = 1;
+integer mbox_y = 0.5;
+
+// Tabs have a different layout in textmode
+if (current_ui_settings["TextMode"]:false == true) {
+ mbox_x = 0;
+ mbox_y = 0;
+}
+
+term LogfileSettingsDialogContent () {
+ return `MarginBox( mbox_x, mbox_y,
+ `VBox(
+ `VStretch(),
+ `Frame (
+ _("General Settings"),
+ `VBox (
+
+ `VSquash(
+ `HBox(
+ // Label for InputField
+ `InputField(`id("log_file"), `opt(`hstretch), _("Logfile")),
+ `HSpacing(2.0),
+ `VBox(
+ `VSpacing(),
+ // Label for PushButton
+ `Bottom(`PushButton(`id("select_file"), _("Select Fi&le")))
+ )
+ )
+ ),
+ `VBox(
+ `HBox(`HWeight( 1,`ComboBox(`id("log_format"), _("Format"),
+ [
+ `item(`id("RAW"), "RAW", true ),
+ `item(`id("NOLOG"), "NOLOG" )
+ ])
+ ),
+ `HSpacing(2.0),
+ `HWeight( 1, `IntField(`id("num_logs"), `opt(`hstretch), _("Number of Logfiles"), 0, 99, 4) )
+ ),
+ `HBox(
+ `HWeight( 1, `ComboBox(`id("flush"), _("Flush"),
+ [`item(`id("NONE"), "NONE" ),
+ `item(`id("INCREMENTAL"), "INCREMENTAL", true ),
+ `item(`id("DATA"), "DATA" ),
+ `item(`id("SYNC"), "SYNC" )
+ ])
+ ),
+ `HSpacing(2.0),
+ `HWeight( 1, `IntField(`id("freq"), `opt(`hstretch), _("Frequence"), 0, 10000, 20 ))
+ )
+ )
+ )
+ ),
+ `VStretch(),
+ `Frame (
+ _("Size and Action"),
+ `HBox (
+ /* A text entry */
+ `HWeight( 1, `InputField(`id("max_log_file"), _("Ma&x File Size (MB)")) ),
+ `HSpacing(2.0),
+ `HWeight( 1, `ComboBox(`id("max_log_file_action"), _("Maximum File Size Action"),
+ [`item(`id("IGNORE"), "IGNORE" ),
+ `item(`id("SYSLOG"), "SYSLOG", true ),
+ `item(`id("SUSPEND"), "SUSPEND" ),
+ `item(`id("ROTATE"), "ROTATE" ),
+ `item(`id("KEEP_LOGS"), "KEEP_LOGS" )
+ ] )
+ ),
+ `HSpacing(2.0),
+ `HWeight( 1, `InputField(`id("action_mail_acct"), _("Action Mail Account")))
+ )
+ ),
+ `VStretch(),
+ `Frame(
+ _("Computer Names"),
+ `HBox(
+ `HWeight( 1, `ComboBox(`id("name_format"), _("Computer Name Format"),
+ [`item(`id("NONE"), "NONE" ),
+ `item(`id("HOSTNAME"), "HOSTNAME", true ),
+ `item(`id("FQD"), "FQD" ),
+ `item(`id("USER"), "USER" )
+ ])
+ ),
+ `HSpacing(2.0),
+ `HWeight( 1, `InputField(`id("name"), _("User Defined Name") ))
+ )
+ ),
+ `VStretch()
+ )
+ );
+}
+
+term DispatcherDialogContent () {
+ return `MarginBox( mbox_x, mbox_y,
+ `VBox(
+ `VSpacing(2.0),
+ `Frame (
+ _("Dispatcher Settings"),
+ `VBox (
+ `VSquash(
+ `HBox(
+ // Label for InputField
+ `InputField(`id("dispatcher"), `opt(`hstretch), _("Dispatcher Program")),
+ `HSpacing(2.0),
+ `VBox(
+ `VSpacing(),
+ // Label for PushButton
+ `Bottom(`PushButton(`id("select_disp"), _("Select Fi&le")))
+ )
+ )
+ ),
+ `Left(`ComboBox(`id("disp_qos"), _("Communication"),
+ [`item(`id("lossy"), "lossy", true ),
+ `item(`id("lossless"), "lossless" )
+ ])
+ )
+ )
+ ),
+ `VStretch()
+ )
+ );
+}
+
+term DiskspaceSettingsDialogContent () {
+ return `MarginBox( mbox_x, mbox_y,
+ `VBox(
+ `VStretch(),
+ `Frame(
+ // Frame label - keep it short!
+ _("Value and action for space is starting to run low"),
+ `HBox(
+ // InputField label - space on disk is starting to run low if the entered value is reached
+ `HWeight( 1, `InputField(`id("space_left"), _("&Space left on disk (MB)") )),
+ `HSpacing(2.0),
+ `HWeight( 1, `ComboBox(`id("space_left_action"), `opt(`editable),
+ // ComboBox label - select an action which is performed if space on disk is low
+ _("Action"),
+ [`item(`id("IGNORE"), "IGNORE" ),
+ `item(`id("SYSLOG"), "SYSLOG", true ),
+ `item(`id("SUSPEND"), "SUSPEND" ),
+ `item(`id("SINGLE"), "SINGLE" ),
+ `item(`id("HALT"), "HALT" ),
+ `item(`id("EXEC"), "EXEC" ),
+ `item(`id("EMAIL"), "EMAIL" )
+ ])
+ )
+ )
+ ),
+ `VStretch(),
+ `Frame (
+ // Frame label - keep it short!
+ _("Value and action for space is running low"),
+ `HBox(
+ // InputField label - space on disk is running low if the entered value is reached
+ `HWeight( 1, `InputField(`id("admin_space_left"), _("&Admin space left on disk (MB) ")) ),
+ `HSpacing(2.0),
+ `HWeight( 1, `ComboBox(`id("admin_space_left_action"), `opt(`editable),
+ // ComboBox label - select an action which is performed if space on disk is running low
+ _("Action"),
+ [`item(`id("IGNORE"), "IGNORE" ),
+ `item(`id("SYSLOG"), "SYSLOG", true ),
+ `item(`id("SUSPEND"), "SUSPEND" ),
+ `item(`id("SINGLE"), "SINGLE" ),
+ `item(`id("HALT"), "HALT" ),
+ `item(`id("EXEC"), "EXEC" ),
+ `item(`id("EMAIL"), "EMAIL" )
+ ]) )
+
+ )
+ ),
+ `VStretch(),
+ `Frame(
+ // Frame label - keep it short!
+ _("Action on Error or Disk full"),
+ `VBox(
+ `ComboBox(`id("disk_full_action"), `opt(`editable),
+ // ComboBox label - select an action which is performed if disk is full
+ _("Disk Full Action"),
+ [`item(`id("IGNORE"), "IGNORE" ),
+ `item(`id("SYSLOG"), "SYSLOG", true ),
+ `item(`id("SUSPEND"), "SUSPEND" ),
+ `item(`id("SINGLE"), "SINGLE" ),
+ `item(`id("HALT"), "HALT" ),
+ `item(`id("EXEC"), "EXEC" )
+ ]),
+ `ComboBox(`id("disk_error_action"), `opt(`editable ),
+ // ComboBox label - select an action which is performed on error
+ _("Disk Error Action"),
+ [`item(`id("IGNORE"), "IGNORE" ),
+ `item(`id("SYSLOG"), "SYSLOG", true ),
+ `item(`id("SUSPEND"), "SUSPEND" ),
+ `item(`id("SINGLE"), "SINGLE" ),
+ `item(`id("HALT"), "HALT" ),
+ `item(`id("EXEC"), "EXEC" )
+ ])
+ )
+ ),
+ `VStretch()
+ )
+ );
+}
+
+term RulesDialogContent() {
+
+ return `MarginBox( mbox_x, mbox_y,
+ `VBox(
+ `VSpacing(0.2),
+ `VWeight( 20, `VBox(
+ // label of a combo box with the possibilitiy to enable/disable auditing or lock the rules
+ `Left(`ComboBox( `id("audit_enabled"), `opt(`notify), _("Set Enabled Flag"),
+ [`item(`id("enabled"), _("Auditing enabled"), true ), // -e 1
+ `item(`id("disabled"), _("Auditing disabled") ), // -e 0
+ `item(`id("locked"), _("Rules are locked (until next boot)")) // -e 2
+ ]
+ ) ),
+ `VStretch()
+ ) ),
+ `VSpacing(0.2),
+ `VWeight( 90, `VBox(
+ `Left(`Label(_("Edit the rules for the audit subsystem here:") ) ),
+ `MultiLineEdit(`id("rules"), `opt(`vstretch), "audit.rules" )
+
+ ) ),
+ `VWeight( 10,
+ // label of a push button (please keep it short)
+ `HBox(`PushButton( `id( "test" ), _("Check Syntax") ),
+ `HSpacing(2.0),
+ // label of push button (please keep it short)
+ `PushButton( `id( "restore" ), _("Restore 'audit.rules'") ),
+ `HSpacing(2.0),
+ // label of push button (please keep it short)
+ `PushButton( `id( "reset" ), _("Restore and Reset") ),
+ `HSpacing(2.0),
+ // label of push button
+ `PushButton( `id( "load" ), _("Load ") )
+ )
+ )
+
+ )
+ );
+}
+
+} /* EOF */
+
Added: trunk/audit-laf/src/helps.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/helps.ycp?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/src/helps.ycp (added)
+++ trunk/audit-laf/src/helps.ycp Tue Sep 2 12:34:50 2008
@@ -0,0 +1,119 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * 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, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/audit-laf/helps.ycp
+ * Package: Configuration of LAF auditing
+ * Summary: Help texts of all the dialogs
+ * Authors: Gabriele Mohr
+ *
+ */
+
+{
+
+textdomain "audit-laf";
+
+/**
+ * All helps are here
+ */
+map HELPS = $[
+
+ /* Read dialog help 1/2 */
+ "read" : _("<p><b><big>Initializing Configuration of LAF Auditing</big></b><br>
+Please wait...<br></p>
+") +
+
+ /* Read dialog help 2/2 */
+ _("<p><b><big>Aborting Initialization:</big></b><br>
+Safely abort the configuration utility by pressing <b>Abort</b> now.</p>
+"),
+
+ /* Write dialog help 1/2 */
+ "write" : _("<p><b><big>Saving auditd Configuration and Rules</big></b><br>
+Please wait...<br></p>
+") +
+
+ /* Write dialog help 2/2 */
+_("<p><b><big>Aborting Saving:</big></b><br>
+Abort the save procedure by pressing <b>Abort</b>.
+An additional dialog informs whether it is safe to do so.
+</p>
+"),
+
+ /* logfile_settings dialog help 1/5 */
+ "logfile_settings" : _("<p><b><big>Auditd Logfile Configuration</big></b><br>
+Detailed information about the settings can be obtained from 'man auditd.conf'.</p>") +
+ /* logfile_settings dialog help 1/3 */
+ _("<p><b>Logfile</b>: Enter the full path name to the log file
+(or use <b>Select File</b>.)</p>") +
+ /* logfile_settings dialog help 1/3 */
+ _("<p><b>Format</b>: set <i>RAW</i> to log all data or <i>NOLOG</i>
+to discard all audit information (does not affect data sent to the dispatcher).</p> ") +
+ /* logfile_settings dialog help 1/3 */
+ _("<p><b>Flush</b>: describes how to write the data to disk. If set to
+<i>INCREMANTAL</i> the <b>Frequence</b> parameter tells how often a flush to disk is issued.</p>" ) +
+ /* logfile_settings dialog help 1/3 */
+ _("<p>Configure the maximum log file size and the action to take when this
+value is reached in <b>Size and Action</b> frame. If action is set to
+<b>ROTATE</b> the <b>Number of Logfiles</b> specifies the number of files to keep.</p>") +
+ /* logfile_settings dialog help 1/3 */
+ _("<p><b>Computer Name Format</b> describes how to the computer name is written
+to the log file. If <i>User</i> is set the <b>User Defined Name</b> is used.</p> "),
+
+ /* dispatcher dialog help 1/3 */
+ "dispatcher" : _("<p><b><big>Auditd Dispatcher Configuration</big></b><br>
+Detailed information about the dispatcher settings can be obtained from 'man auditd.conf'.<br></p>") +
+ /* dispatcher dialog help 2/3 */
+ _("<p><b>Dispatcher</b>: The dispatcher program is started by the audit daemon and
+gets all all audit events on stdin.</p>") +
+ /* dispatcher dialog help 3/3 */
+ _("<p><b>Communication</b>: Controls the communication
+between the daemon and the dispatcher program.<p>"),
+
+ /* disksapce dialog help 1/3 */
+ "diskspace_settings" : _("<p><b><big>Auditd Diskspace Configuration</big></b><br>
+Configure diskspace settings on log partition here..<br></p>
+"),
+
+ /* rules dialog help 1/5*/
+ "audit_rules" : _("<p><b><big>Rules for auditctl</big></b><br>
+This dialog offers the possibiltiy to enable or to disable the syscall
+auditing as well as to lock the audit configuration.
+The selected flag from <b>Set Enabled Flag</b> will be added to the rules.</p>" ) +
+ /* rules dialog help 2/5*/
+ _("<p><b>Please note:</b><br>Locking the rules means they cannot be changed until next reboot! </p>" ) +
+ /* rules dialog help 3/5 */
+ _("<p>To enable the auditing whithout adding additional rules will cause the
+ applications which use 'libaudit', e.g. PAM to log to audit.log.</p> ") +
+ /* rules dialog help 4/5 */
+ _("<p>This module also allows you to edit the rules manually. Detailed information
+about all options gives 'man auditctl'.<br>
+<b>Check Syntax</b> sends the rules via <i>auditctl</i> to the audit subsystem and tells
+whether the syntax is correct.</p>") +
+ /* rules dialog help 5/5 */
+ _("<p>Use the <b>Restore and Reset</b> to restore previous rules and reset the changes
+by calling <i>auditctl</i> with it.<br>
+The <b>Load</b> button opens an file selection dialog and you are able to load
+an example rules file.</p>")
+
+];
+
+/* EOF */
+}
Added: trunk/audit-laf/src/wizards.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/audit-laf/src/wizards.ycp?rev=50562&view=auto
==============================================================================
--- trunk/audit-laf/src/wizards.ycp (added)
+++ trunk/audit-laf/src/wizards.ycp Tue Sep 2 12:34:50 2008
@@ -0,0 +1,204 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * 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, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/audit-laf/wizards.ycp
+ * Package: Configuration of LAF Auditing
+ * Summary: Wizards definitions
+ * Authors: Gabriele Mohr
+ *
+ */
+
+{
+
+textdomain "audit-laf";
+
+import "Sequencer";
+import "Wizard";
+import "CWM";
+import "CWMTab";
+
+include "audit-laf/complex.ycp";
+include "audit-laf/dialogs.ycp";
+
+
+/**
+ * Main workflow of the LAF Auditing configuration
+ * @return sequence result
+ */
+any MainSequence() {
+ map > widgets = $[
+ "log" : $[
+ "widget" : `custom,
+ "help" : HELPS["logfile_settings"]:"",
+ "custom_widget" : LogfileSettingsDialogContent(),
+ "handle" : HandleLogfileSettingsDialog,
+ "init" : InitLogfileSettingsDialog,
+ "store" : StoreLogfileSettingsDialog,
+ ],
+ "disp" : $[
+ "widget" : `custom,
+ "help" : HELPS["dispatcher"]:"",
+ "custom_widget" : DispatcherDialogContent(),
+ "handle" : HandleDispatcherDialog,
+ "init" : InitDispatcherDialog,
+ "store" : StoreDispatcherDialog,
+ ],
+ "disk" : $[
+ "widget" : `custom,
+ "help" : HELPS["diskspace_settings"]:"",
+ "custom_widget" : DiskspaceSettingsDialogContent(),
+ "init" : InitDiskspaceSettingsDialog,
+ "store" : StoreDiskspaceSettingsDialog,
+ ],
+ "rules" : $[
+ "widget" : `custom,
+ "help" : HELPS["audit_rules"]:"",
+ "custom_widget" : RulesDialogContent(),
+ "handle" : HandleRulesDialog,
+ "init" : InitRulesDialog,
+ "store" : StoreRulesDialog,
+ ],
+ ];
+
+ map tabs = $[
+ "logfile_settings" : $[
+ "header" : _("&Logfile"),
+ "widget_names" : ["log"],
+ "contents" : LogfileSettingsDialogContent(),
+ ],
+ "dispatcher" : $[
+ "header" : _("&Dispatcher"),
+ "widget_names" : ["disp"],
+ "contents" : DispatcherDialogContent(),
+ ],
+ "diskspace_settings" : $[
+ "header" : _("&Diskspace on Log Partion"),
+ "widget_names" : ["disk"],
+ "contents" : DiskspaceSettingsDialogContent(),
+ ],
+ "audit_rules" : $[
+ "header" : _("&Rules for auditctl"),
+ "widget_names" : ["rules"],
+ "contents" : RulesDialogContent(),
+ ],
+ ];
+
+ string ini_tab = "";
+
+ if ( AuditLaf::RulesLocked() )
+ ini_tab = "audit_rules";
+ else
+ ini_tab = "logfile_settings";
+
+ map wd = $[
+ "tab" : CWMTab::CreateWidget ($[
+ "tab_order" : ["logfile_settings", "dispatcher", "diskspace_settings", "audit_rules"],
+ "tabs" : tabs,
+ "widget_descr" : widgets,
+ "initial_tab" : ini_tab,
+ ])
+ ];
+
+ term contents = `VBox("tab");
+
+ list