Skip to content

Commit

Permalink
FIxes #536 - Seccubus did not install on debian because openssl passp…
Browse files Browse the repository at this point in the history
…hrase was too short (also effected docker container)
  • Loading branch information
MrSeccubus committed Sep 1, 2017
1 parent 1f0c108 commit d7188f8
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 24 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -152,6 +152,7 @@ x-x-2017 - v2.39 - Development release

Enhancements
------------
# #539 - Status tab will become the default instead of the login tab if there is a config issue


Bug Fixes
Expand Down
27 changes: 22 additions & 5 deletions jmvc/seccubus/config_item/list/list.js
Expand Up @@ -17,8 +17,8 @@ steal( 'jquery/controller',
'jquery/view/ejs',
'jquery/controller/view',
'seccubus/models' )
.then( './views/init.ejs',
'./views/config_item.ejs',
.then( './views/init.ejs',
'./views/config_item.ejs',
function($){

/**
Expand All @@ -30,7 +30,15 @@ steal( 'jquery/controller',
$.Controller('Seccubus.ConfigItem.List',
/** @Static */
{
defaults : {}
defaults : {
/*
* @attribute options.onOk
* Function that is called there are no error in the config
*/
onChange : function(ok) {
console.log("Seccubus.ConfigItem.List: config ok? : " + ok);
},
}
},
/** @Prototype */
{
Expand All @@ -40,8 +48,17 @@ $.Controller('Seccubus.ConfigItem.List',
* @return undefined
*/
init : function(){
this.element.html(this.view('init',Seccubus.Models.ConfigItem.findAll()) )
}
this.element.html(this.view('init',Seccubus.Models.ConfigItem.findAll({},this.callback("changed"))) )
},
changed: function(tests) {
var ok = true;
for (var i =0; i < tests.length && ok; i++ ) {
if ( tests[i].result == "Error" ) {
ok = false;
}
}
this.options.onChange(ok);
}
});

});
6 changes: 5 additions & 1 deletion jmvc/seccubus/models/gui_state.js
Expand Up @@ -115,7 +115,11 @@ $.Model('Seccubus.GuiState',
* Determines if the user sees admin level functions in the gui
* actual permissions are still checked in the backend
*/
isAdmin : false
isAdmin : false,
/* @attribute isOk
* True if config test passed ok, false if it didn't.
*/
isOk : false
}

},
Expand Down
32 changes: 15 additions & 17 deletions jmvc/seccubus/seccubus.js
Expand Up @@ -136,21 +136,10 @@ steal(
console.log("admins state changed");
update_tabs_admin();
});

/***********************************************************
* Let's see how we are logged in
**********************************************************/
//bla Seccubus.Models.Session.findOne(
//bla {},
//bla function(s){
//bla console.log("This is our current session");
//bla console.log(s);
//bla gui_state.attr("username",s.username);
//bla gui_state.attr("isAdmin",s.isAdmin);
//bla gui_state.attr("session",s);
//bla }
//bla );

gui_state.bind("isOk", function(ev, isOk){
console.log("config status changed");
update_tabs_user();
});

/***********************************************************
* Hook into findings model to update findings view that
Expand Down Expand Up @@ -221,7 +210,12 @@ steal(
$('#up_to_dates').seccubus_up_to_date_list("init");

// ConfigItem status
$('#config_items').seccubus_config_item_list("init");
//$('#config_items').seccubus_config_item_list("init");
$('#config_items').seccubus_config_item_list({
onChange : function(ok) {
gui_state.attr("isOk",ok);
}
});

// Workspaces
$('.workspaceSelector').each( function() {
Expand Down Expand Up @@ -374,7 +368,11 @@ steal(
loggedIn = "hide";
// Login - tab 0
$('#navTab').seccubus_tabs("show", 0);
$('#navTab').seccubus_tabs("clickOn", 0);
if ( gui_state.attr("isOk") ) {
$('#navTab').seccubus_tabs("clickOn", 0);
} else {
$('#navTab').seccubus_tabs("clickOn", 1);
}
$('#logout').hide();
} else {
// Login - tab 0
Expand Down
2 changes: 1 addition & 1 deletion lib/Seccubus/Controller/AppStatus.pm
Expand Up @@ -170,7 +170,7 @@ sub read {
if ( $valid ) {
push @$json, {name => "Authentication", message => "You are logged in: $message", result => 'OK'};
} else {
push @$json, {name => "Authentication", message => "You are not in: $message", result => 'Error'};
push @$json, {name => "Authentication", message => "You are not in: $message", result => 'Warn'};
}

##### Test SMTP config
Expand Down

0 comments on commit d7188f8

Please sign in to comment.