Skip to content

update_pentest

update_pentest(
    pentest_id: str,
    agent_space_id: str,
    *,
    config_overrides: Optional[SecurityAgentClientConfig] = None,
    title: Optional[str] = None,
    assets: Optional[Assets] = None,
    exclude_risk_types: Optional[RiskTypeList] = None,
    service_role: Optional[ServiceRole] = None,
    log_config: Optional[CloudWatchLog] = None,
    vpc_config: Optional[VpcConfig] = None,
    network_traffic_config: Optional[NetworkTrafficConfig] = None,
    code_remediation_strategy: Optional[CodeRemediationStrategy] = None,
    disable_managed_skills: Optional[SkillTypeList] = None,
    max_task_hours: Optional[float] = None,
    report_destination: Optional[ReportDestination] = None,
    report_filters: Optional[ReportFilters] = None,
    cicd_configuration: Optional[CiCdConfiguration] = None,
    test_scope: Optional[TestScope] = None,
) -> UpdatePentestOutput

Updates an existing pentest configuration.

Parameters:

  • pentest_id (str) –

    The unique identifier of the pentest to update.

  • agent_space_id (str) –

    The unique identifier of the agent space that contains the pentest.

  • title (Optional[str], default: None ) –

    The updated title of the pentest.

  • assets (Optional[Assets], default: None ) –

    The updated assets for the pentest.

  • exclude_risk_types (Optional[RiskTypeList], default: None ) –

    The updated list of risk types to exclude from the pentest.

  • service_role (Optional[ServiceRole], default: None ) –

    The updated IAM service role for the pentest.

  • log_config (Optional[CloudWatchLog], default: None ) –

    The updated CloudWatch Logs configuration for the pentest.

  • vpc_config (Optional[VpcConfig], default: None ) –

    The updated VPC configuration for the pentest.

  • network_traffic_config (Optional[NetworkTrafficConfig], default: None ) –

    The updated network traffic configuration for the pentest.

  • code_remediation_strategy (Optional[CodeRemediationStrategy], default: None ) –

    The updated code remediation strategy for the pentest.

  • disable_managed_skills (Optional[SkillTypeList], default: None ) –

    The updated list of managed skills to disable for this pentest. Valid values include FINDING_PERSONALIZATION and LOGIN_OPTIMIZATION.

  • max_task_hours (Optional[float], default: None ) –

    The updated maximum number of billable task hours allowed for jobs started from this pentest.

  • report_destination (Optional[ReportDestination], default: None ) –

    The destination for publishing scan reports to an integrated document provider.

  • report_filters (Optional[ReportFilters], default: None ) –

    The report-generation filters applied when the report is exported.

  • cicd_configuration (Optional[CiCdConfiguration], default: None ) –

    The updated CI/CD pentesting configuration to apply to the pentest.

Raises:

Source code in docs_src/capo_securityagent/_services/security_agent.py
def update_pentest(
    self,
    pentest_id: str,
    agent_space_id: str,
    *,
    config_overrides: Optional[SecurityAgentClientConfig] = None,
    title: Optional[str] = None,
    assets: Optional["capo_securityagent.types.assets.Assets"] = None,
    exclude_risk_types: Optional[
        "capo_securityagent.types.risk_type_list.RiskTypeList"
    ] = None,
    service_role: Optional[
        "capo_securityagent.types.service_role.ServiceRole"
    ] = None,
    log_config: Optional[
        "capo_securityagent.types.cloud_watch_log.CloudWatchLog"
    ] = None,
    vpc_config: Optional["capo_securityagent.types.vpc_config.VpcConfig"] = None,
    network_traffic_config: Optional[
        "capo_securityagent.types.network_traffic_config.NetworkTrafficConfig"
    ] = None,
    code_remediation_strategy: Optional[
        "capo_securityagent.types.code_remediation_strategy.CodeRemediationStrategy"
    ] = None,
    disable_managed_skills: Optional[
        "capo_securityagent.types.skill_type_list.SkillTypeList"
    ] = None,
    max_task_hours: Optional[float] = None,
    report_destination: Optional[
        "capo_securityagent.types.report_destination.ReportDestination"
    ] = None,
    report_filters: Optional[
        "capo_securityagent.types.report_filters.ReportFilters"
    ] = None,
    cicd_configuration: Optional[
        "capo_securityagent.types.ci_cd_configuration.CiCdConfiguration"
    ] = None,
    test_scope: Optional["capo_securityagent.types.test_scope.TestScope"] = None,
) -> "capo_securityagent.types.update_pentest_output.UpdatePentestOutput":
    """<p>Updates an existing pentest configuration.</p>

    Args:
        pentest_id: <p>The unique identifier of the pentest to update.</p>
        agent_space_id: <p>The unique identifier of the agent space that contains the pentest.</p>
        title: <p>The updated title of the pentest.</p>
        assets: <p>The updated assets for the pentest.</p>
        exclude_risk_types: <p>The updated list of risk types to exclude from the pentest.</p>
        service_role: <p>The updated IAM service role for the pentest.</p>
        log_config: <p>The updated CloudWatch Logs configuration for the pentest.</p>
        vpc_config: <p>The updated VPC configuration for the pentest.</p>
        network_traffic_config: <p>The updated network traffic configuration for the pentest.</p>
        code_remediation_strategy: <p>The updated code remediation strategy for the pentest.</p>
        disable_managed_skills: <p>The updated list of managed skills to disable for this pentest. Valid values include FINDING_PERSONALIZATION and LOGIN_OPTIMIZATION.</p>
        max_task_hours: <p>The updated maximum number of billable task hours allowed for jobs started from this pentest.</p>
        report_destination: <p>The destination for publishing scan reports to an integrated document provider.</p>
        report_filters: <p>The report-generation filters applied when the report is exported.</p>
        cicd_configuration: <p>The updated CI/CD pentesting configuration to apply to the pentest.</p>

    Raises:
        capo_securityagent.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_securityagent.types.update_pentest_input.UpdatePentestInput]",
    ) -> OperationResponse[
        "capo_securityagent.types.update_pentest_output.UpdatePentestOutput"
    ]:
        import capo_securityagent._operations.security_agent.update_pentest

        output, http_response = (
            capo_securityagent._operations.security_agent.update_pentest.update_pentest(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_securityagent.types.update_pentest_input.UpdatePentestInput",
    ) -> dict[str, Any]:
        import capo_securityagent.types.update_pentest_input

        return capo_securityagent.types.update_pentest_input.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_securityagent.types.update_pentest_output.UpdatePentestOutput",
    ) -> dict[str, Any]:
        import capo_securityagent.types.update_pentest_output

        return capo_securityagent.types.update_pentest_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdatePentest",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_securityagent.types.update_pentest_input.UpdatePentestInput = {
        "pentest_id": pentest_id,
        "agent_space_id": agent_space_id,
    }
    if title is not None:
        input_["title"] = title
    if assets is not None:
        input_["assets"] = assets
    if exclude_risk_types is not None:
        input_["exclude_risk_types"] = exclude_risk_types
    if service_role is not None:
        input_["service_role"] = service_role
    if log_config is not None:
        input_["log_config"] = log_config
    if vpc_config is not None:
        input_["vpc_config"] = vpc_config
    if network_traffic_config is not None:
        input_["network_traffic_config"] = network_traffic_config
    if code_remediation_strategy is not None:
        input_["code_remediation_strategy"] = code_remediation_strategy
    if disable_managed_skills is not None:
        input_["disable_managed_skills"] = disable_managed_skills
    if max_task_hours is not None:
        input_["max_task_hours"] = max_task_hours
    if report_destination is not None:
        input_["report_destination"] = report_destination
    if report_filters is not None:
        input_["report_filters"] = report_filters
    if cicd_configuration is not None:
        input_["cicd_configuration"] = cicd_configuration
    if test_scope is not None:
        input_["test_scope"] = test_scope

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output