-
Notifications
You must be signed in to change notification settings - Fork 354
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #834 from splunk/ar_improvements
AR local improvements
- Loading branch information
Showing
33 changed files
with
281 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
--- | ||
|
||
- include: install_packages.yml | ||
when: cloud_provider != "local" | ||
- include: setup_tomcat.yml | ||
when: cloud_provider != "local" | ||
- include: guacamole_server.yml | ||
when: cloud_provider != "local" | ||
- include: guacamole_client.yml | ||
when: cloud_provider != "local" | ||
- include: guacamole_client.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 0 additions & 5 deletions
5
packer/ansible/roles/linux_universal_forwarder/files/outputs.conf
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
packer/ansible/roles/linux_universal_forwarder/templates/outputs.conf.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[tcpout] | ||
defaultGroup=my_indexers | ||
|
||
[tcpout:my_indexers] | ||
{% if cloud_provider == 'local' %} | ||
server=192.168.56.12:9997 | ||
{%- else -%} | ||
server=10.0.1.12:9997 | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 0 additions & 20 deletions
20
packer/ansible/roles/splunk_server/templates/outputs.conf.j2
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
|
||
- name: install Chocolatey CLI v1.4.0 | ||
win_chocolatey: | ||
name: 'chocolatey' | ||
state: present | ||
version: '1.4.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
packer/ansible/roles/windows_universal_forwarder/templates/outputs.conf.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[tcpout] | ||
defaultGroup=my_indexers | ||
|
||
[tcpout:my_indexers] | ||
{% if cloud_provider == 'local' %} | ||
server=192.168.56.12:9997 | ||
{%- else -%} | ||
server=10.0.1.12:9997 | ||
{%- endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
--- | ||
|
||
- include: guacamole_server_post.yml | ||
when: cloud_provider != "local" | ||
- include: guacamole_server_post.yml |
62 changes: 62 additions & 0 deletions
62
terraform/ansible/roles/guacamole/templates/user-mapping-local.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<user-mapping> | ||
<authorize | ||
username="Admin" | ||
password="{{attack_range_password|hash('md5')}}" | ||
encoding="md5"> | ||
|
||
<connection name="ar-splunk"> | ||
<protocol>ssh</protocol> | ||
<param name="hostname">localhost</param> | ||
<param name="port">22</param> | ||
<param name="username">vagrant</param> | ||
<param name="password">vagrant</param> | ||
</connection> | ||
|
||
{% if phantom_server == '1' %} | ||
<connection name="ar-phantom"> | ||
<protocol>ssh</protocol> | ||
<param name="hostname">192.168.56.13</param> | ||
<param name="port">22</param> | ||
<param name="username">vagrant</param> | ||
<param name="password">vagrant</param> | ||
</connection> | ||
{% endif %} | ||
|
||
{% for server in range(windows_servers_count) %} | ||
<connection name="ar-win-{{ loop.index-1 }}"> | ||
<protocol>rdp</protocol> | ||
<param name="hostname">192.168.56.{{loop.index-1+14}}</param> | ||
<param name="port">3389</param> | ||
{% if cloud_provider == 'azure' %} | ||
<param name="username">AzureAdmin</param> | ||
{% else %} | ||
<param name="username">Administrator</param> | ||
{% endif %} | ||
<param name="password">{{attack_range_password}}</param> | ||
<param name="ignore-cert">true</param> | ||
</connection> | ||
{% endfor %} | ||
|
||
{% for server in range(linux_servers_count) %} | ||
<connection name="ar-linux-{{ loop.index-1 }}"> | ||
<protocol>ssh</protocol> | ||
<param name="hostname">192.168.56.{{loop.index-1+21}}</param> | ||
<param name="port">22</param> | ||
<param name="username">vagrant</param> | ||
<param name="password">vagrant</param> | ||
</connection> | ||
{% endfor %} | ||
|
||
{% if kali_server == '1' %} | ||
<connection name="ar-kali"> | ||
<protocol>ssh</protocol> | ||
<param name="hostname">192.168.56.30</param> | ||
<param name="port">22</param> | ||
<param name="username">vagrant</param> | ||
<param name="password">vagrant</param> | ||
</connection> | ||
{% endif %} | ||
|
||
</authorize> | ||
|
||
</user-mapping> |
27 changes: 27 additions & 0 deletions
27
terraform/ansible/roles/join_domain/tasks/create_local.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
|
||
- name: Change dns server to domain controller | ||
win_dns_client: | ||
adapter_names: "{{ ansible_interfaces.0.connection_name }}" | ||
ipv4_addresses: "192.168.56.14" | ||
|
||
- name: reboot | Rebooting Server | ||
win_reboot: | ||
|
||
- name: Copy join domain script to host | ||
win_copy: | ||
src: "join_domain.ps1" | ||
dest: 'C:\join_domain.ps1' | ||
|
||
- name: Run join domain | ||
win_shell: "C:\\join_domain.ps1 attackrange.local {{ ansible_user }}@attackrange.local {{ attack_range_password }}" | ||
register: win_shell_output | ||
retries: 20 | ||
delay: 60 | ||
until: win_shell_output.stderr == "" | ||
|
||
- debug: | ||
var: win_shell_output | ||
|
||
- name: reboot | Rebooting Server | ||
win_reboot: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
|
||
- include: create.yml | ||
when: join_domain == "1" | ||
when: join_domain == "1" and cloud_provider != "local" | ||
|
||
- include: create_local.yml | ||
when: join_domain == "1" and cloud_provider == "local" | ||
|
||
- include: windows-disable-firewall.yml | ||
when: join_domain == "1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
--- | ||
|
||
- include: install.yml | ||
when: prelude == "1" | ||
when: prelude == "1" and cloud_provider!='local' | ||
|
||
- include: install_local.yml | ||
when: prelude == "1" and cloud_provider=='local' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.