Author: openvasfelix
Date: Fri Jan 22 11:15:47 2010
New Revision: 60478
URL: http://svn.opensuse.org/viewcvs/yast?rev=60478&view=rev
Log:
Added remaining portion of the OpenVAS Security Scanner
YaST module.
* openvas-security-scanner/agents,
openvas-security-scanner/agents/Makefile.am,
openvas-security-scanner/agents/openvas-security-scanner.scr,
openvas-security-scanneragents/.cvsignore,
openvas-security-scanner/doc,
openvas-security-scanner/doc/autodocs,
openvas-security-scanner/doc/autodocs/Makefile.am,
openvas-security-scanner/doc/autodocs/.cvsignore,
openvas-security-scanner/doc/Makefile.am,
openvas-security-scanner/doc/.cvsignore,
openvas-security-scanner/src,
openvas-security-scanner/src/openvas-security-scanner.desktop,
openvas-security-scanner/src/openvas-security-scanner.ycp,
openvas-security-scanner/src/complex.ycp,
openvas-security-scanner/src/helps.ycp,
openvas-security-scanner/src/OpenvasSecurityScanner.ycp,
openvas-security-scanner/package,
openvas-security-scanner/package/.cvsignore: New. Remaining
portion of the OpenVAS Security Scanner module.
Added:
branches/SuSE-Code-11-Branch/openvas-security-scanner/agents/
branches/SuSE-Code-11-Branch/openvas-security-scanner/agents/.cvsignore
branches/SuSE-Code-11-Branch/openvas-security-scanner/agents/Makefile.am
branches/SuSE-Code-11-Branch/openvas-security-scanner/agents/openvas-security-scanner.scr
branches/SuSE-Code-11-Branch/openvas-security-scanner/doc/
branches/SuSE-Code-11-Branch/openvas-security-scanner/doc/.cvsignore
branches/SuSE-Code-11-Branch/openvas-security-scanner/doc/Makefile.am
branches/SuSE-Code-11-Branch/openvas-security-scanner/doc/autodocs/
branches/SuSE-Code-11-Branch/openvas-security-scanner/doc/autodocs/.cvsignore
branches/SuSE-Code-11-Branch/openvas-security-scanner/doc/autodocs/Makefile.am
branches/SuSE-Code-11-Branch/openvas-security-scanner/package/
branches/SuSE-Code-11-Branch/openvas-security-scanner/package/.cvsignore
branches/SuSE-Code-11-Branch/openvas-security-scanner/src/
branches/SuSE-Code-11-Branch/openvas-security-scanner/src/.cvsignore
branches/SuSE-Code-11-Branch/openvas-security-scanner/src/Makefile.am
branches/SuSE-Code-11-Branch/openvas-security-scanner/src/OpenvasSecurityScanner.ycp
branches/SuSE-Code-11-Branch/openvas-security-scanner/src/complex.ycp
branches/SuSE-Code-11-Branch/openvas-security-scanner/src/dialogs.ycp
branches/SuSE-Code-11-Branch/openvas-security-scanner/src/helps.ycp
branches/SuSE-Code-11-Branch/openvas-security-scanner/src/openvas-security-scanner.desktop
branches/SuSE-Code-11-Branch/openvas-security-scanner/src/openvas-security-scanner.ycp
branches/SuSE-Code-11-Branch/openvas-security-scanner/src/wizards.ycp
branches/SuSE-Code-11-Branch/openvas-security-scanner/testsuite/
branches/SuSE-Code-11-Branch/openvas-security-scanner/testsuite/.cvsignore
branches/SuSE-Code-11-Branch/openvas-security-scanner/testsuite/Makefile.am
branches/SuSE-Code-11-Branch/openvas-security-scanner/testsuite/tests/
branches/SuSE-Code-11-Branch/openvas-security-scanner/testsuite/tests/.cvsignore
Added: branches/SuSE-Code-11-Branch/openvas-security-scanner/agents/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/openvas-security-scanner/agents/.cvsignore?rev=60478&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/openvas-security-scanner/agents/.cvsignore (added)
+++ branches/SuSE-Code-11-Branch/openvas-security-scanner/agents/.cvsignore Fri Jan 22 11:15:47 2010
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Added: branches/SuSE-Code-11-Branch/openvas-security-scanner/agents/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/openvas-security-scanner/agents/Makefile.am?rev=60478&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/openvas-security-scanner/agents/Makefile.am (added)
+++ branches/SuSE-Code-11-Branch/openvas-security-scanner/agents/Makefile.am Fri Jan 22 11:15:47 2010
@@ -0,0 +1,7 @@
+# Makefile.am for openvas-security-scanner/agents
+
+agent_SCRIPTS =
+
+scrconf_DATA = openvas-security-scanner.scr
+
+EXTRA_DIST = $(agent_SCRIPTS) $(scrconf_DATA)
Added: branches/SuSE-Code-11-Branch/openvas-security-scanner/agents/openvas-security-scanner.scr
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/openvas-security-scanner/agents/openvas-security-scanner.scr?rev=60478&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/openvas-security-scanner/agents/openvas-security-scanner.scr (added)
+++ branches/SuSE-Code-11-Branch/openvas-security-scanner/agents/openvas-security-scanner.scr Fri Jan 22 11:15:47 2010
@@ -0,0 +1,24 @@
+/**
+ * File:
+ * openvas_security_scanner.scr
+ * Summary:
+ * SCR Agent for reading/writing /etc/openvas/openvas_security_scanner_config
+ * using the ini-agent
+ * Access:
+ * read/write
+ * Authors:
+ * Felix Wolfsteller
+ * Example:
+ * Read(.openvas.feed)
+ * (["osf"])
+ *
+ * Write(.openvas.feed, "onf")
+ * (true)
+ * $**Id$
+ */
+
+.etc.openvas.openvas_security_scanner_config
+
+`ag_ini(
+ `SysConfigFile( "/etc/openvas/openvas_security_scanner.config")
+)
Added: branches/SuSE-Code-11-Branch/openvas-security-scanner/doc/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/openvas-security-scanner/doc/.cvsignore?rev=60478&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/openvas-security-scanner/doc/.cvsignore (added)
+++ branches/SuSE-Code-11-Branch/openvas-security-scanner/doc/.cvsignore Fri Jan 22 11:15:47 2010
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Added: branches/SuSE-Code-11-Branch/openvas-security-scanner/doc/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/openvas-security-scanner/doc/Makefile.am?rev=60478&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/openvas-security-scanner/doc/Makefile.am (added)
+++ branches/SuSE-Code-11-Branch/openvas-security-scanner/doc/Makefile.am Fri Jan 22 11:15:47 2010
@@ -0,0 +1,10 @@
+# Makefile.am for openvas-security-scanner/doc
+
+SUBDIRS = autodocs
+
+htmldir = $(docdir)
+
+doc_DATA =
+html_DATA =
+
+EXTRA_DIST = $(doc_DATA) $(html_DATA)
Added: branches/SuSE-Code-11-Branch/openvas-security-scanner/doc/autodocs/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/openvas-security-scanner/doc/autodocs/.cvsignore?rev=60478&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/openvas-security-scanner/doc/autodocs/.cvsignore (added)
+++ branches/SuSE-Code-11-Branch/openvas-security-scanner/doc/autodocs/.cvsignore Fri Jan 22 11:15:47 2010
@@ -0,0 +1,3 @@
+Makefile
+Makefile.in
+*.html
Added: branches/SuSE-Code-11-Branch/openvas-security-scanner/doc/autodocs/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/openvas-security-scanner/doc/autodocs/Makefile.am?rev=60478&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/openvas-security-scanner/doc/autodocs/Makefile.am (added)
+++ branches/SuSE-Code-11-Branch/openvas-security-scanner/doc/autodocs/Makefile.am Fri Jan 22 11:15:47 2010
@@ -0,0 +1,3 @@
+# Makefile.am for openvas-security-scanner/doc/autodocs
+
+include $(top_srcdir)/autodocs-ycp.ami
Added: branches/SuSE-Code-11-Branch/openvas-security-scanner/package/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/openvas-security-scanner/package/.cvsignore?rev=60478&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/openvas-security-scanner/package/.cvsignore (added)
+++ branches/SuSE-Code-11-Branch/openvas-security-scanner/package/.cvsignore Fri Jan 22 11:15:47 2010
@@ -0,0 +1,2 @@
+*.spec
+*.bz2
Added: branches/SuSE-Code-11-Branch/openvas-security-scanner/src/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/openvas-security-scanner/src/.cvsignore?rev=60478&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/openvas-security-scanner/src/.cvsignore (added)
+++ branches/SuSE-Code-11-Branch/openvas-security-scanner/src/.cvsignore Fri Jan 22 11:15:47 2010
@@ -0,0 +1,4 @@
+Makefile
+Makefile.in
+*.ybc
+.dep
Added: branches/SuSE-Code-11-Branch/openvas-security-scanner/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/openvas-security-scanner/src/Makefile.am?rev=60478&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/openvas-security-scanner/src/Makefile.am (added)
+++ branches/SuSE-Code-11-Branch/openvas-security-scanner/src/Makefile.am Fri Jan 22 11:15:47 2010
@@ -0,0 +1,29 @@
+# Makefile.am for openvas-security-scanner/src
+
+yncludedir = @yncludedir@/openvas-security-scanner
+
+client_DATA = \
+ openvas-security-scanner.ycp
+
+ynclude_DATA = \
+ helps.ycp \
+ wizards.ycp \
+ dialogs.ycp \
+ complex.ycp
+
+desktop_DATA = \
+ openvas-security-scanner.desktop
+
+module_DATA = \
+ OpenvasSecurityScanner.ycp \
+ OpenvasSecurityScanner2.pm \
+ OpenvasSecurityScanner3.py
+
+# create a symlink for local build, #145327
+openvas-security-scanner:
+ ln -sf . $@
+ycpchook = openvas-security-scanner
+
+EXTRA_DIST = $(client_DATA) $(ynclude_DATA) $(module_DATA) $(desktop_DATA)
+
+include $(top_srcdir)/Makefile.am.common
Added: branches/SuSE-Code-11-Branch/openvas-security-scanner/src/OpenvasSecurityScanner.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/openvas-security-scanner/src/OpenvasSecurityScanner.ycp?rev=60478&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/openvas-security-scanner/src/OpenvasSecurityScanner.ycp (added)
+++ branches/SuSE-Code-11-Branch/openvas-security-scanner/src/OpenvasSecurityScanner.ycp Fri Jan 22 11:15:47 2010
@@ -0,0 +1,545 @@
+/* ------------------------------------------------------------------------------
+ * 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/OpenvasSecurityScanner.ycp
+ * Package: Configuration of openvas-security-scanner
+ * Summary: OpenvasSecurityScanner settings, input and output functions
+ * Authors: Felix Wolfsteller
+ *
+ * $**Id$
+ *
+ * Representation of the configuration of openvas-security-scanner.
+ * Input and output routines.
+ */
+
+{
+
+module "OpenvasSecurityScanner";
+textdomain "openvas-security-scanner";
+
+import "FileUtils";
+import "Popup";
+import "Progress";
+import "Report";
+import "SCR";
+import "Service";
+import "Summary";
+import "Message";
+
+/**
+ * Write only, used during autoinstallation.
+ * Don't run services and SuSEconfig, it's all done at one place.
+ */
+boolean write_only = false;
+
+/**
+ * The users choosen feed. Currently one of "No Feed",
+ * "Greenbone Security Feed" or "OpenVAS NVT Feed".
+ */
+global any feed_choice = "";
+
+/**
+ * Hold the path to where to install the GSF files from.
+ */
+global string gsf_location = "";
+
+/**
+ * Sleeping time beetwing progress steps.
+ */
+integer sl = 20;
+
+
+/**
+ * Returns whether the /usr/sbin/greenbone-nvt-sync and
+ * /etc/openvas/gsf-access-key exist.
+ * @return true if /usr/sbin/greenbone-nvt-sync and /etc/openvas/gsf-access-key
+ * exist.
+ */
+global boolean IsGSFInstalled () {
+ if (FileUtils::Exists ("/usr/sbin/greenbone-nvt-sync") && FileUtils::Exists ("/etc/openvas/gsf-access-key"))
+ return true;
+
+ return false;
+}
+
+/**
+ * Ask if user really wants to abort
+ * @return true on user intended abort.
+ */
+global boolean Abort () {
+ return Popup::ReallyAbort (true);
+}
+
+/**
+ * Checks whether an Abort button has been pressed.
+ * If so, calls function to confirm the abort call.
+ *
+ * @return true if abort confirmed
+ */
+global boolean PollAbort () {
+ if (UI::PollInput () == `abort)
+ return Abort ();
+
+ return false;
+}
+
+/**
+ * Removes contents of /var/cache/openvas .
+ * @return true.
+ */
+boolean CleanCache () {
+ SCR::Execute (.target.bash, "for i in /var/cache/openvas/*; do rm -rf $i; done");
+ return true;
+}
+
+/**
+ * Removes contents of /usr/lib/openvas/plugins .
+ * @return true.
+ */
+boolean CleanNVTDir () {
+ SCR::Execute (.target.bash, "for i in /usr/lib/openvas/plugins/*; do rm -rf $i; done");
+ return true;
+}
+
+
+/**
+ * Read all OpenVAS Security Scanner settings
+ * @return true on success
+ */
+global boolean Read() {
+ /* OpenvasSecurityScanner read dialog caption */
+ string caption = _("Initializing OpenVAS Security Scanner Configuration");
+
+ integer steps = 2;
+
+ Progress::New (caption, " ", steps, [
+ /* Progress stage 1/2 */
+ _("Read current OpenVAS Security Scanner configuration"),
+ /* Progress stage 2/2 */
+ _("Read current openvas-scanner state")
+ ], [
+ /* Progress stage 1/2 */
+ _("Reading current OpenVAS Security Scanner configuration..."),
+ /* Progress stage 2/2 */
+ _("Reading current openvas-scanner state..."),
+ /* Progress finished */
+ Message::Finished ()
+ ],"");
+
+ sleep (sl);
+
+ if (PollAbort ()) return false;
+ Progress::NextStage ();
+ if (false) Report::Error (Message::CannotReadCurrentSettings ());
+ sleep (sl);
+
+ if (PollAbort ()) return false;
+ Progress::NextStep();
+ if (false) Report::Error (_("Cannot read current openvas-scanner state."));
+ sleep (sl);
+
+ if (PollAbort ()) return false;
+ Progress::NextStage ();
+ sleep (sl);
+
+ feed_choice = SCR::Read (.etc.openvas.openvas_security_scanner_config.feed);
+ if (feed_choice == nil)
+ feed_choice = "No Feed";
+
+ return true;
+}
+
+
+/**
+ * Write all OpenVAS Security Scanner settings.
+ * @return true on success
+ */
+global boolean Write() {
+ /* Openvas Security Scanner write dialog caption */
+ string caption = _("Saving OpenVAS Security Scanner Configuration");
+
+ integer steps = 2;
+
+ Progress::New (caption, " ", steps, [
+ /* Progress stage 1/2 */
+ _("Write the OpenVAS Security Scanner settings")
+], [
+ /* Progress step 1/2 */
+ _("Writing the OpenVAS Security Scanner settings..."),
+ Message::Finished ()
+],
+""
+ );
+
+ sleep (sl);
+
+ /* Write settings to conf file */
+ if (PollAbort ()) return false;
+ Progress::NextStage ();
+ /* Error message */
+ if (!SCR::Write (.etc.openvas.openvas_security_scanner_config.feed, feed_choice)
+ || !SCR::Write (.etc.openvas.openvas_security_scanner_config, nil)){
+ Report::Error (_("Cannot write OpenVAS Security Scanner settings."));
+ }
+
+ sleep (sl);
+
+ Progress::NextStage ();
+
+ return true;
+}
+
+
+/**
+ * Disable the openvas service and clean up the cache and plugins directory.
+ * @return true on success
+ */
+global boolean DisableOpenVAS () {
+ string caption = _("Disable the OpenVAS Security Scanner");
+ integer steps = 3;
+
+ Progress::New (caption, " ", steps, [
+ /* Progress stage 1/3 */
+ _("Stopp the OpenVAS Security Scanner service"),
+ /* Progress stage 2/3 */
+ _("Disable the OpenVAS Security Scanner service"),
+ /* Progress stage 3/3 */
+ _("Delete the NVT datastores"),
+ ],[
+ /* Progress stage 1/3 */
+ _("Stopping the OpenVAS Security Scanner service..."),
+ /* Progress stage 2/3 */
+ _("Disabling the OpenVAS Security Scanner service..."),
+ /* Progress stage 3/3 */
+ _("Deleting the NVT datastores..."),
+ Message::Finished ()
+ ], "");
+
+ /* Stop the service (if running) */
+ if (PollAbort ())
+ return false;
+ Progress::NextStage ();
+ Service::Stop ("openvas-scanner");
+ sleep (sl);
+
+ /* Disable the service */
+ if (PollAbort ())
+ return false;
+ Progress::NextStage ();
+ Service::Adjust ("openvas-scanner", "disable");
+ sleep (sl);
+
+ /* Clean NVT Cache and Collection */
+ if (PollAbort ())
+ return false;
+ Progress::NextStage ();
+ CleanCache ();
+ CleanNVTDir ();
+ sleep (sl);
+
+ Progress::NextStage ();
+ sleep (sl);
+
+ return true;
+}
+
+/**
+ * Fetches a NVT Feed.
+ * @return true on success
+ */
+global boolean FetchFeed () {
+ string caption = _("Fetching NVT Feed");
+
+ integer steps = 4;
+
+ Progress::New (caption, " ", steps, [
+ /* Progress stage 1/4 */
+ _("Stop the OpenVAS Security Scanner service"),
+ /* Progress stage 2/4 */
+ _("Delete the NVT datastores"),
+ /* Progress stage 3/4 */
+ _("Fetch the Feed (may take a while)"),
+ /* Progress stage 4/4 */
+ _("Start the OpenVAS Security Scanner service (may take a while)")
+ ], [
+ /* Progress stage 1/4 */
+ _("Stopping the OpenVAS Security Scanner service..."),
+ /* Progress stage 2/4 */
+ _("Deleting the NVT datastores..."),
+ /* Progress stage 3/4 */
+ _("Fetching the Feed (may take a while)..."),
+ /* Progress stage 4/4 */
+ _("Starting the OpenVAS Security Scanner service (may take a while)..."),
+ Message::Finished ()
+ ], "");
+
+ sleep (sl);
+
+ /* Stop openvas service */
+ if (PollAbort())
+ return false;
+ Progress::NextStage ();
+ Service::Stop ("openvas-scanner");
+ sleep (sl);
+
+ /* Clean the NVT Cache and Collection */
+ if (PollAbort ())
+ return false;
+ Progress::NextStage ();
+ CleanCache ();
+ CleanNVTDir ();
+ sleep (sl);
+
+ /* Sync with feed */
+ if (PollAbort ())
+ return false;
+ Progress::NextStage ();
+ if (feed_choice == "Greenbone Security Feed")
+ SCR::Execute (.target.bash, "greenbone-nvt-sync");
+ else
+ SCR::Execute (.target.bash, "openvas-nvt-sync");
+ /** @TODO Once the feed synchronization scripts have been consolidated, it
+ * will be possible to check the return. */
+ sleep (sl);
+
+ /* Start openvas service */
+ if (PollAbort ()) return false;
+ Progress::NextStage ();
+ Service::Adjust ("openvas-scanner", "enable");
+ if (!Service::Start ("openvas-scanner"))
+ Report::Error (_("Could not start OpenVAS Security Scanner service."));
+ /** @TODO decide whether
+ * Report::Error (Message::CannotAdjustService ("openvas-scanner"));
+ * is more accurate */
+ sleep (sl);
+
+ Progress::NextStage ();
+ sleep (sl);
+
+ return true;
+}
+
+/**
+ * Fetches a NVT Feed.
+ * @return true on success
+ */
+global boolean SyncWithFeed () {
+ string caption = _("Synchronization with NVT Feed");
+
+ integer steps = 3;
+
+ Progress::New (caption, " ", steps, [
+ /* Progress stage 1/3 */
+ _("Stop the OpenVAS Security Scanner service"),
+ /* Progress stage 2/3 */
+ _("Fetch the Feed (may take a while)"),
+ /* Progress stage 2/3 */
+ _("Start the OpenVAS Security Scanner service (may take a while)")
+ ], [
+ /* Progress stage 1/3 */
+ _("Stopping the OpenVAS Security Scanner service..."),
+ /* Progress stage 2/3 */
+ _("Fetching the Feed (may take a while)..."),
+ /* Progress stage 3/3 */
+ _("Starting the OpenVAS Security Scanner service (may take a while)..."),
+ Message::Finished ()
+ ], "");
+
+ sleep (sl);
+
+ /* Stop openvas service */
+ if (PollAbort())
+ return false;
+ Progress::NextStage ();
+ Service::Stop ("openvas-scanner");
+ sleep (sl);
+
+ /* Sync with feed */
+ if (PollAbort ())
+ return false;
+ Progress::NextStage ();
+ if (feed_choice == "Greenbone Security Feed")
+ SCR::Execute (.target.bash, "greenbone-nvt-sync");
+ else
+ SCR::Execute (.target.bash, "openvas-nvt-sync");
+ /** @TODO Once the feed synchronization scripts have been consolidated, it
+ * will be possible to check the return. */
+ sleep (sl);
+
+ /* Start openvas service */
+ if (PollAbort ()) return false;
+ Progress::NextStage ();
+ Service::Adjust ("openvas-scanner", "enable");
+ if (!Service::Start ("openvas-scanner"))
+ Report::Error (_("Could not start OpenVAS Security Scanner service."));
+ /** @TODO decide whether
+ * Report::Error (Message::CannotAdjustService ("openvas-scanner"));
+ * is more accurate */
+ sleep (sl);
+
+ Progress::NextStage ();
+ sleep (sl);
+
+ return true;
+}
+
+/**
+ * Deactivate the GSF, remove access key and synchronization script.
+ */
+global boolean DeactivateGSF () {
+ /* Deactivate Greenbone Security Feed dialog caption */
+ string caption = _("Deactivate Greenbone Security Feed Subscription");
+
+ integer steps = 3;
+
+ Progress::New(caption, " ", steps, [
+ /* Progress stage 1/3 */
+ _("Remove Greenbone Security Feed Access Key"),
+ /* Progress stage 2/3 */
+ _("Remove Greenbone Security Feed Synchronization Script"),
+ /* Progress stage 3/3 */
+ _("Delete NVT datastores"),
+], [
+ /* Progress stage 1/3 */
+ _("Removing Greenbone Security Feed Access Key..."),
+ /* Progress stage 2/3 */
+ _("Removing Greenbone Security Feed Synchronization Script..."),
+ /* Progress stage 3/3 */
+ _("Deleting NVT datastores..."),
+ Message::Finished ()
+ ], "");
+
+ sleep (sl);
+
+ /* Removing Access Key */
+ if (PollAbort ()) return false;
+ Progress::NextStage ();
+ SCR::Execute (.target.bash, "rm -rf /etc/openvas/gsf-access-key");
+ sleep (sl);
+
+
+ /* Removing sync script */
+ if (PollAbort ()) return false;
+ Progress::NextStage ();
+ SCR::Execute (.target.bash, "rm -rf /usr/sbin/greenbone-nvt-sync");
+ sleep (sl);
+
+ /* Clean the NVT Cache and Collection */
+ if (PollAbort ()) return false;
+ Progress::NextStage ();
+ CleanCache ();
+ CleanNVTDir ();
+ sleep (sl);
+
+ return true;
+}
+
+/**
+ * Fetches a NVT Feed.
+ * @return true on success
+ */
+global boolean ActivateGSF () {
+ /* Openvas Security Scanner Feed Fetching dialog caption */
+ string caption = _("Fetching NVT Feed");
+
+ integer steps = 5;
+
+ Progress::New(caption, " ", steps, [
+ /* Progress stage 1/5 */
+ _("Copy Greenbone Security Feed Access Key"),
+ /* Progress stage 2/5 */
+ _("Add feed.greenbone.net to list of known hosts"),
+ /* Progress stage 3/5 */
+ _("Import Greenbone Key"),
+ /* Progress stage 4/5 */
+ _("Install greenbone-nvt-sync script"),
+ /* Progress stage 5/5 */
+ _("Test Keys")
+], [
+ /* Progress stage 1/5 */
+ _("Copying Greenbone Security Feed Access Key..."),
+ /* Progress stage 2/5 */
+ _("Adding feed.greenbone.net to list of known hosts"),
+ /* Progress stage 3/5 */
+ _("Importing Greenbone Key..."),
+ /* Progress stage 4/5 */
+ _("Installing greenbone-nvt-sync script..."),
+ /* Progress stage 5/5 */
+ _("Testing Keys..."),
+ Message::Finished ()
+ ], "");
+
+ sleep(sl);
+
+ /* Adding greenbone feed location to list of known hosts */
+ if (PollAbort ()) return false;
+ Progress::NextStage ();
+ SCR::Execute (.target.bash, "echo \"[feed.greenbone.net]:24,[193.108.181.139]:24 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAmVIt4lOPi1lVJfFCtiNjGR4kHj377C6jMY4iaxotYueuGq8l8B1YIMUMLQzaUeaPwOGMZl5mWUT158zaiWK4zOzZarFLey6JrKfrnDZMdCcCneZPBRbMJUxiV1jv4U+/Vp/V1wO6OJ+S9XkodxvN9+vjAhcXspKXcRol30+T9mgilWK+nvSTVEhce+JJYz+gdQFN+1xgkPhjGbXSjHT7zB5fVjWe7TYLGhdqj1U+NTVOcKNn0wMBRGM3T63rKV71KI1hmLdX6+VmVQOCjYpqsFRh0TZadh5cEE5gmPDCnGlXCA9BrilOMSRvsTySs30xN4/Z5RHPWbDS0rwvqBf9Lw==\" >> /root/.ssh/known_hosts");
+ sleep (sl);
+
+
+ /* Copy access key and set permissions */
+ if (PollAbort ()) return false;
+ Progress::NextStage ();
+ y2milestone (" --> cp " + gsf_location + "/gsf-access-key"
+ + " /etc/openvas/gsf-access-key <--");
+ SCR::Execute (.target.bash, "cp " + gsf_location + "/gsf-access-key"
+ + " /etc/openvas/gsf-access-key");
+ SCR::Execute (.target.bash, "chmod 400 /etc/openvas/gsf-access-key");
+ sleep (sl);
+
+ /* Import Greenbone Key via script */
+ if (PollAbort ()) return false;
+ Progress::NextStage ();
+ integer ret = (integer) SCR::Execute (.target.bash,
+ gsf_location
+ + "/import-greenbone-key");
+ if (ret != 0)
+ {
+ Report::Error (_("The greenbone key could not be imported."));
+ }
+ sleep(sl);
+
+ /* Install Greenbone NVT Sync script */
+ if (PollAbort ()) return false;
+ Progress::NextStage ();
+ SCR::Execute (.target.bash, "cp " + gsf_location + "/greenbone-nvt-sync /usr/sbin");
+ sleep (sl);
+
+ /* Do a self test */
+ if (PollAbort ()) return false;
+ Progress::NextStage ();
+ ret = (integer) SCR::Execute (.target.bash,
+ "greenbone-nvt-sync --selftest");
+ if (ret != 0)
+ {
+ Report::Error (_("The synchronization test failed."));
+ }
+ sleep (sl);
+
+ Progress::NextStage ();
+ sleep (sl);
+
+ return true;
+}
+
+/* EOF */
+}
Added: branches/SuSE-Code-11-Branch/openvas-security-scanner/src/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/openvas-security-scanner/src/complex.ycp?rev=60478&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/openvas-security-scanner/src/complex.ycp (added)
+++ branches/SuSE-Code-11-Branch/openvas-security-scanner/src/complex.ycp Fri Jan 22 11:15:47 2010
@@ -0,0 +1,101 @@
+/* ------------------------------------------------------------------------------
+ * 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/openvas-security-scanner/complex.ycp
+ * Package: Configuration of openvas-security-scanner
+ * Summary: Dialogs definitions
+ * Authors: Felix Wolfsteller
+ *
+ * $**Id$
+ */
+
+{
+
+textdomain "openvas-security-scanner";
+
+import "Label";
+import "Popup";
+import "Wizard";
+import "Wizard_hw";
+import "Confirm";
+import "OpenvasSecurityScanner";
+
+
+include "openvas-security-scanner/helps.ycp";
+
+/**
+ * Read settings dialog
+ * @return `abort if aborted and `next otherwise
+ */
+symbol ReadDialog() {
+ Wizard::RestoreHelp(HELPS["read"]:"");
+ //OpenvasSecurityScanner::SetAbortFunction(PollAbort);
+ if (!Confirm::MustBeRoot()) return `abort;
+ boolean ret = OpenvasSecurityScanner::Read();
+ return ret ? `next : `abort;
+}
+
+/**
+ * Write settings dialog
+ * @return `abort if aborted and `next otherwise
+ */
+symbol WriteDialog() {
+ Wizard::RestoreHelp(HELPS["write"]:"");
+ //OpenvasSecurityScanner::SetAbortFunction(PollAbort);
+ boolean ret = OpenvasSecurityScanner::Write();
+ return ret ? `next : `abort;
+}
+
+
+/**
+ * Feed fetching "dialog"
+ * @return `abort if aborted and `next otherwise
+ */
+symbol FetchFeedDialog() {
+ Wizard::RestoreHelp(HELPS["fetchfeed"]:"");
+ boolean ret = OpenvasSecurityScanner::FetchFeed();
+ return ret ? `next : `abort;
+}
+
+/**
+ * Feed Synchronization "dialog"
+ * @return `abort if aborted and `next otherwise
+ */
+symbol SyncDialog () {
+ Wizard::RestoreHelp(HELPS["fetchfeed"]:"");
+ boolean ret = OpenvasSecurityScanner::SyncWithFeed();
+ return ret ? `next : `abort;
+
+}
+
+/**
+ * Greenbone Security Feed Activation "dialog"
+ * @return `abort if aborted and `next otherwise
+ */
+symbol ActivateGSFDialog () {
+ Wizard::RestoreHelp(HELPS["activategsf"]:"");
+ boolean ret = OpenvasSecurityScanner::ActivateGSF();
+ return ret ? `next : `abort;
+}
+
+/* EOF */
+}
+
Added: branches/SuSE-Code-11-Branch/openvas-security-scanner/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/openvas-security-scanner/src/dialogs.ycp?rev=60478&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/openvas-security-scanner/src/dialogs.ycp (added)
+++ branches/SuSE-Code-11-Branch/openvas-security-scanner/src/dialogs.ycp Fri Jan 22 11:15:47 2010
@@ -0,0 +1,232 @@
+/* ------------------------------------------------------------------------------
+ * 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/openvas-security-scanner/dialogs.ycp
+ * Package: Configuration of openvas-security-scanner
+ * Summary: Dialogs definitions
+ * Authors: Felix Wolfsteller
+ *
+ * $**Id$
+ */
+
+{
+
+textdomain "openvas-security-scanner";
+
+import "Label";
+import "Wizard";
+import "OpenvasSecurityScanner";
+
+include "openvas-security-scanner/helps.ycp";
+
+/**
+ * OpenVAS Scan-Server Configuration Dialog
+ *
+ * @return any dialog result
+ */
+any ScannerConfigurationDialog () {
+ string caption = _("OpenVAS Security Scanner Configuration");
+
+ boolean no_feed_selected = (OpenvasSecurityScanner::feed_choice == nil ||
+ OpenvasSecurityScanner::feed_choice == "No Feed" ||
+ OpenvasSecurityScanner::feed_choice == "");
+
+ term radio_group = `VBox ();
+ radio_group = add (radio_group, `Left(
+ `RadioButton(`id(`no_feed), _("&Disable OpenVAS Security Scanner"), no_feed_selected) ));
+
+ radio_group = add (radio_group, `Left(
+ `RadioButton(`id(`onf), _("Enable and use &OpenVAS NVT Feed"), (OpenvasSecurityScanner::feed_choice == "OpenVAS NVT Feed")) ));
+
+ // Disable the Greenbone Security Feed option if the GSF scripts are not installed / activated
+ if (OpenvasSecurityScanner::IsGSFInstalled ())
+ {
+ radio_group = add (radio_group, `Left(`RadioButton(`id(`gsf), _("Enable and use &Greenbone Security Feed"), (OpenvasSecurityScanner::feed_choice == "Greenbone Security Feed")) ));
+ }
+ else
+ {
+ radio_group = add (radio_group, `Left(`RadioButton(`id(`gsf), `opt(`disabled), _("Enable and use &Greenbone Security Feed"), false) ));
+ }
+
+ term radio_box = `RadioButtonGroup (`id(`feed), `HVSquash(radio_group));
+
+ term gsf_box = `VBox ();
+ if (OpenvasSecurityScanner::IsGSFInstalled ())
+ {
+ gsf_box = add (gsf_box, `PushButton(`id(`activate_gsf), `opt(`notify, `disabled), _("&Activate Greenbone Security Feed Subscription")));
+ gsf_box = add (gsf_box, `PushButton(`id(`deactivate_gsf), `opt(`notify), _("D&eactivate Greenbone Security Feed Subscription")));
+ }
+ else
+ {
+ gsf_box = add (gsf_box, `PushButton(`id(`activate_gsf), `opt(`notify), _("&Activate Greenbone Security Feed Subscription")));
+ gsf_box = add (gsf_box, `PushButton(`id(`deactivate_gsf), `opt(`notify, `disabled), _("D&eactivate Greenbone Security Feed Subscription")));
+ }
+
+ // Disable the "Sync Now" button if no feed is selected / the OpenVAS service is disabled.
+ term sync_now_button = (no_feed_selected) ? `PushButton(`id(`feedsync_now), `opt(`disabled), _("&Synchronize with Feed now"))
+ : `PushButton(`id(`feedsync_now), `opt(`notify), _("&Synchronize with Feed now"));
+
+ integer w = 38;
+ term contents = `VBox (`Frame ("Security Scanner Service", `MinSize (w, 0, radio_box)), `VSpacing (1),
+ `Frame ("Professional Feed Subscriptions", `MinSize (w, 0, gsf_box)), `VSpacing (1),
+ `Frame ("Manual Feed Management", `MinSize (w, 0, `VBox (sync_now_button))));
+
+ Wizard::SetContentsButtons (caption, contents,
+ HELPS["configuration"]:"",
+ Label::BackButton (), Label::FinishButton ());
+ Wizard::DisableBackButton();
+
+ any ret = nil;
+ while (true) {
+ ret = UI::UserInput ();
+
+ /* Abort? */
+ if (ret == `abort)
+ {
+ if (OpenvasSecurityScanner::Abort ()) break;
+ else continue;
+ }
+ /* Next */
+ else if (ret == `next)
+ {
+ ret = UI::QueryWidget (`id(`feed), `CurrentButton);
+ string choice = "";
+ if (ret == `no_feed)
+ choice = "No Feed";
+ else if (ret == `onf)
+ choice = "OpenVAS NVT Feed";
+ else if (ret == `gsf)
+ choice = "Greenbone Security Feed";
+
+ /* Check whether the feed-choice changed, do nothing if so */
+ if (OpenvasSecurityScanner::feed_choice == choice)
+ ret = `write;
+ else
+ {
+ OpenvasSecurityScanner::feed_choice = choice;
+ if (choice == "No Feed")
+ {
+ ret = `no_feed;
+ }
+ else
+ {
+ ret = `fetch_new;
+ }
+ }
+ break;
+
+ }
+ /* Do a feed sync */
+ else if (ret == `feedsync_now)
+ {
+ break;
+ }
+ /* Activate GSF */
+ else if (ret == `activate_gsf)
+ {
+ break;
+ }
+ /* Deactivate GSF */
+ else if (ret == `deactivate_gsf)
+ {
+ OpenvasSecurityScanner::feed_choice = "No Feed";
+ break;
+ }
+ /* Unknown */
+ else
+ {
+ y2error("unexpected retcode: %1", ret);
+ continue;
+ }
+ }
+
+ Wizard::RestoreBackButton ();
+
+ return ret;
+}
+
+/**
+ * Dialog to enter the location of the Greenbone Security Feed (key) files and scripts
+ *
+ * @return any dialog result
+ */
+any EnterGSFLocationDialog () {
+ string caption = _("Greenbone Security Feed installation");
+
+
+ term contents = `VBox (`InputField(`id(`gsf_location), _("Path to directory containing the Greenbone Security Feed Files"), ""));
+
+ Wizard::SetContentsButtons (caption, contents,
+ HELPS["activategsf"]:"",
+ Label::BackButton(), Label::NextButton());
+ Wizard::DisableBackButton ();
+
+ any ret = nil;
+ while (true) {
+ ret = UI::UserInput ();
+ if (ret == `abort)
+ {
+ break;
+ }
+ else if (ret == `next)
+ {
+ /* Assuming location is correct */
+ any text = UI::QueryWidget(`id(`gsf_location), `Value);
+ OpenvasSecurityScanner::gsf_location = (string) text;
+ break;
+ }
+ else
+ {
+ y2error ("unexpected retcode: %1", ret);
+ continue;
+ }
+ }
+
+ Wizard::RestoreBackButton ();
+ return ret;
+}
+
+/**
+ * Dialog showing progress of disabling the OpenVAS Security Scanner Service.
+ *
+ * @return any dialog result
+ */
+any DisableOpenVASDialog () {
+ Wizard::RestoreHelp (HELPS["disableopenvas"]:"");
+ boolean ret = OpenvasSecurityScanner::DisableOpenVAS ();
+ return ret ? `next : `abort;
+}
+
+/**
+ * Dialog showing progress of deactivating the Greenbone Security Feed.
+ *
+ * @return any dialog result
+ */
+any DeactivateGSFDialog () {
+ Wizard::RestoreHelp (HELPS["deactivategsf"]:""); /** TODO help */
+ boolean ret = OpenvasSecurityScanner::DeactivateGSF ();
+ return ret ? `next : `abort;
+}
+
+
+/* EOF */
+}
+
Added: branches/SuSE-Code-11-Branch/openvas-security-scanner/src/helps.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/openvas-security-scanner/src/helps.ycp?rev=60478&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/openvas-security-scanner/src/helps.ycp (added)
+++ branches/SuSE-Code-11-Branch/openvas-security-scanner/src/helps.ycp Fri Jan 22 11:15:47 2010
@@ -0,0 +1,131 @@
+/* ------------------------------------------------------------------------------
+ * 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/openvas-security-scanner/helps.ycp
+ * Package: Configuration of openvas-security-scanner
+ * Summary: Help texts of all the dialogs
+ * Authors: Felix Wolfsteller
+ *
+ * $**Id$
+ */
+
+{
+
+textdomain "openvas-security-scanner";
+
+/**
+ * All helps are here
+ */
+map HELPS = $[
+ /* Help for main dialog */
+ "configuration" : "<p><b><big>"
+ + _("OpenVAS Security Scanner Configuration")
+ + "</big></b>"
+ // Disable OpenVAS Security Scanner
+ + "<p><b>" + _("Disable OpenVAS Security Scanner") + "</b>: "
+ + _("Select \"Disable OpenVAS Security Scanner\" to switch off the OpenVAS Security Scanner Service. ")
+ + _("The datastores for Network Vulnerabilities (NVTs) will be deleted. This might take some time.")
+ // Enable and use OpenVAS NVT Feed
+ + "</p><p><b>" + _("Enable and use OpenVAS NVT Feed") + "</b>: "
+ + _("Select \"Enable and use OpenVAS NVT Feed\" to switch on the OpenVAS Security Scanner with the OpenVAS NVT Feed. ")
+ + _("The free-of-charge OpenVAS NVT Feed delivers the latest Network Vulnerability Tests (NVTs) with volunteer-based Quality Assurance. The NVT synchronisation uses RSYNC protocol. Please visit <tt>http://www.openvas.org/</tt> for more information.")
+ + _("Previous NVT datastores will be deleted before the initial synchronization is executed. This might take some time. ")
+ // Enable and use Greenbone Security Feed
+ + "</p><p><b>" + _("Enable and use Greenbone Security Feed") + "</b>: "
+ + _("Select \"Enable and use Greenbone Security Feed\" to switch on the OpenVAS Security Scanner with the Greenbone Security Feed.<br>")
+ + _("Note that this option is only available if you activated obtained and activated an access key for the Greenbone Security Feed. ")
+ + _("The subscription-based Greenbone Security Feed assures Network Vulnerability Tests (NVTs) of consistent quality, high availability and professional support. ")
+ + _("The NVT synchronisation uses SSH-secured RSYNC protocol. ")
+ + _("Previous NVT datastores will be deleted. This might take some time.")
+ // Activate Greenbone Security Feed Subscription
+ + "</p><p><b>" + _("Activate Greenbone Security Feed Subscription") + "</b>: "
+ + _("To obtain a access key for the Greenbone Security Feed, please visit <tt>http://greenbone.net/order/</tt>. ")
+ + _("Click on \"Activate Greenbone Security Feed\" and enter the path to the obtained access key files. ")
+ + _("The access key and synchronization script will then be installed and you can choose the <b>\"Use Greenbone Security Feed\"</b> option to use the OpenVAS Security Scanner with this feed.")
+ // Deactivate Greenbone Security Feed Subscription
+ + "</p><p><b>" + _("Deactivate Greenbone Security Feed Subscription") + "</b>: "
+ + _("This option is only available if you have previously activated your Greenbone Security Feed Subscription. ")
+ + _("If you select this option, previous NVT datastores, NVT selections and other feed related files will be deleted. This might take some time.")
+ // Synchronize with Feed now
+ + "</p><p><b>" + _("Synchronize with Feed now") + "</b>: "
+ + _("Will immediately start a synchronize with the selected feed. Note that this option is not available if you just changed the feed. ")
+ // Next
+ + "</p><p><b>" + _("Next") + "</b>: "
+ + _("Click on \"Next\" to synchronize with a newly chosen feed.")
+ + "</p>",
+
+ /* Help for the Activate Greenbone Security Feed dialog */
+ "activategsf" : "<p><b><big>" + _("Activate Greenbone Security Feed") + "</big></b>"
+ + "<p>" + _("If you already have obtained an access key, provide the path to these files in the text entry field.")
+ + "</p><p>"
+ + _("If you do not have an access key to the Greenbone Security Feed, please visit <tt>http://greenbone.net/order/</tt> to obtain one. ")
+ + _("Enter the path to the access key files. ")
+ + _("The access key and synchronization script will then be installed and you can choose the <b>\"Use Greenbone Security Feed\"</b> option.")
+ + "</p>",
+
+ /* Help for the Deactivate Greenbone Security Feed dialog */
+ "deactivategsf" : "<p><b><big>" + _("Deactivate Greenbone Security Feed") + "</big></b>"
+ + "<p>" + _("The access key, the Feed synchronization script and the NVT datastores will be deleted.")
+ + "</p></p>",
+
+ /* Read dialog help 1/2 */
+ "read" : _("<p><b><big>Initializing openvas-security-scanner Configuration</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 openvas-security-scanner Configuration</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>
+"),
+
+ "disableopenvas" : "<p><b><big>"
+ + _("Disabling the OpenVAS Security Scanner Service")
+ + "</big></b><br>"
+ + "<p>"
+ + _("The service will be stopped and not start automatically after a reboot. ")
+ + _("The NVT datastores will be deleted, which might take some time. Click abort to abort this action.")
+ + "</p></p>",
+
+ "fetchfeed" : "<p><b><big>"
+ + _("Fetching a NVT Feed")
+ + "</big></b><br>"
+ + "<p>"
+ + _("Before fetching the chosen feed, ")
+ + _("previous NVT datastores will be deleted, which might take some time. ")
+ + _("Note that in order to synchronize with a feed, the scanner service has to be stopped. It will be restarted once the synchronization is finished. ")
+ + _("Click <b>abort</b> to abort this action.")
+ + "</p></p>"
+];
+
+/* EOF */
+}
Added: branches/SuSE-Code-11-Branch/openvas-security-scanner/src/openvas-security-scanner.desktop
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/openvas-security-scanner/src/openvas-security-scanner.desktop?rev=60478&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/openvas-security-scanner/src/openvas-security-scanner.desktop (added)
+++ branches/SuSE-Code-11-Branch/openvas-security-scanner/src/openvas-security-scanner.desktop Fri Jan 22 11:15:47 2010
@@ -0,0 +1,25 @@
+[Desktop Entry]
+Type=Application
+Categories=Settings;System;Qt;X-SuSE-YaST;X-SuSE-YaST-Security;
+
+X-KDE-ModuleType=Library
+X-KDE-RootOnly=true
+X-KDE-HasReadOnlyMode=true
+X-KDE-Library=yast2
+X-SuSE-YaST-Call=openvas-security-scanner
+
+X-SuSE-YaST-Group=Security
+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=openvas-security-scanner
+
+Icon=yast-openvas
+Exec=/sbin/yast2 openvas-security-scanner
+
+Name=OpenVAS Security Scanner
+GenericName=Configure the OpenVAS Security Scanner
+X-KDE-SubstituteUID=true
+StartupNotify=true
Added: branches/SuSE-Code-11-Branch/openvas-security-scanner/src/openvas-security-scanner.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/openvas-security-scanner/src/openvas-security-scanner.ycp?rev=60478&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/openvas-security-scanner/src/openvas-security-scanner.ycp (added)
+++ branches/SuSE-Code-11-Branch/openvas-security-scanner/src/openvas-security-scanner.ycp Fri Jan 22 11:15:47 2010
@@ -0,0 +1,76 @@
+/* ------------------------------------------------------------------------------
+ * 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/openvas-security-scanner.ycp
+ * Package: Configuration of openvas-security-scanner
+ * Summary: Main file
+ * Authors: Felix Wolfsteller
+ *
+ * $**Id$
+ *
+ * Main file for openvas-security-scanner configuration. Uses all other files.
+ */
+
+{
+
+/***
+ * <h3>Configuration of openvas-security-scanner</h3>
+ */
+
+textdomain "openvas-security-scanner";
+
+/* The main () */
+y2milestone ("----------------------------------------");
+y2milestone ("OpenVAS Security Scanner module started");
+
+import "Progress";
+import "Report";
+import "Summary";
+
+import "CommandLine";
+
+include "openvas-security-scanner/wizards.ycp";
+
+map cmdline_description = $[
+ "id" : "openvas-security-scanner",
+ "help" : _("Configuration of OpenVAS Security Scanner"),
+ "guihandler" : OpenvasSecurityScannerSequence,
+ "initialize" : OpenvasSecurityScanner::Read,
+ "finish" : OpenvasSecurityScanner::Write,
+ "actions" : $[],
+ "options" : $[],
+ "mappings" : $[]
+];
+
+/* Main ui function */
+any ret = nil;
+
+ret = CommandLine::Run (cmdline_description);
+y2debug ("ret=%1", ret);
+
+/* Finish */
+y2milestone ("OpenVAS Security Scanner module finished");
+y2milestone ("----------------------------------------");
+
+return ret;
+
+/* EOF */
+}
Added: branches/SuSE-Code-11-Branch/openvas-security-scanner/src/wizards.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/openvas-security-scanner/src/wizards.ycp?rev=60478&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/openvas-security-scanner/src/wizards.ycp (added)
+++ branches/SuSE-Code-11-Branch/openvas-security-scanner/src/wizards.ycp Fri Jan 22 11:15:47 2010
@@ -0,0 +1,153 @@
+/* ------------------------------------------------------------------------------
+ * 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/openvas-security-scanner/wizards.ycp
+ * Package: Configuration of openvas-security-scanner
+ * Summary: Wizards definitions
+ * Authors: Felix Wolfsteller
+ *
+ * $**Id$
+ */
+
+{
+
+textdomain "openvas-security-scanner";
+
+import "Sequencer";
+import "Wizard";
+
+include "openvas-security-scanner/complex.ycp";
+include "openvas-security-scanner/dialogs.ycp";
+
+
+/**
+ * Main dialog workflow of the openvas-security-scanner configuration.
+ *
+ * @return Sequence result.
+ */
+any MainSequence () {
+ map aliases = $[
+ "conf" : [ ``( ScannerConfigurationDialog () ), true],
+ "feed_sync" : [ ``( SyncDialog () ), true],
+ "enter_gsf" : [ ``( EnterGSFLocationDialog () ), true],
+ "activate_gsf" : [ ``( ActivateGSFDialog () ), true],
+ "deactivate_gsf" : [ ``( DeactivateGSFDialog () ), true]
+ ];
+
+ map sequence = $[
+ "ws_start" : "conf",
+ "conf" : $[
+ `abort : `abort,
+ `next : `next,
+ `feedsync_now : "feed_sync",
+ `activate_gsf : "enter_gsf",
+ `deactivate_gsf : "deactivate_gsf",
+ `no_feed : `no_feed,
+ `fetch_new : `fetch_new,
+ `write : `write
+ ],
+ "feed_sync" : $[
+ `abort : `abort,
+ `next : "conf"
+ ],
+ "enter_gsf" : $[
+ `abort : "conf",
+ `next : "activate_gsf"
+ ],
+ "activate_gsf" : $[
+ `abort : "conf",
+ `next : "conf"
+ ],
+ "deactivate_gsf" : $[
+ `abort : "conf",
+ `next : "conf"
+ ]
+ ];
+
+ any ret = Sequencer::Run (aliases, sequence);
+
+ return ret;
+}
+
+/**
+ * Workflow of the whole module
+ * @return sequence result
+ */
+any OpenvasSecurityScannerSequence () {
+ map aliases = $[
+ "read" : [ ``( ReadDialog () ), true ],
+ "main" : ``( MainSequence () ),
+ "feed_fetch" : ``( FetchFeedDialog () ),
+ "enter_gsf" : ``( EnterGSFLocationDialog () ),
+ "fetch_new" : ``( FetchFeedDialog () ),
+ "no_feed" : ``( DisableOpenVASDialog () ),
+ "write" : [ ``( WriteDialog () ), true ]
+ ];
+
+ map sequence = $[
+ "ws_start" : "read",
+ "read" : $[
+ `abort : `abort,
+ `next : "main"
+ ],
+ "main" : $[
+ `abort : `abort,
+ `feedsync_now : "feed_fetch",
+ `activate_gsf : "enter_gsf",
+ `fetch_new : "fetch_new",
+ `next : "write",
+ `no_feed : "no_feed",
+ `write : "write"
+ ],
+ "enter_gsf" : $[
+ `abort : "main",
+ `next : "main"
+ ],
+ "feed_fetch" : $[
+ `abort : "main",
+ `next : "main"
+ ],
+ "fetch_new" : $[
+ `abort : "main",
+ `next : "write"
+ ],
+ "no_feed" : $[
+ `abort : "main",
+ `next : "write"
+ ],
+ "write" : $[
+ `abort : `abort,
+ `next : `next
+ ]
+ ];
+
+ Wizard::CreateDialog ();
+
+ any ret = Sequencer::Run (aliases, sequence);
+
+ UI::CloseDialog ();
+ return ret;
+}
+
+
+/* EOF */
+}
+
Added: branches/SuSE-Code-11-Branch/openvas-security-scanner/testsuite/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/openvas-security-scanner/testsuite/.cvsignore?rev=60478&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/openvas-security-scanner/testsuite/.cvsignore (added)
+++ branches/SuSE-Code-11-Branch/openvas-security-scanner/testsuite/.cvsignore Fri Jan 22 11:15:47 2010
@@ -0,0 +1,11 @@
+Makefile
+Makefile.in
+site.exp
+*.sum
+*.log
+tmp.out*
+tmp.err*
+tmp.log*
+config
+run
+*.test
Added: branches/SuSE-Code-11-Branch/openvas-security-scanner/testsuite/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/openvas-security-scanner/testsuite/Makefile.am?rev=60478&view=auto
==============================================================================
--- branches/SuSE-Code-11-Branch/openvas-security-scanner/testsuite/Makefile.am (added)
+++ branches/SuSE-Code-11-Branch/openvas-security-scanner/testsuite/Makefile.am Fri Jan 22 11:15:47 2010
@@ -0,0 +1,21 @@
+#
+# Makefile.am for .../testsuite
+#
+# Do not edit this file (Makefile.am) as it will be overwritten!
+#
+
+AUTOMAKE_OPTIONS = dejagnu
+EXTRA_DIST = $(wildcard tests/*.out) $(wildcard tests/*.err) $(wildcard tests/*.ycp) $(wildcard tests/*.yh)
+
+testsuite_prepare = @ydatadir@/testsuite/Makefile.testsuite
+
+all-local: $(testsuite_prepare)
+ make -f $(testsuite_prepare) RPMNAME=$(RPMNAME) srcdir=$(srcdir)
+
+clean-local: $(testsuite_prepare)
+ make -f $(testsuite_prepare) RPMNAME=$(RPMNAME) srcdir=$(srcdir) clean
+
+check-local: $(testsuite_prepare)
+ make -f $(testsuite_prepare) RPMNAME=$(RPMNAME) srcdir=$(srcdir) check
+
+# EOF
Added: branches/SuSE-Code-11-Branch/openvas-security-scanner/testsuite/tests/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-Branch/openvas-security-scanner/testsuite/tests/.cvsignore?rev=60478&view=auto
==============================================================================
(empty)
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org