Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions plugins/deploy-on-aws/scripts/lib/fix_icon_colors.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,21 @@

import argparse
import defusedxml.ElementTree as ET
# defusedxml.ElementTree re-exports the secure parsing helpers
# (parse, fromstring) but does NOT re-export the type aliases Element /
# ElementTree, nor the indent() pretty-printer added in Python 3.9. This
# script's annotations and pretty-print step both reach for those, so we
# pull them in from the stdlib while keeping defusedxml's parse() as the
# actual XML entry point. Filed against awslabs/agent-plugins as #154
# (Element / ElementTree) and #167 (indent).
from xml.etree.ElementTree import ( # nosec B405 # nosemgrep: python.lang.security.use-defused-xml.use-defused-xml,gitlab.bandit.B313.B314.B315.B316.B318.B319.B320.B405.B406.B407.B408.B409.B410
Element as _Element,
ElementTree as _ElementTree,
indent as _indent,

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: gitlab.bandit.B313.B314.B315.B316.B318.B319.B320.B405.B406.B407.B408.B409.B410 Error

Found use of the native Python XML libraries, which is vulnerable to XML external entity (XXE)
attacks. The Python documentation recommends the 'defusedxml' library instead. Use 'defusedxml'.
See https://github.com/tiran/defusedxml for more information.

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: python.lang.security.use-defused-xml.use-defused-xml Error

The Python documentation recommends using defusedxml instead of xml because the native Python xml library is vulnerable to XML External Entity (XXE) attacks. These attacks can leak confidential data and "XML bombs" can cause denial of service.
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
)
ET.Element = _Element # type: ignore[attr-defined]
ET.ElementTree = _ElementTree # type: ignore[attr-defined]
ET.indent = _indent # type: ignore[attr-defined]

# Broken shape names → correct shape names
SHAPE_RENAMES: dict[str, str] = {
Expand Down
15 changes: 15 additions & 0 deletions plugins/deploy-on-aws/scripts/lib/fix_nesting.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@

import argparse
import defusedxml.ElementTree as ET
# defusedxml.ElementTree re-exports the secure parsing helpers
# (parse, fromstring) but does NOT re-export the type aliases Element /
# ElementTree, nor the indent() pretty-printer added in Python 3.9. This
# script's annotations and pretty-print step both reach for those, so we
# pull them in from the stdlib while keeping defusedxml's parse() as the
# actual XML entry point. Filed against awslabs/agent-plugins as #154
# (Element / ElementTree) and #167 (indent).
from xml.etree.ElementTree import ( # nosec B405 # nosemgrep: python.lang.security.use-defused-xml.use-defused-xml,gitlab.bandit.B313.B314.B315.B316.B318.B319.B320.B405.B406.B407.B408.B409.B410
Element as _Element,
ElementTree as _ElementTree,
indent as _indent,

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: gitlab.bandit.B313.B314.B315.B316.B318.B319.B320.B405.B406.B407.B408.B409.B410 Error

Found use of the native Python XML libraries, which is vulnerable to XML external entity (XXE)
attacks. The Python documentation recommends the 'defusedxml' library instead. Use 'defusedxml'.
See https://github.com/tiran/defusedxml for more information.

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: python.lang.security.use-defused-xml.use-defused-xml Error

The Python documentation recommends using defusedxml instead of xml because the native Python xml library is vulnerable to XML External Entity (XXE) attacks. These attacks can leak confidential data and "XML bombs" can cause denial of service.
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
)
ET.Element = _Element # type: ignore[attr-defined]
ET.ElementTree = _ElementTree # type: ignore[attr-defined]
ET.indent = _indent # type: ignore[attr-defined]


def get_style_dict(style_str: str) -> dict[str, str]:
Expand Down
15 changes: 15 additions & 0 deletions plugins/deploy-on-aws/scripts/lib/fix_step_badges.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,21 @@
import math
import re
import defusedxml.ElementTree as ET
# defusedxml.ElementTree re-exports the secure parsing helpers
# (parse, fromstring) but does NOT re-export the type aliases Element /
# ElementTree, nor the indent() pretty-printer added in Python 3.9. This
# script's annotations and pretty-print step both reach for those, so we
# pull them in from the stdlib while keeping defusedxml's parse() as the
# actual XML entry point. Filed against awslabs/agent-plugins as #154
# (Element / ElementTree) and #167 (indent).
from xml.etree.ElementTree import ( # nosec B405 # nosemgrep: python.lang.security.use-defused-xml.use-defused-xml,gitlab.bandit.B313.B314.B315.B316.B318.B319.B320.B405.B406.B407.B408.B409.B410
Element as _Element,
ElementTree as _ElementTree,
indent as _indent,

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: gitlab.bandit.B313.B314.B315.B316.B318.B319.B320.B405.B406.B407.B408.B409.B410 Error

Found use of the native Python XML libraries, which is vulnerable to XML external entity (XXE)
attacks. The Python documentation recommends the 'defusedxml' library instead. Use 'defusedxml'.
See https://github.com/tiran/defusedxml for more information.

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: python.lang.security.use-defused-xml.use-defused-xml Error

The Python documentation recommends using defusedxml instead of xml because the native Python xml library is vulnerable to XML External Entity (XXE) attacks. These attacks can leak confidential data and "XML bombs" can cause denial of service.
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
)
ET.Element = _Element # type: ignore[attr-defined]
ET.ElementTree = _ElementTree # type: ignore[attr-defined]
ET.indent = _indent # type: ignore[attr-defined]
from dataclasses import dataclass


Expand Down
15 changes: 15 additions & 0 deletions plugins/deploy-on-aws/scripts/lib/post_process_drawio.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,21 @@
import os
import sys
import defusedxml.ElementTree as ET
# defusedxml.ElementTree re-exports the secure parsing helpers
# (parse, fromstring) but does NOT re-export the type aliases Element /
# ElementTree, nor the indent() pretty-printer added in Python 3.9. This
# script's annotations and pretty-print step both reach for those, so we
# pull them in from the stdlib while keeping defusedxml's parse() as the
# actual XML entry point. Filed against awslabs/agent-plugins as #154
# (Element / ElementTree) and #167 (indent).
from xml.etree.ElementTree import ( # nosec B405 # nosemgrep: python.lang.security.use-defused-xml.use-defused-xml,gitlab.bandit.B313.B314.B315.B316.B318.B319.B320.B405.B406.B407.B408.B409.B410
Element as _Element,
ElementTree as _ElementTree,
indent as _indent,

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: gitlab.bandit.B313.B314.B315.B316.B318.B319.B320.B405.B406.B407.B408.B409.B410 Error

Found use of the native Python XML libraries, which is vulnerable to XML external entity (XXE)
attacks. The Python documentation recommends the 'defusedxml' library instead. Use 'defusedxml'.
See https://github.com/tiran/defusedxml for more information.

Check failure

Code scanning / Semgrep OSS

Semgrep Finding: python.lang.security.use-defused-xml.use-defused-xml Error

The Python documentation recommends using defusedxml instead of xml because the native Python xml library is vulnerable to XML External Entity (XXE) attacks. These attacks can leak confidential data and "XML bombs" can cause denial of service.
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
Comment thread
github-advanced-security[bot] marked this conversation as resolved.
Fixed
)
ET.Element = _Element # type: ignore[attr-defined]
ET.ElementTree = _ElementTree # type: ignore[attr-defined]
ET.indent = _indent # type: ignore[attr-defined]
from pathlib import Path

MAX_FILE_SIZE = 2 * 1024 * 1024 # 2 MB
Expand Down
Loading