| DevOps Hacking with Clojure | Website & Blog
Usage Reference-Targets Reference-Domain-API Reference-Infra-API Compatibility License
curl -L -o hardening.jar https://github.com/DomainDrivenArchitecture/dda-hardening-crate/releases/download/1.0.1/dda-hardening-crate-1.0.1-standalone.jar
)hardening.edn
configruration file in the same folder where you saved the jar-file. The hardening.edn
file specifies the hardenings to apply. You may use the following example as a starting point and adjust it according to your own needs:{:webserver
{:additional-incomming-ports ["23442"]}}
targets.edn
file. In this file you define gainst which server(s) the tests are performed and the corresponding login information. You may use and adjust the following example config:{:existing [{:node-name "target1" ; semantic name (keep the default or use a name that suits you)
:node-ip "192.168.56.104"}] ; the ip4 address of the machine to be provisioned
{:node-name "target2" ; semantic name (keep the default or use a name that suits you)
:node-ip "192.168.56.105"}] ; the ip4 address of the machine to be provisioned
:provisioning-user {:login "initial" ; user on the target machine, must have sudo rights
:password {:plain "secure1234"}}} ; password can be ommited, if a ssh key is authorized
java -jar dda-hardening-crate-standalone.jar hardening.edn
For installation on remote server(s) please specify the targets file:
java -jar dda-hardening-crate-standalone.jar --targets targets.edn hardening.edn
You will find here the reference for
The schema of the domain layer for the targets is:
(def ExistingNode
"Represents a target node with ip and its name."
{:node-name s/Str ; semantic name (keep the default or use a name that suits you)
:node-ip s/Str}) ; the ip4 address of the machine to be provisioned
(def ExistingNodes
"A sequence of ExistingNodes."
{s/Keyword [ExistingNode]})
(def ProvisioningUser
"User used for provisioning."
{:login s/Str ; user on the target machine, must have sudo rights
(s/optional-key :password) secret/Secret}) ; password can be ommited, if a ssh key is authorized
(def Targets
"Targets to be used during provisioning."
{:existing [ExistingNode] ; one ore more target nodes.
(s/optional-key :provisioning-user) ProvisioningUser}) ; user can be ommited to execute on localhost with current user
The "targets.edn" file has to match this schema.
The schema for the hardening is:
(def HardeningDomain
(s/either
{:webserver ; block incoming traffic except 22, 80 & 443
{:additional-incomming-ports [s/Str]}}
{:all-tier-appserver ; block incoming traffic except 22, 80 & 443, allow ajp from known ip
{:additional-incomming-ports [s/Str]
:allow-ajp-from-ip [s/Str]}}
{:ssh-only-server ; block incoming traffic except 22
{:incomming-ports [s/Str]}}))
The "hardening.edn" file has to match this schema.
The infra configuration is a configuration on the infrastructure level of a crate. It contains the complete configuration options that are possible with the crate functions.
The schema is:
(def IpVersion ; for which ip-versions ip-tables should be applied.
(s/enum :ipv6 :ipv4)) ; we apply the same rules to both ip-versions
(def IpTables
{:ip-version (hash-set IpVersion)
:static-rules (hash-set (s/enum :antilockout-ssh :allow-local :drop-ping
:allow-ftp-as-client :allow-dns-as-client
:allow-established-input :allow-established-output
:log-and-drop-remaining-input :log-and-drop-remaining-output))
(s/optional-key :allow-ajp-from-ip) [s/Str] ;incoming ip address
(s/optional-key :incomming-ports) [s/Str]
(s/optional-key :outgoing-ports) [s/Str]}) ; allow-destination-port)
(def HardeningInfra
{:settings (hash-set (s/enum :unattende-upgrades
:sshd-key-only))
(s/optional-key :iptables) iptables/IpTables})
dda-pallet is compatible to the following versions
Copyright © 2015, 2016, 2017, 2018 meissa GmbH Published under apache2.0 license
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close