Skip to content

Commit

Permalink
Replacing old force option by the new force block
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelazoDS authored and palaciosjeremias committed Nov 3, 2021
1 parent 2e67d6f commit d0babf2
Show file tree
Hide file tree
Showing 5 changed files with 149 additions and 124 deletions.
18 changes: 9 additions & 9 deletions tests/integration/test_authd/data/enroll_messages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
-
name: "Single Group - Valid group"
description: "Check single group enrollment"
groups:
groups:
- 'Group1'
- 'Group2'
test_case:
Expand All @@ -27,7 +27,7 @@
-
name: "Single Group - Name too long"
description: "Check group does not exist"
groups:
groups:
- 'sltqohmjeltdihvfvolvfeazekpdmgdusyprzwtwhptfnxsgwhoumythxhubnbhtqpmaojadpypupryblaiqdutylohhtjcalblytmbboiunldafzjghpmqlrwmhpwtoxflabdfzpsosfmniwyymhkurgelfzpewmftksbkrmzqoibsgatoqgmsidtailhleghqybdqjikdmcjfktyofscfowszjilwjmfdxwojshpimwkmmafmpiciouybmldkdf'
test_case:
-
Expand All @@ -36,7 +36,7 @@
-
name: "Single Group - Invalid Characters"
description: "Check group does not exist"
groups:
groups:
- "Group\\"
- "Group?1"
- "Group<3"
Expand All @@ -57,7 +57,7 @@
-
name: "Single Group - Empty Group"
description: "Check Error message when groups is empty"
groups:
groups:
- "GroupA"
- "GroupB"
test_case:
Expand All @@ -67,7 +67,7 @@
-
name: "Multiple Group - Valid groups"
description: "Check Multiple groups enrollment"
groups:
groups:
- 'Group1'
- 'Group2'
test_case:
Expand All @@ -77,7 +77,7 @@
-
name: "Multiple Group - One group is invalid"
description: "Check Multiple groups enrollment"
groups:
groups:
- 'Group1'
- 'Group2'
test_case:
Expand All @@ -87,7 +87,7 @@
-
name: "Multiple Group - Name too long"
description: "Check group does not exist"
groups:
groups:
- 'Group1'
- 'sltqohmjeltdihvfvolvfeazekpdmgdusyprzwtwhptfnxsgwhoumythxhubnbhtqpmaojadpypupryblaiqdutylohhtjcalblytmbboiunldafzjghpmqlrwmhpwtoxflabdfzpsosfmniwyymhkurgelfzpewmftksbkrmzqoibsgatoqgmsidtailhleghqybdqjikdmcjfktyofscfowszjilwjmfdxwojshpimwkmmafmpiciouybmldkdf'
test_case:
Expand All @@ -97,7 +97,7 @@
-
name: "Multiple Group - Invalid Characters"
description: "Check groups with invalid characters"
groups:
groups:
- "Group\\"

- "Group?1"
Expand All @@ -110,7 +110,7 @@
-
name: "Multiple Group - Empty List"
description: "Check empty group list"
groups:
groups:
- "GroupA"
- "GroupB"
test_case:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
name: "Valid Certificates - Manager verification without host"
description: "Enables CA Certificate and validates that conneciton is acepted when valid certs are provided"
test_case:
-
-
ciphers: "HIGH:!ADH:!EXP:!MD5:!RC4:!3DES:!CAMELLIA:@STRENGTH"
protocol: "ssl_tlsv1_2"
expect: "output"
Expand Down
126 changes: 96 additions & 30 deletions tests/integration/test_authd/data/wazuh_authd_configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,18 @@
value: 1515
- use_source_ip:
value: 'no'
- force_insert:
value: 'yes'
- force_time:
value: 0
- force:
elements:
- enabled:
value: 'yes'
- key_mismatch:
value: 'yes'
- after_registration_time:
value: '0h'
- disconnected_time:
attributes:
- enabled: 'yes'
value: '0h'
- purge:
value: 'yes'
- use_password:
Expand Down Expand Up @@ -80,10 +88,18 @@
value: 1515
- use_source_ip:
value: 'no'
- force_insert:
value: 'yes'
- force_time:
value: 0
- force:
elements:
- enabled:
value: 'yes'
- key_mismatch:
value: 'no'
- after_registration_time:
value: '0h'
- disconnected_time:
attributes:
- enabled: 'yes'
value: '0h'
- purge:
value: 'yes'
- use_password:
Expand Down Expand Up @@ -114,10 +130,18 @@
value: 1515
- use_source_ip:
value: 'no'
- force_insert:
value: 'yes'
- force_time:
value: 0
- force:
elements:
- enabled:
value: 'yes'
- key_mismatch:
value: 'no'
- after_registration_time:
value: '0h'
- disconnected_time:
attributes:
- enabled: 'yes'
value: '0h'
- purge:
value: 'yes'
- use_password:
Expand Down Expand Up @@ -162,10 +186,18 @@
value: 1515
- use_source_ip:
value: 'no'
- force_insert:
value: 'yes'
- force_time:
value: 0
- force:
elements:
- enabled:
value: 'yes'
- key_mismatch:
value: 'no'
- after_registration_time:
value: '0h'
- disconnected_time:
attributes:
- enabled: 'yes'
value: '0h'
- purge:
value: 'yes'
- use_password:
Expand Down Expand Up @@ -217,10 +249,18 @@
value: 1515
- use_source_ip:
value: USE_SOURCE_IP
- force_insert:
value: 'yes'
- force_time:
value: 0
- force:
elements:
- enabled:
value: 'yes'
- key_mismatch:
value: 'no'
- after_registration_time:
value: '0h'
- disconnected_time:
attributes:
- enabled: 'yes'
value: '0h'
- purge:
value: 'yes'
- limit_maxagents:
Expand All @@ -246,8 +286,18 @@
value: 'no'
- port:
value: 1515
- force_time:
value: 0
- force:
elements:
- enabled:
value: 'yes'
- key_mismatch:
value: 'no'
- after_registration_time:
value: '0h'
- disconnected_time:
attributes:
- enabled: 'yes'
value: '0h'
- purge:
value: 'yes'
- use_password:
Expand Down Expand Up @@ -277,10 +327,18 @@
value: 1515
- use_source_ip:
value: 'no'
- force_insert:
value: 'yes'
- force_time:
value: 0
- force:
elements:
- enabled:
value: 'yes'
- key_mismatch:
value: 'no'
- after_registration_time:
value: '0h'
- disconnected_time:
attributes:
- enabled: 'yes'
value: '0h'
- purge:
value: 'yes'
- use_password:
Expand Down Expand Up @@ -310,10 +368,18 @@
value: 1515
- use_source_ip:
value: 'no'
- force_insert:
value: 'yes'
- force_time:
value: 0
- force:
elements:
- enabled:
value: 'yes'
- key_mismatch:
value: 'no'
- after_registration_time:
value: '0h'
- disconnected_time:
attributes:
- enabled: 'yes'
value: '0h'
- purge:
value: 'yes'
- use_password:
Expand Down
4 changes: 3 additions & 1 deletion tests/integration/test_authd/test_authd_agents_ctx.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@ def register_agent_main_server(Name, Group=None, IP=None):


def register_agent_local_server(Name, Group=None, IP=None):
message = '{{"arguments":{{"force":0,"name":"{}"'.format(Name)
message = ('{"arguments":{"force":{"enabled":true,"disconnected_time":{"enabled":true,"value":"0"},'
'"key_mismatch":true,"after_registration_time":"0"}')
message += ',"name":"{}"'.format(Name)
if Group:
message += ',"groups":"{}"'.format(Group)
if IP:
Expand Down
Loading

0 comments on commit d0babf2

Please sign in to comment.