capo-codeguru-security 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- capo_codeguru_security/__init__.py +74 -0
- capo_codeguru_security/_async.py +25 -0
- capo_codeguru_security/_auth/_identity.py +16 -0
- capo_codeguru_security/_auth/_providers.py +886 -0
- capo_codeguru_security/_auth/_signers.py +88 -0
- capo_codeguru_security/_auth/_sigv4.py +434 -0
- capo_codeguru_security/_auth/_zapros_handler.py +80 -0
- capo_codeguru_security/_iter.py +113 -0
- capo_codeguru_security/_operations/aws_code_guru_security/batch_get_findings.py +167 -0
- capo_codeguru_security/_operations/aws_code_guru_security/create_scan.py +183 -0
- capo_codeguru_security/_operations/aws_code_guru_security/create_upload_url.py +165 -0
- capo_codeguru_security/_operations/aws_code_guru_security/get_account_configuration.py +161 -0
- capo_codeguru_security/_operations/aws_code_guru_security/get_findings.py +191 -0
- capo_codeguru_security/_operations/aws_code_guru_security/get_metrics_summary.py +176 -0
- capo_codeguru_security/_operations/aws_code_guru_security/get_scan.py +173 -0
- capo_codeguru_security/_operations/aws_code_guru_security/list_findings_metrics.py +185 -0
- capo_codeguru_security/_operations/aws_code_guru_security/list_scans.py +167 -0
- capo_codeguru_security/_operations/aws_code_guru_security/list_tags_for_resource.py +173 -0
- capo_codeguru_security/_operations/aws_code_guru_security/tag_resource.py +173 -0
- capo_codeguru_security/_operations/aws_code_guru_security/untag_resource.py +171 -0
- capo_codeguru_security/_operations/aws_code_guru_security/update_account_configuration.py +172 -0
- capo_codeguru_security/_pagination.py +21 -0
- capo_codeguru_security/_protocol/__init__.py +1 -0
- capo_codeguru_security/_protocol/errors.py +93 -0
- capo_codeguru_security/_protocol/eventstream.py +238 -0
- capo_codeguru_security/_protocol/serialize.py +47 -0
- capo_codeguru_security/_protocol/xml.py +33 -0
- capo_codeguru_security/_rule_engine/__init__.py +0 -0
- capo_codeguru_security/_rule_engine/_aws_partition.py +160 -0
- capo_codeguru_security/_rule_engine/_endpoint_rule_set.py +137 -0
- capo_codeguru_security/_rule_engine/_endpoint_runtime.py +389 -0
- capo_codeguru_security/_services/_aws_config.py +160 -0
- capo_codeguru_security/_services/_pipeline.py +198 -0
- capo_codeguru_security/_services/async_code_guru_security.py +934 -0
- capo_codeguru_security/_services/code_guru_security.py +921 -0
- capo_codeguru_security/errors/__init__.py +33 -0
- capo_codeguru_security/errors/_base.py +94 -0
- capo_codeguru_security/errors/access_denied_exception.py +67 -0
- capo_codeguru_security/errors/conflict_exception.py +67 -0
- capo_codeguru_security/errors/internal_server_exception.py +53 -0
- capo_codeguru_security/errors/resource_not_found_exception.py +69 -0
- capo_codeguru_security/errors/throttling_exception.py +65 -0
- capo_codeguru_security/errors/validation_exception.py +98 -0
- capo_codeguru_security/py.typed +0 -0
- capo_codeguru_security/types/_prelude/blob.py +12 -0
- capo_codeguru_security/types/_prelude/timestamp.py +17 -0
- capo_codeguru_security/types/account_findings_metric.py +118 -0
- capo_codeguru_security/types/analysis_type.py +17 -0
- capo_codeguru_security/types/batch_get_findings_error.py +61 -0
- capo_codeguru_security/types/batch_get_findings_errors.py +35 -0
- capo_codeguru_security/types/batch_get_findings_request.py +47 -0
- capo_codeguru_security/types/batch_get_findings_response.py +61 -0
- capo_codeguru_security/types/categories_with_most_findings.py +37 -0
- capo_codeguru_security/types/category_with_finding_num.py +29 -0
- capo_codeguru_security/types/client_token.py +5 -0
- capo_codeguru_security/types/code_line.py +29 -0
- capo_codeguru_security/types/code_snippet.py +29 -0
- capo_codeguru_security/types/create_scan_request.py +101 -0
- capo_codeguru_security/types/create_scan_response.py +78 -0
- capo_codeguru_security/types/create_upload_url_request.py +31 -0
- capo_codeguru_security/types/create_upload_url_response.py +59 -0
- capo_codeguru_security/types/detector_tags.py +14 -0
- capo_codeguru_security/types/encryption_config.py +28 -0
- capo_codeguru_security/types/error_code.py +20 -0
- capo_codeguru_security/types/error_message.py +5 -0
- capo_codeguru_security/types/file_path.py +62 -0
- capo_codeguru_security/types/finding.py +207 -0
- capo_codeguru_security/types/finding_identifier.py +33 -0
- capo_codeguru_security/types/finding_identifiers.py +33 -0
- capo_codeguru_security/types/finding_metrics_value_per_severity.py +87 -0
- capo_codeguru_security/types/findings.py +29 -0
- capo_codeguru_security/types/findings_metric_list.py +35 -0
- capo_codeguru_security/types/get_account_configuration_request.py +18 -0
- capo_codeguru_security/types/get_account_configuration_response.py +45 -0
- capo_codeguru_security/types/get_findings_request.py +32 -0
- capo_codeguru_security/types/get_findings_response.py +43 -0
- capo_codeguru_security/types/get_metrics_summary_request.py +24 -0
- capo_codeguru_security/types/get_metrics_summary_response.py +42 -0
- capo_codeguru_security/types/get_scan_request.py +27 -0
- capo_codeguru_security/types/get_scan_response.py +132 -0
- capo_codeguru_security/types/header_key.py +5 -0
- capo_codeguru_security/types/header_value.py +5 -0
- capo_codeguru_security/types/kms_key_arn.py +5 -0
- capo_codeguru_security/types/list_findings_metrics_request.py +32 -0
- capo_codeguru_security/types/list_findings_metrics_response.py +49 -0
- capo_codeguru_security/types/list_scans_request.py +26 -0
- capo_codeguru_security/types/list_scans_response.py +43 -0
- capo_codeguru_security/types/list_tags_for_resource_request.py +24 -0
- capo_codeguru_security/types/list_tags_for_resource_response.py +34 -0
- capo_codeguru_security/types/metrics_summary.py +121 -0
- capo_codeguru_security/types/next_token.py +5 -0
- capo_codeguru_security/types/recommendation.py +29 -0
- capo_codeguru_security/types/reference_urls.py +14 -0
- capo_codeguru_security/types/related_vulnerabilities.py +14 -0
- capo_codeguru_security/types/remediation.py +63 -0
- capo_codeguru_security/types/request_header_map.py +29 -0
- capo_codeguru_security/types/resource.py +29 -0
- capo_codeguru_security/types/resource_id.py +32 -0
- capo_codeguru_security/types/s3_url.py +5 -0
- capo_codeguru_security/types/scan_name.py +5 -0
- capo_codeguru_security/types/scan_name_arn.py +5 -0
- capo_codeguru_security/types/scan_name_with_finding_num.py +29 -0
- capo_codeguru_security/types/scan_state.py +18 -0
- capo_codeguru_security/types/scan_summaries.py +29 -0
- capo_codeguru_security/types/scan_summary.py +99 -0
- capo_codeguru_security/types/scan_type.py +17 -0
- capo_codeguru_security/types/scans_with_most_open_critical_findings.py +37 -0
- capo_codeguru_security/types/scans_with_most_open_findings.py +37 -0
- capo_codeguru_security/types/severity.py +20 -0
- capo_codeguru_security/types/status.py +18 -0
- capo_codeguru_security/types/suggested_fix.py +29 -0
- capo_codeguru_security/types/suggested_fixes.py +31 -0
- capo_codeguru_security/types/tag_key.py +5 -0
- capo_codeguru_security/types/tag_key_list.py +17 -0
- capo_codeguru_security/types/tag_map.py +29 -0
- capo_codeguru_security/types/tag_resource_request.py +40 -0
- capo_codeguru_security/types/tag_resource_response.py +18 -0
- capo_codeguru_security/types/tag_value.py +5 -0
- capo_codeguru_security/types/untag_resource_request.py +27 -0
- capo_codeguru_security/types/untag_resource_response.py +18 -0
- capo_codeguru_security/types/update_account_configuration_request.py +45 -0
- capo_codeguru_security/types/update_account_configuration_response.py +45 -0
- capo_codeguru_security/types/uuid.py +5 -0
- capo_codeguru_security/types/validation_exception_field.py +33 -0
- capo_codeguru_security/types/validation_exception_field_list.py +37 -0
- capo_codeguru_security/types/validation_exception_reason.py +20 -0
- capo_codeguru_security/types/vulnerability.py +90 -0
- capo_codeguru_security-0.1.0.dist-info/METADATA +101 -0
- capo_codeguru_security-0.1.0.dist-info/RECORD +132 -0
- capo_codeguru_security-0.1.0.dist-info/WHEEL +5 -0
- capo_codeguru_security-0.1.0.dist-info/licenses/LICENSE +21 -0
- capo_codeguru_security-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.codegurusecurity#AccountFindingsMetric``."""
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
from typing_extensions import NotRequired, TypedDict
|
|
6
|
+
|
|
7
|
+
if TYPE_CHECKING:
|
|
8
|
+
import datetime
|
|
9
|
+
|
|
10
|
+
import capo_codeguru_security.types.finding_metrics_value_per_severity
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class AccountFindingsMetric(TypedDict, closed=True):
|
|
14
|
+
date: NotRequired["datetime.datetime"]
|
|
15
|
+
"""<p>The date from which the findings metrics were retrieved.</p>"""
|
|
16
|
+
new_findings: NotRequired[
|
|
17
|
+
"capo_codeguru_security.types.finding_metrics_value_per_severity.FindingMetricsValuePerSeverity"
|
|
18
|
+
]
|
|
19
|
+
"""<p>The number of new findings of each severity on the specified date.</p>"""
|
|
20
|
+
closed_findings: NotRequired[
|
|
21
|
+
"capo_codeguru_security.types.finding_metrics_value_per_severity.FindingMetricsValuePerSeverity"
|
|
22
|
+
]
|
|
23
|
+
"""<p>The number of closed findings of each severity on the specified date.</p>"""
|
|
24
|
+
open_findings: NotRequired[
|
|
25
|
+
"capo_codeguru_security.types.finding_metrics_value_per_severity.FindingMetricsValuePerSeverity"
|
|
26
|
+
]
|
|
27
|
+
"""<p>The number of open findings of each severity as of the specified date.</p>"""
|
|
28
|
+
mean_time_to_close: NotRequired[
|
|
29
|
+
"capo_codeguru_security.types.finding_metrics_value_per_severity.FindingMetricsValuePerSeverity"
|
|
30
|
+
]
|
|
31
|
+
"""<p>The average time in days it takes to close findings of each severity as of a specified date.</p>"""
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
# --- restJson1 ser/de ---
|
|
35
|
+
def serialize_json(value: AccountFindingsMetric) -> dict:
|
|
36
|
+
out: dict = {}
|
|
37
|
+
if "date" in value:
|
|
38
|
+
import capo_codeguru_security.types._prelude.timestamp
|
|
39
|
+
|
|
40
|
+
out["date"] = capo_codeguru_security.types._prelude.timestamp.serialize_json(
|
|
41
|
+
value["date"]
|
|
42
|
+
)
|
|
43
|
+
if "new_findings" in value:
|
|
44
|
+
import capo_codeguru_security.types.finding_metrics_value_per_severity
|
|
45
|
+
|
|
46
|
+
out["newFindings"] = (
|
|
47
|
+
capo_codeguru_security.types.finding_metrics_value_per_severity.serialize_json(
|
|
48
|
+
value["new_findings"]
|
|
49
|
+
)
|
|
50
|
+
)
|
|
51
|
+
if "closed_findings" in value:
|
|
52
|
+
import capo_codeguru_security.types.finding_metrics_value_per_severity
|
|
53
|
+
|
|
54
|
+
out["closedFindings"] = (
|
|
55
|
+
capo_codeguru_security.types.finding_metrics_value_per_severity.serialize_json(
|
|
56
|
+
value["closed_findings"]
|
|
57
|
+
)
|
|
58
|
+
)
|
|
59
|
+
if "open_findings" in value:
|
|
60
|
+
import capo_codeguru_security.types.finding_metrics_value_per_severity
|
|
61
|
+
|
|
62
|
+
out["openFindings"] = (
|
|
63
|
+
capo_codeguru_security.types.finding_metrics_value_per_severity.serialize_json(
|
|
64
|
+
value["open_findings"]
|
|
65
|
+
)
|
|
66
|
+
)
|
|
67
|
+
if "mean_time_to_close" in value:
|
|
68
|
+
import capo_codeguru_security.types.finding_metrics_value_per_severity
|
|
69
|
+
|
|
70
|
+
out["meanTimeToClose"] = (
|
|
71
|
+
capo_codeguru_security.types.finding_metrics_value_per_severity.serialize_json(
|
|
72
|
+
value["mean_time_to_close"]
|
|
73
|
+
)
|
|
74
|
+
)
|
|
75
|
+
return out
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
def deserialize_json(data: dict) -> AccountFindingsMetric:
|
|
79
|
+
out: AccountFindingsMetric = {} # type: ignore[typeddict-item]
|
|
80
|
+
if data.get("date") is not None:
|
|
81
|
+
import capo_codeguru_security.types._prelude.timestamp
|
|
82
|
+
|
|
83
|
+
out["date"] = capo_codeguru_security.types._prelude.timestamp.deserialize_json(
|
|
84
|
+
data["date"]
|
|
85
|
+
)
|
|
86
|
+
if data.get("newFindings") is not None:
|
|
87
|
+
import capo_codeguru_security.types.finding_metrics_value_per_severity
|
|
88
|
+
|
|
89
|
+
out["new_findings"] = (
|
|
90
|
+
capo_codeguru_security.types.finding_metrics_value_per_severity.deserialize_json(
|
|
91
|
+
data["newFindings"]
|
|
92
|
+
)
|
|
93
|
+
)
|
|
94
|
+
if data.get("closedFindings") is not None:
|
|
95
|
+
import capo_codeguru_security.types.finding_metrics_value_per_severity
|
|
96
|
+
|
|
97
|
+
out["closed_findings"] = (
|
|
98
|
+
capo_codeguru_security.types.finding_metrics_value_per_severity.deserialize_json(
|
|
99
|
+
data["closedFindings"]
|
|
100
|
+
)
|
|
101
|
+
)
|
|
102
|
+
if data.get("openFindings") is not None:
|
|
103
|
+
import capo_codeguru_security.types.finding_metrics_value_per_severity
|
|
104
|
+
|
|
105
|
+
out["open_findings"] = (
|
|
106
|
+
capo_codeguru_security.types.finding_metrics_value_per_severity.deserialize_json(
|
|
107
|
+
data["openFindings"]
|
|
108
|
+
)
|
|
109
|
+
)
|
|
110
|
+
if data.get("meanTimeToClose") is not None:
|
|
111
|
+
import capo_codeguru_security.types.finding_metrics_value_per_severity
|
|
112
|
+
|
|
113
|
+
out["mean_time_to_close"] = (
|
|
114
|
+
capo_codeguru_security.types.finding_metrics_value_per_severity.deserialize_json(
|
|
115
|
+
data["meanTimeToClose"]
|
|
116
|
+
)
|
|
117
|
+
)
|
|
118
|
+
return out
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.codegurusecurity#AnalysisType``."""
|
|
2
|
+
|
|
3
|
+
from typing import Literal, TypeAlias, cast
|
|
4
|
+
|
|
5
|
+
AnalysisType: TypeAlias = Literal[
|
|
6
|
+
"Security",
|
|
7
|
+
"All",
|
|
8
|
+
]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# --- restJson1 ser/de ---
|
|
12
|
+
def serialize_json(value: AnalysisType) -> str:
|
|
13
|
+
return value
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def deserialize_json(data: str) -> AnalysisType:
|
|
17
|
+
return cast(AnalysisType, data)
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.codegurusecurity#BatchGetFindingsError``."""
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
from typing_extensions import TypedDict
|
|
6
|
+
|
|
7
|
+
from capo_codeguru_security.errors import DeserializationError
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
import capo_codeguru_security.types.error_code
|
|
11
|
+
import capo_codeguru_security.types.scan_name
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class BatchGetFindingsError(TypedDict, closed=True):
|
|
15
|
+
scan_name: "capo_codeguru_security.types.scan_name.ScanName"
|
|
16
|
+
"""<p>The name of the scan that generated the finding.</p>"""
|
|
17
|
+
finding_id: "str"
|
|
18
|
+
"""<p>The finding ID of the finding that was not fetched.</p>"""
|
|
19
|
+
error_code: "capo_codeguru_security.types.error_code.ErrorCode"
|
|
20
|
+
"""<p>A code associated with the type of error.</p>"""
|
|
21
|
+
message: "str"
|
|
22
|
+
"""<p>Describes the error.</p>"""
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# --- restJson1 ser/de ---
|
|
26
|
+
def serialize_json(value: BatchGetFindingsError) -> dict:
|
|
27
|
+
out: dict = {}
|
|
28
|
+
out["scanName"] = value["scan_name"]
|
|
29
|
+
out["findingId"] = value["finding_id"]
|
|
30
|
+
import capo_codeguru_security.types.error_code
|
|
31
|
+
|
|
32
|
+
out["errorCode"] = capo_codeguru_security.types.error_code.serialize_json(
|
|
33
|
+
value["error_code"]
|
|
34
|
+
)
|
|
35
|
+
out["message"] = value["message"]
|
|
36
|
+
return out
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def deserialize_json(data: dict) -> BatchGetFindingsError:
|
|
40
|
+
out: BatchGetFindingsError = {} # type: ignore[typeddict-item]
|
|
41
|
+
if data.get("scanName") is not None:
|
|
42
|
+
out["scan_name"] = data["scanName"]
|
|
43
|
+
else:
|
|
44
|
+
raise DeserializationError("BatchGetFindingsError.scan_name required")
|
|
45
|
+
if data.get("findingId") is not None:
|
|
46
|
+
out["finding_id"] = data["findingId"]
|
|
47
|
+
else:
|
|
48
|
+
raise DeserializationError("BatchGetFindingsError.finding_id required")
|
|
49
|
+
if data.get("errorCode") is not None:
|
|
50
|
+
import capo_codeguru_security.types.error_code
|
|
51
|
+
|
|
52
|
+
out["error_code"] = capo_codeguru_security.types.error_code.deserialize_json(
|
|
53
|
+
data["errorCode"]
|
|
54
|
+
)
|
|
55
|
+
else:
|
|
56
|
+
raise DeserializationError("BatchGetFindingsError.error_code required")
|
|
57
|
+
if data.get("message") is not None:
|
|
58
|
+
out["message"] = data["message"]
|
|
59
|
+
else:
|
|
60
|
+
raise DeserializationError("BatchGetFindingsError.message required")
|
|
61
|
+
return out
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.codegurusecurity#BatchGetFindingsErrors``."""
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING, TypeAlias
|
|
4
|
+
|
|
5
|
+
if TYPE_CHECKING:
|
|
6
|
+
import capo_codeguru_security.types.batch_get_findings_error
|
|
7
|
+
|
|
8
|
+
BatchGetFindingsErrors: TypeAlias = list[
|
|
9
|
+
"capo_codeguru_security.types.batch_get_findings_error.BatchGetFindingsError"
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# --- restJson1 ser/de ---
|
|
14
|
+
def serialize_json(value: BatchGetFindingsErrors) -> list:
|
|
15
|
+
import capo_codeguru_security.types.batch_get_findings_error
|
|
16
|
+
|
|
17
|
+
out: list = []
|
|
18
|
+
for item in value:
|
|
19
|
+
out.append(
|
|
20
|
+
capo_codeguru_security.types.batch_get_findings_error.serialize_json(item)
|
|
21
|
+
)
|
|
22
|
+
return out
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def deserialize_json(data: list) -> BatchGetFindingsErrors:
|
|
26
|
+
import capo_codeguru_security.types.batch_get_findings_error
|
|
27
|
+
|
|
28
|
+
out: BatchGetFindingsErrors = []
|
|
29
|
+
for item in data:
|
|
30
|
+
if item is None:
|
|
31
|
+
continue
|
|
32
|
+
out.append(
|
|
33
|
+
capo_codeguru_security.types.batch_get_findings_error.deserialize_json(item)
|
|
34
|
+
)
|
|
35
|
+
return out
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.codegurusecurity#BatchGetFindingsRequest``."""
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
from typing_extensions import TypedDict
|
|
6
|
+
|
|
7
|
+
from capo_codeguru_security.errors import DeserializationError
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
import capo_codeguru_security.types.finding_identifiers
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class BatchGetFindingsRequest(TypedDict, closed=True):
|
|
14
|
+
finding_identifiers: (
|
|
15
|
+
"capo_codeguru_security.types.finding_identifiers.FindingIdentifiers"
|
|
16
|
+
)
|
|
17
|
+
"""<p>A list of finding identifiers. Each identifier consists of a <code>scanName</code> and a <code>findingId</code>. You retrieve the <code>findingId</code> when you call <code>GetFindings</code>.</p>"""
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
# --- restJson1 ser/de ---
|
|
21
|
+
def serialize_json(value: BatchGetFindingsRequest) -> dict:
|
|
22
|
+
out: dict = {}
|
|
23
|
+
import capo_codeguru_security.types.finding_identifiers
|
|
24
|
+
|
|
25
|
+
out["findingIdentifiers"] = (
|
|
26
|
+
capo_codeguru_security.types.finding_identifiers.serialize_json(
|
|
27
|
+
value["finding_identifiers"]
|
|
28
|
+
)
|
|
29
|
+
)
|
|
30
|
+
return out
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def deserialize_json(data: dict) -> BatchGetFindingsRequest:
|
|
34
|
+
out: BatchGetFindingsRequest = {} # type: ignore[typeddict-item]
|
|
35
|
+
if data.get("findingIdentifiers") is not None:
|
|
36
|
+
import capo_codeguru_security.types.finding_identifiers
|
|
37
|
+
|
|
38
|
+
out["finding_identifiers"] = (
|
|
39
|
+
capo_codeguru_security.types.finding_identifiers.deserialize_json(
|
|
40
|
+
data["findingIdentifiers"]
|
|
41
|
+
)
|
|
42
|
+
)
|
|
43
|
+
else:
|
|
44
|
+
raise DeserializationError(
|
|
45
|
+
"BatchGetFindingsRequest.finding_identifiers required"
|
|
46
|
+
)
|
|
47
|
+
return out
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.codegurusecurity#BatchGetFindingsResponse``."""
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
from typing_extensions import TypedDict
|
|
6
|
+
|
|
7
|
+
from capo_codeguru_security.errors import DeserializationError
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
import capo_codeguru_security.types.batch_get_findings_errors
|
|
11
|
+
import capo_codeguru_security.types.findings
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class BatchGetFindingsResponse(TypedDict, closed=True):
|
|
15
|
+
findings: "capo_codeguru_security.types.findings.Findings"
|
|
16
|
+
"""<p> A list of all findings which were successfully fetched.</p>"""
|
|
17
|
+
failed_findings: (
|
|
18
|
+
"capo_codeguru_security.types.batch_get_findings_errors.BatchGetFindingsErrors"
|
|
19
|
+
)
|
|
20
|
+
"""<p>A list of errors for individual findings which were not fetched. Each BatchGetFindingsError contains the <code>scanName</code>, <code>findingId</code>, <code>errorCode</code> and error <code>message</code>.</p>"""
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# --- restJson1 ser/de ---
|
|
24
|
+
def serialize_json(value: BatchGetFindingsResponse) -> dict:
|
|
25
|
+
out: dict = {}
|
|
26
|
+
import capo_codeguru_security.types.findings
|
|
27
|
+
|
|
28
|
+
out["findings"] = capo_codeguru_security.types.findings.serialize_json(
|
|
29
|
+
value["findings"]
|
|
30
|
+
)
|
|
31
|
+
import capo_codeguru_security.types.batch_get_findings_errors
|
|
32
|
+
|
|
33
|
+
out["failedFindings"] = (
|
|
34
|
+
capo_codeguru_security.types.batch_get_findings_errors.serialize_json(
|
|
35
|
+
value["failed_findings"]
|
|
36
|
+
)
|
|
37
|
+
)
|
|
38
|
+
return out
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def deserialize_json(data: dict) -> BatchGetFindingsResponse:
|
|
42
|
+
out: BatchGetFindingsResponse = {} # type: ignore[typeddict-item]
|
|
43
|
+
if data.get("findings") is not None:
|
|
44
|
+
import capo_codeguru_security.types.findings
|
|
45
|
+
|
|
46
|
+
out["findings"] = capo_codeguru_security.types.findings.deserialize_json(
|
|
47
|
+
data["findings"]
|
|
48
|
+
)
|
|
49
|
+
else:
|
|
50
|
+
raise DeserializationError("BatchGetFindingsResponse.findings required")
|
|
51
|
+
if data.get("failedFindings") is not None:
|
|
52
|
+
import capo_codeguru_security.types.batch_get_findings_errors
|
|
53
|
+
|
|
54
|
+
out["failed_findings"] = (
|
|
55
|
+
capo_codeguru_security.types.batch_get_findings_errors.deserialize_json(
|
|
56
|
+
data["failedFindings"]
|
|
57
|
+
)
|
|
58
|
+
)
|
|
59
|
+
else:
|
|
60
|
+
raise DeserializationError("BatchGetFindingsResponse.failed_findings required")
|
|
61
|
+
return out
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.codegurusecurity#CategoriesWithMostFindings``."""
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING, TypeAlias
|
|
4
|
+
|
|
5
|
+
if TYPE_CHECKING:
|
|
6
|
+
import capo_codeguru_security.types.category_with_finding_num
|
|
7
|
+
|
|
8
|
+
CategoriesWithMostFindings: TypeAlias = list[
|
|
9
|
+
"capo_codeguru_security.types.category_with_finding_num.CategoryWithFindingNum"
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# --- restJson1 ser/de ---
|
|
14
|
+
def serialize_json(value: CategoriesWithMostFindings) -> list:
|
|
15
|
+
import capo_codeguru_security.types.category_with_finding_num
|
|
16
|
+
|
|
17
|
+
out: list = []
|
|
18
|
+
for item in value:
|
|
19
|
+
out.append(
|
|
20
|
+
capo_codeguru_security.types.category_with_finding_num.serialize_json(item)
|
|
21
|
+
)
|
|
22
|
+
return out
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def deserialize_json(data: list) -> CategoriesWithMostFindings:
|
|
26
|
+
import capo_codeguru_security.types.category_with_finding_num
|
|
27
|
+
|
|
28
|
+
out: CategoriesWithMostFindings = []
|
|
29
|
+
for item in data:
|
|
30
|
+
if item is None:
|
|
31
|
+
continue
|
|
32
|
+
out.append(
|
|
33
|
+
capo_codeguru_security.types.category_with_finding_num.deserialize_json(
|
|
34
|
+
item
|
|
35
|
+
)
|
|
36
|
+
)
|
|
37
|
+
return out
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.codegurusecurity#CategoryWithFindingNum``."""
|
|
2
|
+
|
|
3
|
+
from typing_extensions import NotRequired, TypedDict
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class CategoryWithFindingNum(TypedDict, closed=True):
|
|
7
|
+
category_name: NotRequired["str"]
|
|
8
|
+
"""<p>The name of the finding category. A finding category is determined by the detector that detected the finding.</p>"""
|
|
9
|
+
finding_number: NotRequired["int"]
|
|
10
|
+
"""<p>The number of open findings in the category.</p>"""
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# --- restJson1 ser/de ---
|
|
14
|
+
def serialize_json(value: CategoryWithFindingNum) -> dict:
|
|
15
|
+
out: dict = {}
|
|
16
|
+
if "category_name" in value:
|
|
17
|
+
out["categoryName"] = value["category_name"]
|
|
18
|
+
if "finding_number" in value:
|
|
19
|
+
out["findingNumber"] = value["finding_number"]
|
|
20
|
+
return out
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def deserialize_json(data: dict) -> CategoryWithFindingNum:
|
|
24
|
+
out: CategoryWithFindingNum = {} # type: ignore[typeddict-item]
|
|
25
|
+
if data.get("categoryName") is not None:
|
|
26
|
+
out["category_name"] = data["categoryName"]
|
|
27
|
+
if data.get("findingNumber") is not None:
|
|
28
|
+
out["finding_number"] = data["findingNumber"]
|
|
29
|
+
return out
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.codegurusecurity#CodeLine``."""
|
|
2
|
+
|
|
3
|
+
from typing_extensions import NotRequired, TypedDict
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class CodeLine(TypedDict, closed=True):
|
|
7
|
+
number: NotRequired["int"]
|
|
8
|
+
"""<p>The code line number.</p>"""
|
|
9
|
+
content: NotRequired["str"]
|
|
10
|
+
"""<p>The code that contains a vulnerability.</p>"""
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# --- restJson1 ser/de ---
|
|
14
|
+
def serialize_json(value: CodeLine) -> dict:
|
|
15
|
+
out: dict = {}
|
|
16
|
+
if "number" in value:
|
|
17
|
+
out["number"] = value["number"]
|
|
18
|
+
if "content" in value:
|
|
19
|
+
out["content"] = value["content"]
|
|
20
|
+
return out
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def deserialize_json(data: dict) -> CodeLine:
|
|
24
|
+
out: CodeLine = {} # type: ignore[typeddict-item]
|
|
25
|
+
if data.get("number") is not None:
|
|
26
|
+
out["number"] = data["number"]
|
|
27
|
+
if data.get("content") is not None:
|
|
28
|
+
out["content"] = data["content"]
|
|
29
|
+
return out
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.codegurusecurity#CodeSnippet``."""
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING, TypeAlias
|
|
4
|
+
|
|
5
|
+
if TYPE_CHECKING:
|
|
6
|
+
import capo_codeguru_security.types.code_line
|
|
7
|
+
|
|
8
|
+
CodeSnippet: TypeAlias = list["capo_codeguru_security.types.code_line.CodeLine"]
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# --- restJson1 ser/de ---
|
|
12
|
+
def serialize_json(value: CodeSnippet) -> list:
|
|
13
|
+
import capo_codeguru_security.types.code_line
|
|
14
|
+
|
|
15
|
+
out: list = []
|
|
16
|
+
for item in value:
|
|
17
|
+
out.append(capo_codeguru_security.types.code_line.serialize_json(item))
|
|
18
|
+
return out
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def deserialize_json(data: list) -> CodeSnippet:
|
|
22
|
+
import capo_codeguru_security.types.code_line
|
|
23
|
+
|
|
24
|
+
out: CodeSnippet = []
|
|
25
|
+
for item in data:
|
|
26
|
+
if item is None:
|
|
27
|
+
continue
|
|
28
|
+
out.append(capo_codeguru_security.types.code_line.deserialize_json(item))
|
|
29
|
+
return out
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.codegurusecurity#CreateScanRequest``."""
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
from typing_extensions import NotRequired, TypedDict
|
|
6
|
+
|
|
7
|
+
from capo_codeguru_security.errors import DeserializationError
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
import capo_codeguru_security.types.analysis_type
|
|
11
|
+
import capo_codeguru_security.types.client_token
|
|
12
|
+
import capo_codeguru_security.types.resource_id
|
|
13
|
+
import capo_codeguru_security.types.scan_name
|
|
14
|
+
import capo_codeguru_security.types.scan_type
|
|
15
|
+
import capo_codeguru_security.types.tag_map
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class CreateScanRequest(TypedDict, closed=True):
|
|
19
|
+
client_token: NotRequired["capo_codeguru_security.types.client_token.ClientToken"]
|
|
20
|
+
"""<p>The idempotency token for the request. Amazon CodeGuru Security uses this value to prevent the accidental creation of duplicate scans if there are failures and retries.</p>"""
|
|
21
|
+
resource_id: "capo_codeguru_security.types.resource_id.ResourceId"
|
|
22
|
+
"""<p>The identifier for the resource object to be scanned.</p>"""
|
|
23
|
+
scan_name: "capo_codeguru_security.types.scan_name.ScanName"
|
|
24
|
+
"""<p>The unique name that CodeGuru Security uses to track revisions across multiple scans of the same resource. Only allowed for a <code>STANDARD</code> scan type. </p>"""
|
|
25
|
+
scan_type: NotRequired["capo_codeguru_security.types.scan_type.ScanType"]
|
|
26
|
+
"""<p>The type of scan, either <code>Standard</code> or <code>Express</code>. Defaults to <code>Standard</code> type if missing.</p> <p> <code>Express</code> scans run on limited resources and use a limited set of detectors to analyze your code in near-real time. <code>Standard</code> scans have standard resource limits and use the full set of detectors to analyze your code.</p>"""
|
|
27
|
+
analysis_type: NotRequired[
|
|
28
|
+
"capo_codeguru_security.types.analysis_type.AnalysisType"
|
|
29
|
+
]
|
|
30
|
+
"""<p>The type of analysis you want CodeGuru Security to perform in the scan, either <code>Security</code> or <code>All</code>. The <code>Security</code> type only generates findings related to security. The <code>All</code> type generates both security findings and quality findings. Defaults to <code>Security</code> type if missing.</p>"""
|
|
31
|
+
tags: NotRequired["capo_codeguru_security.types.tag_map.TagMap"]
|
|
32
|
+
"""<p>An array of key-value pairs used to tag a scan. A tag is a custom attribute label with two parts:</p> <ul> <li> <p>A tag key. For example, <code>CostCenter</code>, <code>Environment</code>, or <code>Secret</code>. Tag keys are case sensitive.</p> </li> <li> <p>An optional tag value field. For example, <code>111122223333</code>, <code>Production</code>, or a team name. Omitting the tag value is the same as using an empty string. Tag values are case sensitive.</p> </li> </ul>"""
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
# --- restJson1 ser/de ---
|
|
36
|
+
def serialize_json(value: CreateScanRequest) -> dict:
|
|
37
|
+
out: dict = {}
|
|
38
|
+
if "client_token" in value:
|
|
39
|
+
out["clientToken"] = value["client_token"]
|
|
40
|
+
import capo_codeguru_security.types.resource_id
|
|
41
|
+
|
|
42
|
+
out["resourceId"] = capo_codeguru_security.types.resource_id.serialize_json(
|
|
43
|
+
value["resource_id"]
|
|
44
|
+
)
|
|
45
|
+
out["scanName"] = value["scan_name"]
|
|
46
|
+
if "scan_type" in value:
|
|
47
|
+
import capo_codeguru_security.types.scan_type
|
|
48
|
+
|
|
49
|
+
out["scanType"] = capo_codeguru_security.types.scan_type.serialize_json(
|
|
50
|
+
value["scan_type"]
|
|
51
|
+
)
|
|
52
|
+
if "analysis_type" in value:
|
|
53
|
+
import capo_codeguru_security.types.analysis_type
|
|
54
|
+
|
|
55
|
+
out["analysisType"] = capo_codeguru_security.types.analysis_type.serialize_json(
|
|
56
|
+
value["analysis_type"]
|
|
57
|
+
)
|
|
58
|
+
if "tags" in value:
|
|
59
|
+
import capo_codeguru_security.types.tag_map
|
|
60
|
+
|
|
61
|
+
out["tags"] = capo_codeguru_security.types.tag_map.serialize_json(value["tags"])
|
|
62
|
+
return out
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def deserialize_json(data: dict) -> CreateScanRequest:
|
|
66
|
+
out: CreateScanRequest = {} # type: ignore[typeddict-item]
|
|
67
|
+
if data.get("clientToken") is not None:
|
|
68
|
+
out["client_token"] = data["clientToken"]
|
|
69
|
+
if data.get("resourceId") is not None:
|
|
70
|
+
import capo_codeguru_security.types.resource_id
|
|
71
|
+
|
|
72
|
+
out["resource_id"] = capo_codeguru_security.types.resource_id.deserialize_json(
|
|
73
|
+
data["resourceId"]
|
|
74
|
+
)
|
|
75
|
+
else:
|
|
76
|
+
raise DeserializationError("CreateScanRequest.resource_id required")
|
|
77
|
+
if data.get("scanName") is not None:
|
|
78
|
+
out["scan_name"] = data["scanName"]
|
|
79
|
+
else:
|
|
80
|
+
raise DeserializationError("CreateScanRequest.scan_name required")
|
|
81
|
+
if data.get("scanType") is not None:
|
|
82
|
+
import capo_codeguru_security.types.scan_type
|
|
83
|
+
|
|
84
|
+
out["scan_type"] = capo_codeguru_security.types.scan_type.deserialize_json(
|
|
85
|
+
data["scanType"]
|
|
86
|
+
)
|
|
87
|
+
if data.get("analysisType") is not None:
|
|
88
|
+
import capo_codeguru_security.types.analysis_type
|
|
89
|
+
|
|
90
|
+
out["analysis_type"] = (
|
|
91
|
+
capo_codeguru_security.types.analysis_type.deserialize_json(
|
|
92
|
+
data["analysisType"]
|
|
93
|
+
)
|
|
94
|
+
)
|
|
95
|
+
if data.get("tags") is not None:
|
|
96
|
+
import capo_codeguru_security.types.tag_map
|
|
97
|
+
|
|
98
|
+
out["tags"] = capo_codeguru_security.types.tag_map.deserialize_json(
|
|
99
|
+
data["tags"]
|
|
100
|
+
)
|
|
101
|
+
return out
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"""Generated from Smithy shape ``com.amazonaws.codegurusecurity#CreateScanResponse``."""
|
|
2
|
+
|
|
3
|
+
from typing import TYPE_CHECKING
|
|
4
|
+
|
|
5
|
+
from typing_extensions import NotRequired, TypedDict
|
|
6
|
+
|
|
7
|
+
from capo_codeguru_security.errors import DeserializationError
|
|
8
|
+
|
|
9
|
+
if TYPE_CHECKING:
|
|
10
|
+
import capo_codeguru_security.types.resource_id
|
|
11
|
+
import capo_codeguru_security.types.scan_name
|
|
12
|
+
import capo_codeguru_security.types.scan_name_arn
|
|
13
|
+
import capo_codeguru_security.types.scan_state
|
|
14
|
+
import capo_codeguru_security.types.uuid
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class CreateScanResponse(TypedDict, closed=True):
|
|
18
|
+
scan_name: "capo_codeguru_security.types.scan_name.ScanName"
|
|
19
|
+
"""<p>The name of the scan.</p>"""
|
|
20
|
+
run_id: "capo_codeguru_security.types.uuid.Uuid"
|
|
21
|
+
"""<p>UUID that identifies the individual scan run.</p>"""
|
|
22
|
+
resource_id: "capo_codeguru_security.types.resource_id.ResourceId"
|
|
23
|
+
"""<p>The identifier for the resource object that contains resources that were scanned.</p>"""
|
|
24
|
+
scan_state: "capo_codeguru_security.types.scan_state.ScanState"
|
|
25
|
+
"""<p>The current state of the scan. Returns either <code>InProgress</code>, <code>Successful</code>, or <code>Failed</code>.</p>"""
|
|
26
|
+
scan_name_arn: NotRequired["capo_codeguru_security.types.scan_name_arn.ScanNameArn"]
|
|
27
|
+
"""<p>The ARN for the scan name.</p>"""
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# --- restJson1 ser/de ---
|
|
31
|
+
def serialize_json(value: CreateScanResponse) -> dict:
|
|
32
|
+
out: dict = {}
|
|
33
|
+
out["scanName"] = value["scan_name"]
|
|
34
|
+
out["runId"] = value["run_id"]
|
|
35
|
+
import capo_codeguru_security.types.resource_id
|
|
36
|
+
|
|
37
|
+
out["resourceId"] = capo_codeguru_security.types.resource_id.serialize_json(
|
|
38
|
+
value["resource_id"]
|
|
39
|
+
)
|
|
40
|
+
import capo_codeguru_security.types.scan_state
|
|
41
|
+
|
|
42
|
+
out["scanState"] = capo_codeguru_security.types.scan_state.serialize_json(
|
|
43
|
+
value["scan_state"]
|
|
44
|
+
)
|
|
45
|
+
if "scan_name_arn" in value:
|
|
46
|
+
out["scanNameArn"] = value["scan_name_arn"]
|
|
47
|
+
return out
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
def deserialize_json(data: dict) -> CreateScanResponse:
|
|
51
|
+
out: CreateScanResponse = {} # type: ignore[typeddict-item]
|
|
52
|
+
if data.get("scanName") is not None:
|
|
53
|
+
out["scan_name"] = data["scanName"]
|
|
54
|
+
else:
|
|
55
|
+
raise DeserializationError("CreateScanResponse.scan_name required")
|
|
56
|
+
if data.get("runId") is not None:
|
|
57
|
+
out["run_id"] = data["runId"]
|
|
58
|
+
else:
|
|
59
|
+
raise DeserializationError("CreateScanResponse.run_id required")
|
|
60
|
+
if data.get("resourceId") is not None:
|
|
61
|
+
import capo_codeguru_security.types.resource_id
|
|
62
|
+
|
|
63
|
+
out["resource_id"] = capo_codeguru_security.types.resource_id.deserialize_json(
|
|
64
|
+
data["resourceId"]
|
|
65
|
+
)
|
|
66
|
+
else:
|
|
67
|
+
raise DeserializationError("CreateScanResponse.resource_id required")
|
|
68
|
+
if data.get("scanState") is not None:
|
|
69
|
+
import capo_codeguru_security.types.scan_state
|
|
70
|
+
|
|
71
|
+
out["scan_state"] = capo_codeguru_security.types.scan_state.deserialize_json(
|
|
72
|
+
data["scanState"]
|
|
73
|
+
)
|
|
74
|
+
else:
|
|
75
|
+
raise DeserializationError("CreateScanResponse.scan_state required")
|
|
76
|
+
if data.get("scanNameArn") is not None:
|
|
77
|
+
out["scan_name_arn"] = data["scanNameArn"]
|
|
78
|
+
return out
|