ANTA catalog for STUN tests
Tests¶
Test functions related to various STUN settings.
VerifyStunClient ¶
Replaced with:
VerifyStunClientTranslation
(Deprecated) Verifies the translation for a source address on a STUN client.
Alias for the VerifyStunClientTranslation test to maintain backward compatibility. When initialized, it will emit a deprecation warning and call the VerifyStunClientTranslation test.
Examples
anta.tests.stun:
- VerifyStunClient:
stun_clients:
- source_address: 172.18.3.2
public_address: 172.18.3.21
source_port: 4500
public_port: 6006
VerifyStunClientTranslation ¶
Verifies the translation for a source address on a STUN client.
This test performs the following checks for each specified address family:
- Validates that there is a translation for the source address on the STUN client.
- If public IP and port details are provided, validates their correctness against the configuration.
Expected Results
- Success: If all of the following conditions are met:
- The test will pass if the source address translation is present.
- If public IP and port details are provided, they must also match the translation information.
- Failure: If any of the following occur:
- There is no translation for the source address on the STUN client.
- The public IP or port details, if specified, are incorrect.
Examples
anta.tests.stun:
- VerifyStunClientTranslation:
stun_clients:
- source_address: 172.18.3.2
public_address: 172.18.3.21
source_port: 4500
public_port: 6006
- source_address: 100.64.3.2
public_address: 100.64.3.21
source_port: 4500
public_port: 6006
Inputs¶
Name | Type | Description | Default |
---|---|---|---|
stun_clients |
list[StunClientTranslation]
|
List of STUN clients.
|
- |
Source code in anta/tests/stun.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
VerifyStunServer ¶
Verifies the STUN server status is enabled and running.
Expected Results
- Success: The test will pass if the STUN server status is enabled and running.
- Failure: The test will fail if the STUN server is disabled or not running.
Examples
anta.tests.stun:
- VerifyStunServer:
Source code in anta/tests/stun.py
121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
|
Input models¶
Module containing input models for services tests.
StunClientTranslation ¶
STUN (Session Traversal Utilities for NAT) model represents the configuration of an IPv4-based client translations.
Name | Type | Description | Default |
---|---|---|---|
source_address |
IPv4Address
|
The IPv4 address of the STUN client
|
- |
source_port |
Port
|
The port number used by the STUN client for communication. Defaults to 4500.
|
4500
|
public_address |
IPv4Address | None
|
The public-facing IPv4 address of the STUN client, discovered via the STUN server.
|
None
|
public_port |
Port | None
|
The public-facing port number of the STUN client, discovered via the STUN server.
|
None
|
Source code in anta/input_models/stun.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|