Skip to content

Commit

Permalink
added windows specific paths
Browse files Browse the repository at this point in the history
we shall see
  • Loading branch information
nate st. germain committed Oct 16, 2019
1 parent 380ba09 commit 3edd43c
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 21 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.bundle
.kitchen.local.yml
.librarian/
*.swp
*.orig
*.log
*.rpm
Expand Down
50 changes: 36 additions & 14 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,26 @@
# Ruleset(s) to apply to host.
# type: array
#
# [*tmpdir*]
# Used to download Windows agent MSI
# type: string
#
# [*ts_hostname*]
# Hostname as reported to Threat Stack.
# type: string
#
# [*windows_download_url*]
# Windows MSI download url
# type: string
#
# [*windows_install_options*]
# Windows MSI install options
# type: array
#
# [*windows_ts_package*]
# Windows MSI package name
# type: string
#
# === Examples
#
# Standard usage:
Expand All @@ -78,25 +94,31 @@
#
# Pete Cheslock <[email protected]>
# Tom McLaughlin <[email protected]>
# Nate St. Germain <[email protected]>
#
# === Copyright
#
# Copyright 2016 Threat Stack, Inc.
# Copyright 2019 Threat Stack, Inc.
#
class threatstack (
$deploy_key = undef,
$package_version = $::threatstack::params::package_version,
$configure_agent = true,
$extra_args = $::threatstack::params::extra_args,
$agent_config_args = undef,
$repo_class = $::threatstack::params::repo_class,
$repo_url = $::threatstack::params::repo_url,
$gpg_key = $::threatstack::params::gpg_key,
$rulesets = $::threatstack::params::rulesets,
$confdir = $::threatstack::params::confdir,
$ts_hostname = $::fqdn,
$disable_auditd = $::threatstack::params::disable_auditd,
$disable_auditd_cmd = $::threatstack::params::disable_auditd_cmd
$deploy_key = undef,
$package_version = $::threatstack::params::package_version,
$configure_agent = true,
$extra_args = $::threatstack::params::extra_args,
$agent_config_args = undef,
$repo_class = $::threatstack::params::repo_class,
$repo_url = $::threatstack::params::repo_url,
$gpg_key = $::threatstack::params::gpg_key,
$rulesets = $::threatstack::params::rulesets,
$confdir = $::threatstack::params::confdir,
$ts_hostname = $::fqdn,
$disable_auditd = $::threatstack::params::disable_auditd,
$disable_auditd_cmd = $::threatstack::params::disable_auditd_cmd,
$tmpdir = $::threatstack::params::tmpdir,
$windows_download_url = $::threatstack::params::download_url,
$windows_ts_package = $::threatstack::params::ts_package,
$windows_install_options = $::threatstack::params::windows_opts

) inherits ::threatstack::params {

$ts_package = $::threatstack::params::ts_package
Expand Down
5 changes: 4 additions & 1 deletion manifests/msi.pp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
# This class is not meant to be directly realized outside of
# Class['::threatstack'].
#
# This is sort of a dummy class but might be used at some point.
#
# === Authors
#
# Nate St. Germain <[email protected]>
Expand All @@ -15,4 +17,5 @@
#
# Copyright 2019 Threat Stack, Inc.
#

class threatstack::msi inherits ::threatstack::params {
}
16 changes: 13 additions & 3 deletions manifests/package.pp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,18 @@
# NOTE: We do not signal the tsagent service to restart because the
# package takes care of this. The workflow differs between fresh
# installation and upgrades.
package { $::threatstack::ts_package:
ensure => $::threatstack::package_version,
require => $required
case $facts['os']['family'] {
'Windows': {
package { $::threatstack::ts_package:
ensure => $::threatstack::package_version,
source => $::threatstack::windows_download_url
install_options => $::threatstack::windows_install_options
}
}
default:
package { $::threatstack::ts_package:
ensure => $::threatstack::package_version,
require => $required
}
}
}
7 changes: 5 additions & 2 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,15 @@

case $facts['os']['family'] {
'Windows': {
$ts_service = 'Threat Stack Agent'
$ts_package = 'Threat Stack Agent'
$windows_base_url = 'https://pkg.threatstack.com/v2/Windows'
$ts_package = 'Threat+Stack+Cloud+Security+Agent.latest.msi'
$windows_pkg_name = 'Threat+Stack+Cloud+Security+Agent.latest.msi'
$download_url = "${windows_base_url}/${windows_pkg_name}"
$rulesets = ['Windows Rule Set']
$progdir = 'C:\\Program Files\\Threat Stack'
$tmpdir = '%TEMP%\\ThreatStack'
$windows_opts = ["TSDEPLOYKEY=${::threatstack::deploy_key}"]

}
'RedHat': {
$repo_class = '::threatstack::yum'
Expand Down
1 change: 0 additions & 1 deletion manifests/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@
}

}

0 comments on commit 3edd43c

Please sign in to comment.