Skip to content

Commit ce40163

Browse files
authored
Merge pull request #38 from threatstack/ruleset-fix
Support threatstack_ruleset array of values
2 parents e2de58a + 7ed7f8b commit ce40163

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

.kitchen.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ provisioner:
1919
threatstack_pkg: <%= ENV['TS_PACKAGE_VERSION'] %>
2020
<% end %>
2121
<% if ENV['TS_RULE_SETS'] %>
22-
threatstack_ruleset: "<%= ENV['TS_RULE_SETS'] != nil ? ENV['TS_RULE_SETS'] : 'Base Rule Set' %>"
22+
threatstack_ruleset: "<%= ENV['TS_RULE_SETS'] %>"
2323
<% end %>
2424

2525
platforms:

defaults/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ threatstack_pkg_state: installed
66
# to set a version of the agent use threatstack-agent=X.Y.Z
77
threatstack_pkg: threatstack-agent
88
#threatstack_hostname:
9-
#threatstack_ruleset:
9+
threatstack_ruleset:
10+
- 'Base Rule Set'
1011
threatstack_config_dir: '/etc/threatstack'
1112
threatstack_config: "{{ threatstack_config_dir }}/tsconfig.json"
1213
threatstack_configure_agent: true

templates/config.j2

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
{% if threatstack_hostname is defined %}
33
"hostname": "{{ threatstack_hostname }}",
44
{% endif %}
5-
{% if threatstack_ruleset is defined %}
6-
"ruleset": "{{ threatstack_ruleset }}",
5+
{% if threatstack_ruleset | length > 0 %}
6+
"ruleset": "{{ threatstack_ruleset | join(",") }}",
77
{% endif %}
88
"deploy-key": "{{ threatstack_deploy_key | mandatory }}"
99
}

tests/test.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
vars:
55
timestamp: "{{ lookup('pipe', 'date +%Y%m%d') }}"
66
threatstack_deploy_key: "{{ lookup('env','API_KEY') }}"
7-
threatstack_ruleset: 'Travis Rule Set'
7+
threatstack_ruleset:
8+
- 'Travis Rule Set'
89
threatstack_hostname: 'TravisCI_{{timestamp}}'
910
threatstack_config_dir: '/etc/threatstack'
1011
threatstack_config: "{{ threatstack_config_dir }}/tsconfig.json"

0 commit comments

Comments
 (0)