Creates a new target domain for penetration testing. A target domain is a web domain that must be registered and verified before it can be tested.
Parameters:
-
target_domain_name
(str)
–
The domain name to register as a target domain.
-
verification_method
(DomainVerificationMethod)
–
The method to use for verifying domain ownership. Valid values are DNS_TXT, HTTP_ROUTE, and PRIVATE_VPC.
-
tags
(Optional[TagMap], default:
None
)
–
The tags to associate with the target domain.
Raises:
Source code in docs_src/capo_securityagent/_services/security_agent.py
| def create_target_domain(
self,
target_domain_name: str,
verification_method: "capo_securityagent.types.domain_verification_method.DomainVerificationMethod",
*,
config_overrides: Optional[SecurityAgentClientConfig] = None,
tags: Optional["capo_securityagent.types.tag_map.TagMap"] = None,
) -> (
"capo_securityagent.types.create_target_domain_output.CreateTargetDomainOutput"
):
"""<p>Creates a new target domain for penetration testing. A target domain is a web domain that must be registered and verified before it can be tested.</p>
Args:
target_domain_name: <p>The domain name to register as a target domain.</p>
verification_method: <p>The method to use for verifying domain ownership. Valid values are DNS_TXT, HTTP_ROUTE, and PRIVATE_VPC.</p>
tags: <p>The tags to associate with the target domain.</p>
Raises:
capo_securityagent.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_securityagent.types.create_target_domain_input.CreateTargetDomainInput]",
) -> OperationResponse[
"capo_securityagent.types.create_target_domain_output.CreateTargetDomainOutput"
]:
import capo_securityagent._operations.security_agent.create_target_domain
output, http_response = (
capo_securityagent._operations.security_agent.create_target_domain.create_target_domain(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("CreateTargetDomain")
)
input_: capo_securityagent.types.create_target_domain_input.CreateTargetDomainInput = {
"target_domain_name": target_domain_name,
"verification_method": verification_method,
}
if tags is not None:
input_["tags"] = tags
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|