Default config.php added

pull/304/merge
iglocska 2014-09-10 11:48:48 +02:00
parent 2521106254
commit b178358f2a
8 changed files with 87 additions and 11 deletions

1
.gitignore vendored
View File

@ -22,6 +22,7 @@
/app/Config/bootstrap.php
/app/Config/database.php
/app/Config/core.php
/app/Config/config.php
/cakephp
/app/webroot/gpg.asc
/app/tmp/logs

View File

@ -84,7 +84,8 @@
*/
Cache::config('default', array('engine' => 'File'));
Configure::write('MISP.baseurl', 'http://localhost:8888');
if (!Configure::read('MISP.baseurl')) {
if (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) {
Configure::write('MISP.baseurl', sprintf('https://%s:%d', $_SERVER['SERVER_ADDR'], $_SERVER['SERVER_PORT']));

View File

@ -0,0 +1,41 @@
<?php
$config = array (
'debug' => 0,
'Security' =>
array (
'level' => 'medium',
'salt' => 'Rooraenietu8Eeyo<Qu2eeNfterd-dd+',
'cipherSeed' => '',
),
'MISP' =>
array (
'baseurl' => '',
'footerpart1' => 'Powered by MISP',
'footerpart2' => '&copy; Belgian Defense CERT & NCIRC',
'org' => 'ORGNAME',
'showorg' => true,
'background_jobs' => true,
'cached_attachments' => false,
'email' => 'email@address.com',
'contact' => 'email@address.com',
'cveurl' => 'http://web.nvd.nist.gov/view/vuln/detail?vulnId=',
'disablerestalert' => false,
'default_event_distribution' => '0',
'default_attribute_distribution' => 'event',
'tagging' => true,
'full_tags_on_event_index' => true,
'footer_logo' => '',
),
'GnuPG' =>
array (
'onlyencrypted' => false,
'email' => '',
'homedir' => '',
'password' => '',
),
'SecureAuth' =>
array (
'amount' => 5,
'expire' => 300,
),
);

View File

@ -751,7 +751,7 @@ class ShadowAttributesController extends AppController {
// prepare the email
$this->Email->from = Configure::read('MISP.email');
$this->Email->to = $reporter['User']['email'];
$this->Email->subject = "[" . Configure::read('MISP.org') . " " . Configure::read('MISP.name') . "] Proposal to event #" . $id;
$this->Email->subject = "[" . Configure::read('MISP.org') . " MISP] Proposal to event #" . $id;
$this->Email->template = 'body';
$this->Email->sendAs = 'text'; // both text or html
$this->set('body', $bodyEncSig);

View File

@ -53,7 +53,7 @@ class NidsExport {
}*/
# proto src_ip src_port direction dst_ip dst_port msg rule_content tag sid rev
$ruleFormatMsg = 'msg: "' . Configure::read('MISP.name') . ' e' . $item['Event']['id'] . ' %s"';
$ruleFormatMsg = 'msg: "MISP e' . $item['Event']['id'] . ' %s"';
$ruleFormatReference = 'reference:url,' . Configure::read('MISP.baseurl') . '/events/view/' . $item['Event']['id'];
$ruleFormat = '%salert %s %s %s %s %s %s (' . $ruleFormatMsg . '; %s %s classtype:' . $this->classtype . '; sid:%d; rev:%d; priority:' . $item['Event']['threat_level_id'] . '; ' . $ruleFormatReference . ';) ';

View File

@ -1160,7 +1160,7 @@ class Event extends AppModel {
$Email = new CakeEmail();
$Email->from(Configure::read('MISP.email'));
$Email->to($user['User']['email']);
$Email->subject("[" . Configure::read('MISP.org') . " " . Configure::read('MISP.name') . "] Event " . $id . " - " . $subject . $event['ThreatLevel']['name'] . " - TLP Amber");
$Email->subject("[" . Configure::read('MISP.org') . " MISP] Event " . $id . " - " . $subject . $event['ThreatLevel']['name'] . " - TLP Amber");
$Email->emailFormat('text'); // both text or html
// send it
$Email->send($bodySigned);
@ -1192,7 +1192,7 @@ class Event extends AppModel {
$Email = new CakeEmail();
$Email->from(Configure::read('MISP.email'));
$Email->to($user['User']['email']);
$Email->subject("[" . Configure::read('MISP.org') . " " . Configure::read('MISP.name') . "] Event " . $id . " - " . $subject . " - " . $event['ThreatLevel']['name'] . " - TLP Amber");
$Email->subject("[" . Configure::read('MISP.org') . " MISP] Event " . $id . " - " . $subject . " - " . $event['ThreatLevel']['name'] . " - TLP Amber");
$Email->emailFormat('text'); // both text or html
// import the key of the user into the keyring
// this is not really necessary, but it enables us to find
@ -1338,7 +1338,7 @@ class Event extends AppModel {
$Email->from(Configure::read('MISP.email'));
$Email->replyTo($user['User']['email']);
$Email->to($reporter['User']['email']);
$Email->subject("[" . Configure::read('MISP.org') . " " . Configure::read('MISP.name') . "] Need info about event " . $id . " - TLP Amber");
$Email->subject("[" . Configure::read('MISP.org') . " MISP] Need info about event " . $id . " - TLP Amber");
//$this->Email->delivery = 'debug'; // do not really send out mails, only display it on the screen
$Email->emailFormat('text'); // both text or html

View File

@ -109,15 +109,15 @@ class Server extends AppModel {
'branch' => 1,
'baseurl' => array(
'level' => 0,
'description' => 'The base url of the application (such as https://www.mymispinstance.com)',
'description' => 'The base url of the application (in the format https://www.mymispinstance.com). Several features depend on this setting being correctly set to function.',
'value' => '',
'errorMessage' => 'The currenty set baseurl does not match the URL through which you have accessed the page. Disregard this if you are accessing the page via an alternate URL (for example via IP address).',
'test' => 'testBaseURL',
'type' => 'string',
),
'name' => array(
'level' => 2,
'description' => 'The name of the application (MISP)',
'level' => 3,
'description' => 'This setting is deprecated and can be safely removed.',
'value' => '',
'errorMessage' => '',
'test' => 'testForEmpty',
@ -317,6 +317,38 @@ class Server extends AppModel {
'test' => 'testBool',
'type' => 'boolean',
),
'welcome_text_top' => array(
'level' => 2,
'description' => 'Used on the login page, before the MISP logo',
'value' => '',
'errorMessage' => '',
'test' => '',
'type' => '',
),
'welcome_text_bottom' => array(
'level' => 2,
'description' => 'Used on the login page, after the MISP logo',
'value' => '',
'errorMessage' => '',
'test' => '',
'type' => '',
),
'welcome_logo' => array(
'level' => 2,
'description' => 'Used on the login page, to the left of the MISP logo, place a .png file in app/webroot/img with the name specified here.',
'value' => '',
'errorMessage' => '',
'test' => '',
'type' => '',
),
'welcome_logo2' => array(
'level' => 2,
'description' => 'Used on the login page, to the right of the MISP logo, place a .png file in app/webroot/img with the name specified here.',
'value' => '',
'errorMessage' => '',
'test' => '',
'type' => '',
),
),
'GnuPG' => array(
'branch' => 1,
@ -812,6 +844,7 @@ class Server extends AppModel {
foreach ($serverSettings as $branchKey => &$branchValue) {
if (isset($branchValue['branch'])) {
foreach ($branchValue as $leafKey => &$leafValue) {
if ($leafValue['level'] == 3 && !(isset($currentSettings[$branchKey][$leafKey]))) continue;
$setting = null;
if (isset($currentSettings[$branchKey][$leafKey])) $setting = $currentSettings[$branchKey][$leafKey];
$leafValue = $this->__evaluateLeaf($leafValue, $leafKey, $setting);
@ -895,6 +928,6 @@ class Server extends AppModel {
public function serverSettingsSaveValue($setting, $value) {
Configure::write($setting, $value);
Configure::dump('settings.php', 'default', array('MISP', 'GnuPG', 'SecureAuth', 'Security', 'debug'));
Configure::dump('config.php', 'default', array('MISP', 'GnuPG', 'SecureAuth', 'Security', 'debug'));
}
}

View File

@ -4,7 +4,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<?php echo $this->Html->charset(); ?>
<title>
<?php echo $title_for_layout, ' - ', Configure::read('MISP.name')?>
<?php echo $title_for_layout, ' - MISP'; ?>
</title>
<?php
echo $this->Html->meta('icon');