Skip to content

Commit

Permalink
Catch up to the latest version (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
ninoseki authored Dec 21, 2018
1 parent 2644ea5 commit c036692
Show file tree
Hide file tree
Showing 17 changed files with 449 additions and 204 deletions.
171 changes: 171 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
# Relaxed.Ruby.Style
## Version 2.2

require: rubocop-itamae

Style/Alias:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylealias

Style/AsciiComments:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleasciicomments

Style/BeginBlock:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylebeginblock

Style/BlockDelimiters:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleblockdelimiters

Style/CommentAnnotation:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylecommentannotation

Style/Documentation:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styledocumentation

Layout/DotPosition:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#layoutdotposition

Style/DoubleNegation:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styledoublenegation

Style/EndBlock:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleendblock

Style/FormatString:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleformatstring

Style/IfUnlessModifier:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleifunlessmodifier

Style/Lambda:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylelambda

Style/ModuleFunction:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylemodulefunction

Style/MultilineBlockChain:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylemultilineblockchain

Style/NegatedIf:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylenegatedif

Style/NegatedWhile:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylenegatedwhile

Style/ParallelAssignment:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleparallelassignment

Style/PercentLiteralDelimiters:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylepercentliteraldelimiters

Style/PerlBackrefs:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styleperlbackrefs

Style/Semicolon:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylesemicolon

Style/SignalException:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylesignalexception

Style/SingleLineBlockParams:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylesinglelineblockparams

Style/SingleLineMethods:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylesinglelinemethods

Layout/SpaceBeforeBlockBraces:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#layoutspacebeforeblockbraces

Layout/SpaceInsideParens:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#layoutspaceinsideparens

Style/SpecialGlobalVars:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylespecialglobalvars

Style/StringLiterals:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylestringliterals

Style/TrailingCommaInArguments:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainarguments

Style/TrailingCommaInArrayLiteral:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainarrayliteral

Style/TrailingCommaInHashLiteral:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#styletrailingcommainhashliteral

Style/SymbolArray:
Enabled: false
StyleGuide: http://relaxed.ruby.style/#stylesymbolarray

Style/WhileUntilModifier:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylewhileuntilmodifier

Style/WordArray:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#stylewordarray

Lint/AmbiguousRegexpLiteral:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#lintambiguousregexpliteral

Lint/AssignmentInCondition:
Enabled: false
StyleGuide: https://relaxed.ruby.style/#lintassignmentincondition

Metrics/AbcSize:
Enabled: false

Metrics/BlockNesting:
Enabled: false

Metrics/ClassLength:
Enabled: false

Metrics/ModuleLength:
Enabled: false

Metrics/CyclomaticComplexity:
Enabled: false

Metrics/LineLength:
Enabled: false

Metrics/MethodLength:
Enabled: false

Metrics/ParameterLists:
Enabled: false

Metrics/PerceivedComplexity:
Enabled: false
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
source 'https://rubygems.org'

gem 'itamae'
gem "itamae"
16 changes: 8 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ GEM
remote: https://rubygems.org/
specs:
ansi (1.5.0)
hashie (3.5.7)
itamae (1.9.11)
hashie (3.6.0)
itamae (1.10.2)
ansi
hashie
schash (~> 0.1.0)
specinfra (>= 2.64.0, < 3.0.0)
thor
net-scp (1.2.1)
net-ssh (>= 2.6.5)
net-ssh (4.2.0)
net-ssh (5.0.2)
net-telnet (0.1.1)
schash (0.1.2)
sfl (2.3)
specinfra (2.73.2)
specinfra (2.76.5)
net-scp
net-ssh (>= 2.7, < 5.0)
net-telnet
net-ssh (>= 2.7)
net-telnet (= 0.1.1)
sfl
thor (0.20.0)
thor (0.20.3)

PLATFORMS
ruby
Expand All @@ -29,4 +29,4 @@ DEPENDENCIES
itamae

BUNDLED WITH
1.16.1
1.17.2
53 changes: 45 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,61 @@

Automated installation of [TheHive](https://github.com/TheHive-Project/TheHive) & [Cortex](https://github.com/TheHive-Project/Cortex) by using [itamae](https://github.com/itamae-kitchen/itamae).

## Supported versions

- OS: `Ubuntu 16.04 LTS`
- TheHive: `3.2.1`
- Cortex: `2.1.3`

## Prerequisite

Please install itamae beforehand.

```bash
$ gem install itamae
```

## How to use

```bash
# Apply an itamae recipe to a Vagrant VM
$ itamae ssh --vagrant cookbooks/hive/default.rb
$ itamae ssh --vagrant cookbooks/thehive/default.rb
# Apply an itamae recipe to a remote host
$ itamae ssh --host x.x.x.x cookbooks/hive/default.rb
$ itamae ssh --host x.x.x.x cookbooks/thehive/default.rb
```

After running the itamae recipe, TheHive / Cortex / Elasticsearch work on these ports.
After running the itamae recipe, TheHive / Cortex / Elasticsearch work on following ports.

- TheHive: `8080/tcp`
- TheHive: `9000/tcp`
- Cortex: `9001/tcp`
- Elasticsearch: `9300/tcp`

## Configuration

### Setting up Cortex

Go to `http://YOUR_SERVER_ADDRESS:9001` and follow instructions of [the official guide](https://github.com/TheHive-Project/CortexDocs/blob/master/admin/quick-start.md#step-2-update-the-database).

### Setting up TheHive

You need to set your Cortex API key in `/etc/thehive/application.conf`.

```
cortex {
"CORTEX-SERVER-ID" {
url = "http://localhost:9001"
key = "YOUR_API_KEY"
}
}
```

And then go to `http://YOUR_SERVER_ADDRESS:9000` and follow instructions of [the official guide](https://github.com/TheHive-Project/TheHiveDocs/blob/master/installation/install-guide.md#5-first-start).

## Notes

- This itamae script supports only Ubuntu 16.04 LTS.
- [Cortex-Analyzers](https://github.com/TheHive-Project/Cortex-Analyzers) is installed to `/opt/cortex/Cortex-Analyzers`.
- You need to upload a report template of Cortex manually. Please refer to `6. Cortex` of [TheHiveDocs/admin/configuration.md](https://github.com/TheHive-Project/TheHiveDocs/blob/master/admin/configuration.md#6-cortex)
- You need to create a Cortex account for TheHive integration and set its API key in `/ /etc/thehive/application.conf` manually.
- [Cortex-Analyzers](https://github.com/TheHive-Project/Cortex-Analyzers) is installed into `/opt/cortex/Cortex-Analyzers`.

## References

- [TheHive-Project/CortexDocs](https://github.com/TheHive-Project/CortexDocs)
- [TheHive-Project/TheHiveDocs](https://github.com/TheHive-Project/TheHiveDocs)
2 changes: 1 addition & 1 deletion Vagrantfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Vagrant.configure("2") do |config|
# within the machine from a port on the host machine. In the example below,
# accessing "localhost:8080" will access port 80 on the guest machine.
# NOTE: This will enable public access to the opened port
config.vm.network "forwarded_port", guest: 8080, host: 8080
config.vm.network "forwarded_port", guest: 9000, host: 9000
config.vm.network "forwarded_port", guest: 9001, host: 9001
config.vm.network "forwarded_port", guest: 9300, host: 9300

Expand Down
38 changes: 0 additions & 38 deletions cookbooks/hive/files/usr/lib/systemd/system/thehive.service

This file was deleted.

Loading

0 comments on commit c036692

Please sign in to comment.