mirror of https://github.com/MISP/MISP
Merge branch '2.4' into develop
commit
c150dbfe6e
1128
INSTALL/INSTALL.sh
1128
INSTALL/INSTALL.sh
File diff suppressed because it is too large
Load Diff
|
@ -1,5 +1,5 @@
|
|||
; Generated by RHash v1.3.9 on 2021-03-25 at 12:56.17
|
||||
; Generated by RHash v1.3.9 on 2021-04-07 at 14:14.40
|
||||
; Written by Kravchenko Aleksey (Akademgorodok) - http://rhash.sf.net/
|
||||
;
|
||||
; 137691 12:56.17 2021-03-25 INSTALL.sh
|
||||
INSTALL.sh 5694A8F77384677CA3DC84FB5A5F3C06D6FFF03F 5F3A9B04BEEE449E96F4A698F3FA497390E46E2AD1DBDDED37F54E29FED76221 ABCB35B681F9A5E3568A055465976EC0996C0CC2FD8A39384E05D90413D8300B7356AAE23A540912D7D9907BECCDCD9F 54712D3100DAF92EA6201D86941222F6877B772533D048C8F758332D9B45418B64AA767A0D78C8A39E491BE114F139FFEF5A2E0436EA8503AA593556E56C0992
|
||||
; 161860 14:14.40 2021-04-07 INSTALL.sh
|
||||
INSTALL.sh 799BE3C88392FFCD09F5BDD49BAB5FB83C0B8A5E 759BB387FE1C11FB8D95326342C7E71B9EEF1549EEA18977E497E5D1B7B6B528 D5EBD0EE0E7E2A4AE6F68063D9A2C581EEF340816C383E00534143AE8787F24F5CF3EF20029DFA8F05D6E4A4B8BF2DE8 3C20996CB15AFC65A8B2A743AF5244FDAC1D1652E338A20B91AF4F76B0B885F4E4C17096838F26BCC3A09E3BEF24F0C2D5B4DB5C19B692573EB1AA0013907689
|
||||
|
|
|
@ -1 +1 @@
|
|||
5694a8f77384677ca3dc84fb5a5f3c06d6fff03f INSTALL.sh
|
||||
799be3c88392ffcd09f5bdd49bab5fb83c0b8a5e INSTALL.sh
|
||||
|
|
|
@ -1 +1 @@
|
|||
5f3a9b04beee449e96f4a698f3fa497390e46e2ad1dbdded37f54e29fed76221 INSTALL.sh
|
||||
759bb387fe1c11fb8d95326342c7e71b9eef1549eea18977e497e5d1b7b6b528 INSTALL.sh
|
||||
|
|
|
@ -1 +1 @@
|
|||
abcb35b681f9a5e3568a055465976ec0996c0cc2fd8a39384e05d90413d8300b7356aae23a540912d7d9907beccdcd9f INSTALL.sh
|
||||
d5ebd0ee0e7e2a4ae6f68063d9a2c581eef340816c383e00534143ae8787f24f5cf3ef20029dfa8f05d6e4a4b8bf2de8 INSTALL.sh
|
||||
|
|
|
@ -1 +1 @@
|
|||
54712d3100daf92ea6201d86941222f6877b772533d048c8f758332d9b45418b64aa767a0d78c8a39e491be114f139ffef5a2e0436ea8503aa593556e56c0992 INSTALL.sh
|
||||
3c20996cb15afc65a8b2a743af5244fdac1d1652e338a20b91af4f76b0b885f4e4c17096838f26bcc3a09e3bef24f0c2d5b4db5c19b692573eb1aa0013907689 INSTALL.sh
|
||||
|
|
|
@ -16,9 +16,12 @@
|
|||
# 0/ Quick MISP Instance on Debian Based Linux - Status |
|
||||
#-------------------------------------------------------|
|
||||
#
|
||||
# 20210401: Ubuntu 21.04 tested and working. -- sCl
|
||||
# 20210401: Ubuntu 20.04.2 tested and working. -- sCl
|
||||
# 20210401: Ubuntu 18.04.5 tested and working. -- sCl
|
||||
# 20210406: CentOS 7.9 tested and working. -- sCl
|
||||
# 20210406: CentOS 8 tested and working. -- sCl
|
||||
# 20210406: CentOS Stream tested and working. -- sCl
|
||||
# 20210406: Ubuntu 21.04 tested and working. -- sCl
|
||||
# 20210406: Ubuntu 20.04.2 tested and working. -- sCl
|
||||
# 20210406: Ubuntu 18.04.5 tested and working. -- sCl
|
||||
# 20210331: Kali Linux 2021.1 tested and working. -- sCl
|
||||
#
|
||||
#
|
||||
|
@ -73,6 +76,7 @@
|
|||
## 0_apt-upgrade.sh ##
|
||||
## 0_sudoKeeper.sh ##
|
||||
## 0_installCoreDeps.sh ##
|
||||
## 0_upgradePhp74.sh ##
|
||||
## 0_installDepsPhp74.sh ##
|
||||
## 0_installDepsPhp73.sh ##
|
||||
## 0_installDepsPhp72.sh ##
|
||||
|
@ -95,16 +99,24 @@
|
|||
## 6_ssdeep.sh ##
|
||||
## 6_viper.sh ##
|
||||
|
||||
## 0_RHEL_SCL.sh ##
|
||||
## 0_RHEL_register.sh ##
|
||||
## 0_RHEL7_SCL.sh ##
|
||||
## 0_RHEL8_SCL.sh ##
|
||||
## 0_RHEL7_EPEL.sh ##
|
||||
## 0_CentOS_EPEL.sh ##
|
||||
## 0_RHEL_EPEL.sh ##
|
||||
## 0_yumInstallCoreDeps.sh ##
|
||||
## 1_mispCoreInstall_RHEL.sh ##
|
||||
## 0_EPEL_REMI.sh ##
|
||||
## 0_yumInstallCoreDeps7.sh ##
|
||||
## 0_yumInstallCoreDeps8.sh ##
|
||||
## 0_yumInstallHaveged.sh ##
|
||||
## 1_mispCoreInstall_RHEL7.sh ##
|
||||
## 1_mispCoreInstall_RHEL8.sh ##
|
||||
## 1_installCake_RHEL.sh ##
|
||||
## 1_prepareDB_RHEL.sh ##
|
||||
## 1_apacheConfig_RHEL.sh ##
|
||||
## 1_apacheConfig_RHEL7.sh ##
|
||||
## 1_apacheConfig_RHEL8.sh ##
|
||||
## 1_firewall_RHEL.sh ##
|
||||
## 2_permissions_RHEL.sh ##
|
||||
## 2_permissions_RHEL7.sh ##
|
||||
## 2_permissions_RHEL8.sh ##
|
||||
## 2_logRotation_RHEL.sh ##
|
||||
## 2_configMISP_RHEL.sh ##
|
||||
## 3_configWorkers_RHEL.sh ##
|
||||
|
@ -167,6 +179,7 @@ generateInstaller () {
|
|||
perl -pe 's/^## 0_apt-upgrade.sh ##/`cat 0_apt-upgrade.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 0_sudoKeeper.sh ##/`cat 0_sudoKeeper.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 0_installCoreDeps.sh ##/`cat 0_installCoreDeps.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 0_upgradePhp74.sh ##/`cat 0_upgradePhp74.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 0_installDepsPhp74.sh ##/`cat 0_installDepsPhp74.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 0_installDepsPhp73.sh ##/`cat 0_installDepsPhp73.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 0_installDepsPhp72.sh ##/`cat 0_installDepsPhp72.sh`/ge' -i INSTALL.tpl.sh
|
||||
|
@ -190,15 +203,23 @@ generateInstaller () {
|
|||
perl -pe 's/^## 6_viper.sh ##/`cat 6_viper.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 6_ssdeep.sh ##/`cat 6_ssdeep.sh`/ge' -i INSTALL.tpl.sh
|
||||
|
||||
perl -pe 's/^## 0_RHEL_SCL.sh ##/`cat 0_RHEL_SCL.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 0_RHEL_register.sh ##/`cat 0_RHEL_register.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 0_RHEL7_SCL.sh ##/`cat 0_RHEL7_SCL.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 0_RHEL8_SCL.sh ##/`cat 0_RHEL8_SCL.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 0_CentOS_EPEL.sh ##/`cat 0_CentOS_EPEL.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 0_RHEL_EPEL.sh ##/`cat 0_RHEL_EPEL.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 0_yumInstallCoreDeps.sh ##/`cat 0_yumInstallCoreDeps.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 1_mispCoreInstall_RHEL.sh ##/`cat 1_mispCoreInstall_RHEL.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 0_RHEL7_EPEL.sh ##/`cat 0_RHEL7_EPEL.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 0_yumInstallCoreDeps7.sh ##/`cat 0_yumInstallCoreDeps7.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 0_yumInstallCoreDeps8.sh ##/`cat 0_yumInstallCoreDeps8.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 0_yumInstallHaveged.sh ##/`cat 0_yumInstallHaveged.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 1_mispCoreInstall_RHEL7.sh ##/`cat 1_mispCoreInstall_RHEL7.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 1_mispCoreInstall_RHEL8.sh ##/`cat 1_mispCoreInstall_RHEL8.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 0_EPEL_REMI.sh ##/`cat 0_EPEL_REMI.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 1_installCake_RHEL.sh ##/`cat 1_installCake_RHEL.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 2_permissions_RHEL.sh ##/`cat 2_permissions_RHEL.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 2_permissions_RHEL7.sh ##/`cat 2_permissions_RHEL7.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 2_permissions_RHEL8.sh ##/`cat 2_permissions_RHEL8.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 1_prepareDB_RHEL.sh ##/`cat 1_prepareDB_RHEL.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 1_apacheConfig_RHEL.sh ##/`cat 1_apacheConfig_RHEL.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 1_apacheConfig_RHEL7.sh ##/`cat 1_apacheConfig_RHEL7.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 1_apacheConfig_RHEL8.sh ##/`cat 1_apacheConfig_RHEL8.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 1_firewall_RHEL.sh ##/`cat 1_firewall_RHEL.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 2_logRotation_RHEL.sh ##/`cat 2_logRotation_RHEL.sh`/ge' -i INSTALL.tpl.sh
|
||||
perl -pe 's/^## 2_configMISP_RHEL.sh ##/`cat 2_configMISP_RHEL.sh`/ge' -i INSTALL.tpl.sh
|
||||
|
@ -342,10 +363,6 @@ installSupported () {
|
|||
[[ -n $CORE ]] || [[ -n $ALL ]] && coreCAKE
|
||||
progress 4
|
||||
|
||||
# Update Galaxies, Template Objects, Warning Lists, Notice Lists, Taxonomies - functionLocation('generic/MISP_CAKE_init.md')
|
||||
[[ -n $CORE ]] || [[ -n $ALL ]] && updateGOWNT
|
||||
progress 4
|
||||
|
||||
# Disable spinner
|
||||
#(kill $SPIN_PID 2>&1) >/dev/null
|
||||
|
||||
|
@ -363,6 +380,14 @@ installSupported () {
|
|||
[[ -n $MODULES ]] || [[ -n $ALL ]] && mispmodules
|
||||
progress 4
|
||||
|
||||
# Update Galaxies, Template Objects, Warning Lists, Notice Lists, Taxonomies - functionLocation('generic/MISP_CAKE_init.md')
|
||||
[[ -n $CORE ]] || [[ -n $ALL ]] && updateGOWNT
|
||||
progress 4
|
||||
|
||||
# Install misp-modules - functionLocation('generic/misp-modules-cake.md')
|
||||
[[ -n $MODULES ]] || [[ -n $ALL ]] && modulesCAKE
|
||||
progress 4
|
||||
|
||||
# Install Viper - functionLocation('generic/viper-debian.md')
|
||||
## FIXME: The current state of Viper is broken, disabling any use.
|
||||
##[[ -n $VIPER ]] || [[ -n $ALL ]] && viper
|
||||
|
@ -627,6 +652,7 @@ installMISPonKali () {
|
|||
|
||||
debug "Installing misp-modules"
|
||||
mispmodules
|
||||
modulesCAKE
|
||||
|
||||
## FIXME: The current state of Viper is broken, disabling any use.
|
||||
##debug "Installing Viper"
|
||||
|
@ -655,43 +681,80 @@ installMISPRHEL () {
|
|||
space
|
||||
echo "Proceeding with MISP core installation on RHEL ${dist_version}"
|
||||
space
|
||||
|
||||
|
||||
id -u "${MISP_USER}" > /dev/null
|
||||
if [[ $? -eq 1 ]]; then
|
||||
debug "Creating MISP user"
|
||||
sudo useradd -r "${MISP_USER}"
|
||||
sudo useradd -G wheel -m "${MISP_USER}"
|
||||
fi
|
||||
|
||||
debug "Enabling Extras Repos (SCL)"
|
||||
if [[ "${DISTRI}" == "rhel7" ]]; then
|
||||
sudo subscription-manager register --auto-attach
|
||||
enableReposRHEL
|
||||
enableEPEL
|
||||
else # CentOS
|
||||
centosEPEL
|
||||
|
||||
# Register system if RHEL
|
||||
if [[ "${DISTRI}" =~ ^[rhel].* ]]; then
|
||||
registerRHEL
|
||||
fi
|
||||
|
||||
debug "Installing System Dependencies"
|
||||
yumInstallCoreDeps
|
||||
debug "Enabling Extras Repos (SCL)"
|
||||
if [[ "${DISTRI}" == "rhel7" ]]; then
|
||||
enableReposRHEL7
|
||||
enableEPEL
|
||||
debug "Installing System Dependencies"
|
||||
yumInstallCoreDeps7
|
||||
installEntropyRHEL
|
||||
debug "Installing MISP code"
|
||||
installCoreRHEL7
|
||||
debug "Install Cake PHP"
|
||||
installCake_RHEL
|
||||
debug "Setting File permissions"
|
||||
permissions_RHEL7
|
||||
debug "Preparing Database"
|
||||
prepareDB_RHEL
|
||||
apacheConfig_RHEL7
|
||||
fi
|
||||
|
||||
if [[ "${DISTRI}" == "fedora33" ]]; then
|
||||
enableREMI_f33
|
||||
yumInstallCoreDeps8
|
||||
installEntropyRHEL
|
||||
installCoreRHEL8
|
||||
installCake_RHEL
|
||||
permissions_RHEL8
|
||||
prepareDB_RHEL
|
||||
debug "Configuring Apache"
|
||||
apacheConfig_RHEL8
|
||||
fi
|
||||
|
||||
if [[ "${DIST_VER}" =~ ^[8].* ]]; then
|
||||
enableEPEL_REMI_8
|
||||
enableOptionalRHEL8
|
||||
yumInstallCoreDeps8
|
||||
installCoreRHEL8
|
||||
installCake_RHEL
|
||||
permissions_RHEL8
|
||||
prepareDB_RHEL
|
||||
apacheConfig_RHEL8
|
||||
fi
|
||||
|
||||
if [[ "${DISTRI}" == "centos7" ]]; then
|
||||
centosEPEL
|
||||
debug "Installing MISP code"
|
||||
debug "Installing System Dependencies"
|
||||
yumInstallCoreDeps7
|
||||
installEntropyRHEL
|
||||
installCoreRHEL7
|
||||
debug "Install Cake PHP"
|
||||
installCake_RHEL
|
||||
debug "Setting File permissions"
|
||||
permissions_RHEL7
|
||||
debug "Preparing Database"
|
||||
prepareDB_RHEL
|
||||
debug "Configuring Apache"
|
||||
apacheConfig_RHEL7
|
||||
fi
|
||||
|
||||
debug "Enabling Haveged for additional entropy"
|
||||
sudo yum install haveged -y
|
||||
sudo systemctl enable --now haveged.service
|
||||
|
||||
debug "Installing MISP code"
|
||||
installCoreRHEL
|
||||
|
||||
debug "Install Cake PHP"
|
||||
installCake_RHEL
|
||||
|
||||
debug "Setting File permissions"
|
||||
permissions_RHEL
|
||||
|
||||
debug "Preparing Database"
|
||||
prepareDB_RHEL
|
||||
|
||||
debug "Configuring Apache"
|
||||
apacheConfig_RHEL
|
||||
|
||||
debug "Setting up firewall"
|
||||
firewall_RHEL
|
||||
|
@ -720,6 +783,9 @@ installMISPRHEL () {
|
|||
space
|
||||
|
||||
mispmodulesRHEL
|
||||
# Another sleep to avoid RC
|
||||
sleep 3
|
||||
modulesCAKE
|
||||
|
||||
echo "MISP modules installation finished."
|
||||
fi
|
||||
|
@ -823,7 +889,8 @@ if [[ "${FLAVOUR}" == "ubuntu" ]]; then
|
|||
if [[ "${RELEASE}" == "18.04" ]]; then
|
||||
echo "Install on Ubuntu 18.04 LTS fully supported."
|
||||
echo "Please report bugs/issues here: https://github.com/MISP/MISP/issues"
|
||||
installSupported && exit || exit
|
||||
upgradeToPHP74
|
||||
installSupported PHP="7.4" && exit || exit
|
||||
fi
|
||||
if [[ "${RELEASE}" == "20.04" ]]; then
|
||||
echo "Install on Ubuntu 20.04 LTS fully supported."
|
||||
|
|
|
@ -1124,7 +1124,6 @@ class AttributesController extends AppController
|
|||
throw new MethodNotAllowedException();
|
||||
}
|
||||
if ($this->Attribute->restore($id, $this->Auth->user())) {
|
||||
$this->Attribute->__alterAttributeCount($this->data['Attribute']['event_id']);
|
||||
$this->redirect(array('action' => 'view', $id));
|
||||
} else {
|
||||
throw new NotFoundException(__('Could not restore the attribute'));
|
||||
|
|
|
@ -3557,6 +3557,7 @@ class Attribute extends AppModel
|
|||
$attribute['Event']['published'] = 0;
|
||||
$attribute['Event']['timestamp'] = $date->getTimestamp();
|
||||
$this->Event->save($attribute['Event']);
|
||||
$this->__alterAttributeCount($attribute['Event']['id']);
|
||||
return true;
|
||||
} else {
|
||||
return 'Could not save changes.';
|
||||
|
|
|
@ -964,6 +964,31 @@ class MispObject extends AppModel
|
|||
public function editObject($object, $eventId, $user, $log, $force = false, &$nothingToChange = false)
|
||||
{
|
||||
$object['event_id'] = $eventId;
|
||||
if (isset($object['distribution']) && $object['distribution'] == 4) {
|
||||
if (!empty($object['SharingGroup'])) {
|
||||
$object['sharing_group_id'] = $this->SharingGroup->captureSG($object['SharingGroup'], $user);
|
||||
} elseif (!empty($object['sharing_group_id'])) {
|
||||
if (!$this->SharingGroup->checkIfAuthorised($user, $object['sharing_group_id'])) {
|
||||
unset($object['sharing_group_id']);
|
||||
}
|
||||
}
|
||||
if (empty($object['sharing_group_id'])) {
|
||||
$object_short = (isset($object['meta-category']) ? $object['meta-category'] : 'N/A') . '/' . (isset($object['name']) ? $object['name'] : 'N/A') . ' ' . (isset($object['uuid']) ? $object['uuid'] : 'N/A');
|
||||
$this->Log = ClassRegistry::init('Log');
|
||||
$this->Log->create();
|
||||
$this->Log->save(array(
|
||||
'org' => $user['Organisation']['name'],
|
||||
'model' => 'MispObject',
|
||||
'model_id' => 0,
|
||||
'email' => $user['email'],
|
||||
'action' => 'edit',
|
||||
'user_id' => $user['id'],
|
||||
'title' => 'Object dropped due to invalid sharing group for Event ' . $eventId . ' failed: ' . $object_short,
|
||||
'change' => 'Validation errors: ' . json_encode($this->validationErrors) . ' Full Object: ' . json_encode($object),
|
||||
));
|
||||
return 'Invalid sharing group choice.';
|
||||
}
|
||||
}
|
||||
if (isset($object['uuid'])) {
|
||||
$existingObject = $this->find('first', array(
|
||||
'recursive' => -1,
|
||||
|
@ -976,7 +1001,7 @@ class MispObject extends AppModel
|
|||
$log->create();
|
||||
$log->save(array(
|
||||
'org' => $user['Organisation']['name'],
|
||||
'model' => 'Object',
|
||||
'model' => 'MispObject',
|
||||
'model_id' => 0,
|
||||
'email' => $user['email'],
|
||||
'action' => 'edit',
|
||||
|
|
|
@ -1518,7 +1518,35 @@
|
|||
"exportable": true,
|
||||
"hide_tag": false
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"Feed": {
|
||||
"name": "Threatfox",
|
||||
"provider": "Abuse.ch",
|
||||
"url": "https:\/\/threatfox.abuse.ch\/downloads\/misp\/",
|
||||
"rules": "{\"tags\":{\"OR\":[],\"NOT\":[]},\"orgs\":{\"OR\":[],\"NOT\":[]},\"url_params\":\"\"}",
|
||||
"enabled": true,
|
||||
"distribution": "0",
|
||||
"sharing_group_id": "0",
|
||||
"tag_id": "0",
|
||||
"default": false,
|
||||
"source_format": "misp",
|
||||
"fixed_event": true,
|
||||
"delta_merge": false,
|
||||
"event_id": "0",
|
||||
"publish": false,
|
||||
"override_ids": false,
|
||||
"settings": "{\"csv\":{\"value\":\"\",\"delimiter\":\",\"},\"common\":{\"excluderegex\":\"\"}}",
|
||||
"input_source": "network",
|
||||
"delete_local_file": false,
|
||||
"lookup_visible": true,
|
||||
"headers": "",
|
||||
"caching_enabled": false,
|
||||
"force_to_ids": false,
|
||||
"orgc_id": "0",
|
||||
"cached_elements": 0,
|
||||
"coverage_by_other_feeds": "0%"
|
||||
},
|
||||
{
|
||||
"Feed": {
|
||||
"name": "Threatfox",
|
||||
|
|
|
@ -4,28 +4,10 @@
|
|||
### -2/ RHEL7/CentOS7 - status
|
||||
-------------------------
|
||||
!!! notice
|
||||
MISP-core and misp-modules Tested working by [@SteveClement](https://twitter.com/SteveClement) on 20210326
|
||||
Tested fully working without SELinux by [@SteveClement](https://twitter.com/SteveClement) on 20210401
|
||||
TODO: Fix SELinux permissions, *pull-requests welcome*.
|
||||
|
||||
!!! notice
|
||||
This document also serves as a source for the [INSTALL-misp.sh](https://github.com/MISP/MISP/blob/2.4/INSTALL/INSTALL.sh) script.
|
||||
Which explains why you will see the use of shell *functions* in various steps.
|
||||
Henceforth the document will also follow a more logical flow. In the sense that all the dependencies are installed first then config files are generated, etc...
|
||||
|
||||
### -1/ Installer and Manual install instructions
|
||||
|
||||
!!! warning
|
||||
In the **future**, to install MISP on a fresh RHEL 7 install all you need to do is:
|
||||
|
||||
```bash
|
||||
# Please check the installer options first to make the best choice for your install
|
||||
wget -O /tmp/INSTALL.sh https://raw.githubusercontent.com/MISP/MISP/2.4/INSTALL/INSTALL.sh
|
||||
bash /tmp/INSTALL.sh
|
||||
|
||||
# This will install MISP Core
|
||||
wget -O /tmp/INSTALL.sh https://raw.githubusercontent.com/MISP/MISP/2.4/INSTALL/INSTALL.sh
|
||||
bash /tmp/INSTALL.sh -c
|
||||
```
|
||||
**The above does NOT fully work yet**
|
||||
{!generic/manual-install-notes.md!}
|
||||
|
||||
!!! notice
|
||||
If the next line is `[!generic/community.md!]()` [click here](https://misp.github.io/MISP/INSTALL.rhel7/).
|
||||
|
@ -47,7 +29,6 @@
|
|||
{!generic/manual-install-notes.md!}
|
||||
|
||||
This document details the steps to install MISP on Red Hat Enterprise Linux 7.x (RHEL 7.x) and CentOS 7.x.
|
||||
At time of this writing it was tested on versions 7.6 for both.
|
||||
This is a joint RHEL/CentOS install guide. The authors tried to make it contextually evident what applies to which flavor.
|
||||
|
||||
The following assumptions with regard to this installation have been made.
|
||||
|
@ -84,7 +65,9 @@ sudo hostnamectl set-hostname misp.local # Your choice, in a production environm
|
|||
## 1.3/ **[RHEL]** Register the system for updates with Red Hat Subscription Manager
|
||||
```bash
|
||||
# <snippet-begin 0_RHEL_register.sh>
|
||||
sudo subscription-manager register --auto-attach # register your system to an account and attach to a current subscription
|
||||
registerRHEL () {
|
||||
sudo subscription-manager register --auto-attach # register your system to an account and attach to a current subscription
|
||||
}
|
||||
# <snippet-end 0_RHEL_register.sh>
|
||||
```
|
||||
|
||||
|
@ -104,13 +87,14 @@ enableReposRHEL7 () {
|
|||
# <snippet-begin 0_CentOS_EPEL.sh>
|
||||
centosEPEL () {
|
||||
# We need some packages from the Extra Packages for Enterprise Linux repository
|
||||
sudo yum install epel-release -y
|
||||
sudo yum install dnf -y
|
||||
sudo dnf install epel-release -y
|
||||
|
||||
# Since MISP 2.4 PHP 5.5 is a minimal requirement, so we need a newer version than CentOS base provides
|
||||
# Software Collections is a way do to this, see https://wiki.centos.org/AdditionalResources/Repositories/SCL
|
||||
sudo yum install centos-release-scl -y
|
||||
sudo yum install yum-utils -y
|
||||
sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y
|
||||
sudo dnf install centos-release-scl -y
|
||||
sudo dnf install yum-utils -y
|
||||
sudo dnf install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y
|
||||
sudo yum-config-manager --enable remi-php74
|
||||
}
|
||||
# <snippet-end 0_CentOS_EPEL.sh>
|
||||
|
@ -118,20 +102,20 @@ centosEPEL () {
|
|||
|
||||
## 1.5a/ Install the deltarpm package to help reduce download size when installing updates (optional)
|
||||
```bash
|
||||
sudo yum install deltarpm -y
|
||||
sudo dnf install deltarpm -y
|
||||
```
|
||||
|
||||
## 1.5.b/ Install vim (optional)
|
||||
```bash
|
||||
# Because (neo)vim is just so practical
|
||||
sudo yum install neovim -y
|
||||
# For RHEL, it's vim
|
||||
sudo dnf install neovim -y
|
||||
# For RHEL, it's vim and after enabling epel neovim is available too
|
||||
```
|
||||
|
||||
## 1.5.c/ Install ntpdate (optional)
|
||||
```bash
|
||||
# In case you time is wrong, this will fix it.
|
||||
sudo yum install ntpdate -y
|
||||
sudo dnf install ntpdate -y
|
||||
sudo ntpdate pool.ntp.org
|
||||
```
|
||||
|
||||
|
@ -139,7 +123,7 @@ sudo ntpdate pool.ntp.org
|
|||
```bash
|
||||
# <snippet-begin 0_yum-update.sh>
|
||||
yumUpdate () {
|
||||
sudo yum update -y
|
||||
sudo dnf update -y
|
||||
}
|
||||
# <snippet-end 0_yum-update.sh>
|
||||
```
|
||||
|
@ -148,9 +132,10 @@ yumUpdate () {
|
|||
```bash
|
||||
# <snippet-begin 0_RHEL7_EPEL.sh>
|
||||
enableEPEL () {
|
||||
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -y
|
||||
sudo yum install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y
|
||||
sudo yum install yum-utils -y
|
||||
sudo yum install dnf -y
|
||||
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm -y
|
||||
sudo dnf install http://rpms.remirepo.net/enterprise/remi-release-7.rpm -y
|
||||
sudo dnf install yum-utils policycoreutils-python -y
|
||||
sudo yum-config-manager --enable remi-php74
|
||||
}
|
||||
# <snippet-end 0_RHEL7_EPEL.sh>
|
||||
|
@ -159,19 +144,19 @@ enableEPEL () {
|
|||
### 2/ Dependencies
|
||||
|
||||
!!! note
|
||||
This guide installs PHP 7.4 from Remi's Repo
|
||||
This guide installs PHP 7.4 from Remi's repo
|
||||
|
||||
!!! warning
|
||||
[PHP 5.6 and 7.0 aren't supported since December 2018](https://secure.php.net/supported-versions.php). Please update accordingly. In the future only PHP7 will be supported.
|
||||
|
||||
## 2.01/ Install some base system dependencies
|
||||
```bash
|
||||
# <snippet-begin 0_yumInstallCoreDeps.sh>
|
||||
yumInstallCoreDeps () {
|
||||
# <snippet-begin 0_yumInstallCoreDeps7.sh>
|
||||
yumInstallCoreDeps7 () {
|
||||
# Install the dependencies:
|
||||
PHP_BASE="/etc/"
|
||||
PHP_INI="/etc/php.ini"
|
||||
sudo yum install gcc git zip \
|
||||
sudo dnf install gcc git zip unzip \
|
||||
mod_ssl \
|
||||
redis \
|
||||
libxslt-devel zlib-devel ssdeep-devel -y
|
||||
|
@ -180,15 +165,12 @@ yumInstallCoreDeps () {
|
|||
sudo systemctl enable --now redis.service
|
||||
|
||||
# Install MariaDB
|
||||
sudo yum install wget -y
|
||||
wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup
|
||||
chmod +x mariadb_repo_setup
|
||||
sudo ./mariadb_repo_setup
|
||||
rm mariadb_repo_setup
|
||||
sudo yum install MariaDB-server -y
|
||||
sudo dnf install wget -y
|
||||
wget https://downloads.mariadb.com/MariaDB/mariadb_repo_setup && chmod +x mariadb_repo_setup && sudo ./mariadb_repo_setup && rm mariadb_repo_setup
|
||||
sudo dnf install MariaDB-server -y
|
||||
|
||||
# Install PHP 7.4 from Remi's repo, see https://rpms.remirepo.net/enterprise/7/php74/x86_64/repoview/
|
||||
sudo yum install php php-fpm php-devel \
|
||||
sudo dnf install php php-fpm php-devel \
|
||||
php-mysqlnd \
|
||||
php-mbstring \
|
||||
php-xml \
|
||||
|
@ -204,19 +186,21 @@ yumInstallCoreDeps () {
|
|||
[[ ! -e "/usr/bin/php" ]] && sudo ln -s /usr/bin/php74 /usr/bin/php
|
||||
|
||||
# Python 3.6 is now available in RHEL 7.7 base
|
||||
sudo yum install python3 python3-devel -y
|
||||
sudo dnf install python3 python3-devel python3-virtualenv -y
|
||||
|
||||
sudo systemctl enable --now php-fpm.service
|
||||
}
|
||||
# <snippet-end 0_yumInstallCoreDeps.sh>
|
||||
# <snippet-end 0_yumInstallCoreDeps7.sh>
|
||||
```
|
||||
|
||||
```bash
|
||||
# <snippet-begin 0_yumInstallHaveged.sh>
|
||||
# GPG needs lots of entropy, haveged provides entropy
|
||||
# /!\ Only do this if you're not running rngd to provide randomness and your kernel randomness is not sufficient.
|
||||
sudo yum install haveged -y
|
||||
sudo systemctl enable --now haveged.service
|
||||
installEntropyRHEL () {
|
||||
# GPG needs lots of entropy, haveged provides entropy
|
||||
# /!\ Only do this if you're not running rngd to provide randomness and your kernel randomness is not sufficient.
|
||||
sudo dnf install haveged -y
|
||||
sudo systemctl enable --now haveged.service
|
||||
}
|
||||
# <snippet-end 0_yumInstallHaveged.sh>
|
||||
```
|
||||
|
||||
|
@ -232,11 +216,6 @@ installCoreRHEL7 () {
|
|||
cd $(dirname $PATH_TO_MISP)
|
||||
$SUDO_WWW git clone https://github.com/MISP/MISP.git
|
||||
cd $PATH_TO_MISP
|
||||
##$SUDO_WWW git checkout tags/$(git describe --tags `git rev-list --tags --max-count=1`)
|
||||
# if the last shortcut doesn't work, specify the latest version manually
|
||||
# example: git checkout tags/v2.4.XY
|
||||
# the message regarding a "detached HEAD state" is expected behaviour
|
||||
# (you only have to create a new branch, if you want to change stuff and do a pull request for example)
|
||||
|
||||
# Fetch submodules
|
||||
$SUDO_WWW git submodule update --init --recursive
|
||||
|
@ -246,7 +225,8 @@ installCoreRHEL7 () {
|
|||
$SUDO_WWW git config core.filemode false
|
||||
|
||||
# Create a python3 virtualenv
|
||||
sudo pip3 install virtualenv
|
||||
[[ -e $(which virtualenv-3 2>/dev/null) ]] && $SUDO_WWW virtualenv-3 -p python3 $PATH_TO_MISP/venv
|
||||
[[ -e $(which virtualenv 2>/dev/null) ]] && $SUDO_WWW virtualenv -p python3 $PATH_TO_MISP/venv
|
||||
$SUDO_WWW python3 -m venv $PATH_TO_MISP/venv
|
||||
sudo mkdir /usr/share/httpd/.cache
|
||||
sudo chown $WWW_USER:$WWW_USER /usr/share/httpd/.cache
|
||||
|
@ -255,7 +235,6 @@ installCoreRHEL7 () {
|
|||
cd $PATH_TO_MISP/app/files/scripts
|
||||
$SUDO_WWW git clone https://github.com/CybOXProject/python-cybox.git
|
||||
$SUDO_WWW git clone https://github.com/STIXProject/python-stix.git
|
||||
##$SUDO_WWW git clone --branch master --single-branch https://github.com/lief-project/LIEF.git lief
|
||||
$SUDO_WWW git clone https://github.com/CybOXProject/mixbox.git
|
||||
|
||||
# If you umask is has been changed from the default, it is a good idea to reset it to 0022 before installing python modules
|
||||
|
@ -297,7 +276,7 @@ installCoreRHEL7 () {
|
|||
|
||||
# FIXME: Remove libfaup etc once the egg has the library baked-in
|
||||
# BROKEN: This needs to be tested on RHEL/CentOS
|
||||
sudo yum install libcaca-devel cmake3 -y
|
||||
sudo dnf install libcaca-devel cmake3 -y
|
||||
cd /tmp
|
||||
[[ ! -d "faup" ]] && $SUDO_CMD git clone https://github.com/stricaud/faup.git faup
|
||||
[[ ! -d "gtcaca" ]] && $SUDO_CMD git clone https://github.com/stricaud/gtcaca.git gtcaca
|
||||
|
@ -340,15 +319,9 @@ installCake_RHEL ()
|
|||
sudo mkdir /usr/share/httpd/.composer
|
||||
sudo chown $WWW_USER:$WWW_USER /usr/share/httpd/.composer
|
||||
cd $PATH_TO_MISP/app
|
||||
# Update composer.phar (optional)
|
||||
#EXPECTED_SIGNATURE="$(wget -q -O - https://composer.github.io/installer.sig)"
|
||||
#$SUDO_WWW php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
|
||||
#$SUDO_WWW php -r "if (hash_file('SHA384', 'composer-setup.php') === '$EXPECTED_SIGNATURE') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
|
||||
#$SUDO_WWW php composer-setup.php
|
||||
#$SUDO_WWW php -r "unlink('composer-setup.php');"
|
||||
$SUDO_WWW php composer.phar install
|
||||
|
||||
sudo yum install php-pecl-redis php-pecl-ssdeep php-pecl-gnupg -y
|
||||
sudo dnf install php-pecl-redis php-pecl-ssdeep php-pecl-gnupg -y
|
||||
|
||||
sudo systemctl restart php-fpm.service
|
||||
|
||||
|
@ -449,8 +422,8 @@ prepareDB_RHEL () {
|
|||
If it is disabled, you can ignore the **chcon/setsebool/semanage/checkmodule/semodule*** commands.
|
||||
|
||||
```bash
|
||||
# <snippet-begin 1_apacheConfig_RHEL.sh>
|
||||
apacheConfig_RHEL () {
|
||||
# <snippet-begin 1_apacheConfig_RHEL7.sh>
|
||||
apacheConfig_RHEL7 () {
|
||||
# Now configure your apache server with the DocumentRoot $PATH_TO_MISP/app/webroot/
|
||||
# A sample vhost can be found in $PATH_TO_MISP/INSTALL/apache.misp.centos7
|
||||
|
||||
|
@ -497,7 +470,7 @@ apacheConfig_RHEL () {
|
|||
sudo chcon -R -t httpd_sys_rw_content_t $PATH_TO_MISP/app/webroot/img/custom
|
||||
sudo chcon -R -t httpd_sys_rw_content_t $PATH_TO_MISP/app/files/scripts/mispzmq
|
||||
}
|
||||
# <snippet-end 1_apacheConfig_RHEL.sh>
|
||||
# <snippet-end 1_apacheConfig_RHEL7.sh>
|
||||
```
|
||||
|
||||
!!! warning
|
||||
|
@ -694,13 +667,8 @@ configWorkersRHEL () {
|
|||
|
||||
{!generic/recommended.actions.md!}
|
||||
|
||||
### 11/ LIEF Installation
|
||||
*lief* is required for the Advanced Attachment Handler and requires manual compilation
|
||||
|
||||
The installation is explained in section **[3.01](https://misp.github.io/MISP/INSTALL.rhel7/#301-download-misp-code-using-git-in-varwww-directory)**
|
||||
|
||||
### 12/ Known Issues
|
||||
## 12.01/ Workers cannot be started or restarted from the web page
|
||||
### 11/ Known Issues
|
||||
## 11.01/ Workers cannot be started or restarted from the web page
|
||||
Possible also due to package being installed via SCL, attempting to start workers through the web page will result in error. Worker's can be restarted via the CLI using the following command.
|
||||
```bash
|
||||
systemctl restart misp-workers.service
|
||||
|
@ -711,3 +679,4 @@ systemctl restart misp-workers.service
|
|||
via this guide and will need additional investigation.
|
||||
|
||||
{!generic/hardening.md!}
|
||||
|