Skip to content

Rich reporting: HTML + CSV artifacts with 7 customer columns#8

Merged
levine-cycode merged 1 commit into
mainfrom
feature/rich-reporting-html-csv
Apr 23, 2026
Merged

Rich reporting: HTML + CSV artifacts with 7 customer columns#8
levine-cycode merged 1 commit into
mainfrom
feature/rich-reporting-html-csv

Conversation

@appsechq-brian
Copy link
Copy Markdown
Member

Summary

  • `scripts/cycode-summary.py` rewritten to emit Markdown (summary tab) + HTML (interactive report) + CSV (Excel export) from one JSON input
  • 7 columns per customer ask: Issue Name, Description, Where, File, Metadata, Mitigation, Console URL
  • Pipeline bundles JSON + HTML + CSV + MD into one `cycode-report` artifact

Test plan

  • YAML + Python syntax valid
  • Tested locally against a 69-finding sample; HTML filters, badges, and expandable rows render correctly
  • Deployed and verified in the `azure-pipeline-demo-adv` ADO environment

cycode-summary.py now produces three formats from one JSON input:
- Markdown for the Azure Pipelines Build Summary tab (uploadsummary)
- Self-contained HTML with severity badges, filterable table, and
  expandable description + remediation guidance
- Excel-friendly CSV with all the same data for offline analysis

Columns per customer ask: Issue Name, Description, Where (line), File,
Metadata (severity/type/CWE/OWASP/language/category), Mitigation (full
remediation_guidelines from the Cycode platform), and a Console URL
per finding (links to the policy rule page; base URL overridable via
CYCODE_CONSOLE_URL env var).

Pipeline bundles raw JSON + HTML + CSV + Markdown into one
'cycode-report' artifact.

Verified end-to-end in the azure-pipeline-demo-adv ADO environment.
Comment thread scripts/cycode-summary.py


def write_csv(rows: list[dict], path: str, base_url: str) -> None:
with open(path, "w", newline="", encoding="utf-8") as f:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cycode: SAST violation: 'Unsanitized user input in file path'.

Severity: High

Description

Unsanitized user input in file path resolution can lead to security vulnerabilities. This issue arises when an application directly uses input from the user to determine file paths or names without proper validation or sanitization. Attackers can exploit this to access unauthorized files or directories, leading to data breaches or other security compromises.

Cycode Remediation Guideline

✅ Do


  • Do use a safelist to define accessible paths or directories. Only allow user input to influence file paths within these predefined, safe boundaries.
  • Do sanitize user input used in file path resolution. For example, use absolute paths and check against the expected base directory
      BASE_DIRECTORY = '/path/to/safe/directory'
      my_path = os.path.abspath(os.path.join(BASE_DIRECTORY, user_input))
    
      if my_path.startswith(BASE_DIRECTORY):
        open(my_path)

❌ Don't


  • Do not directly use user input in file paths without sanitization. Failure to sanitize could allow attackers to manipulate file paths and to access or manipulate unauthorized files.

🎥 Learning materials (by Secure Code Warrior)


Tell us how you wish to proceed using one of the following commands:

Tag Short Description
#cycode_sast_ignore_here <reason> Ignore this violation — applies to this violation only
#cycode_ai_remediation Request remediation guidance using Cycode AI
#cycode_sast_false_positive <reason> Mark as false positive — applies to this violation only

⚠️ When commenting on Github, you may need to refresh the page to see the latest updates.

Comment thread scripts/cycode-summary.py
)
args = parser.parse_args()

with open(args.input_json) as f:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cycode: SAST violation: 'Unsanitized user input in file path'.

Severity: High

Description

Unsanitized user input in file path resolution can lead to security vulnerabilities. This issue arises when an application directly uses input from the user to determine file paths or names without proper validation or sanitization. Attackers can exploit this to access unauthorized files or directories, leading to data breaches or other security compromises.

Cycode Remediation Guideline

✅ Do


  • Do use a safelist to define accessible paths or directories. Only allow user input to influence file paths within these predefined, safe boundaries.
  • Do sanitize user input used in file path resolution. For example, use absolute paths and check against the expected base directory
      BASE_DIRECTORY = '/path/to/safe/directory'
      my_path = os.path.abspath(os.path.join(BASE_DIRECTORY, user_input))
    
      if my_path.startswith(BASE_DIRECTORY):
        open(my_path)

❌ Don't


  • Do not directly use user input in file paths without sanitization. Failure to sanitize could allow attackers to manipulate file paths and to access or manipulate unauthorized files.

🎥 Learning materials (by Secure Code Warrior)


Tell us how you wish to proceed using one of the following commands:

Tag Short Description
#cycode_sast_ignore_here <reason> Ignore this violation — applies to this violation only
#cycode_ai_remediation Request remediation guidance using Cycode AI
#cycode_sast_false_positive <reason> Mark as false positive — applies to this violation only

⚠️ When commenting on Github, you may need to refresh the page to see the latest updates.

Comment thread scripts/cycode-summary.py
print(md)

if args.html:
with open(args.html, "w", encoding="utf-8") as f:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cycode: SAST violation: 'Unsanitized user input in file path'.

Severity: High

Description

Unsanitized user input in file path resolution can lead to security vulnerabilities. This issue arises when an application directly uses input from the user to determine file paths or names without proper validation or sanitization. Attackers can exploit this to access unauthorized files or directories, leading to data breaches or other security compromises.

Cycode Remediation Guideline

✅ Do


  • Do use a safelist to define accessible paths or directories. Only allow user input to influence file paths within these predefined, safe boundaries.
  • Do sanitize user input used in file path resolution. For example, use absolute paths and check against the expected base directory
      BASE_DIRECTORY = '/path/to/safe/directory'
      my_path = os.path.abspath(os.path.join(BASE_DIRECTORY, user_input))
    
      if my_path.startswith(BASE_DIRECTORY):
        open(my_path)

❌ Don't


  • Do not directly use user input in file paths without sanitization. Failure to sanitize could allow attackers to manipulate file paths and to access or manipulate unauthorized files.

🎥 Learning materials (by Secure Code Warrior)


Tell us how you wish to proceed using one of the following commands:

Tag Short Description
#cycode_sast_ignore_here <reason> Ignore this violation — applies to this violation only
#cycode_ai_remediation Request remediation guidance using Cycode AI
#cycode_sast_false_positive <reason> Mark as false positive — applies to this violation only

⚠️ When commenting on Github, you may need to refresh the page to see the latest updates.

Comment thread scripts/cycode-summary.py

md = render_markdown(rows, args.console_url, args.artifact_hint if (args.html or args.csv) else "")
if args.md:
with open(args.md, "w", encoding="utf-8") as f:
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cycode: SAST violation: 'Unsanitized user input in file path'.

Severity: High

Description

Unsanitized user input in file path resolution can lead to security vulnerabilities. This issue arises when an application directly uses input from the user to determine file paths or names without proper validation or sanitization. Attackers can exploit this to access unauthorized files or directories, leading to data breaches or other security compromises.

Cycode Remediation Guideline

✅ Do


  • Do use a safelist to define accessible paths or directories. Only allow user input to influence file paths within these predefined, safe boundaries.
  • Do sanitize user input used in file path resolution. For example, use absolute paths and check against the expected base directory
      BASE_DIRECTORY = '/path/to/safe/directory'
      my_path = os.path.abspath(os.path.join(BASE_DIRECTORY, user_input))
    
      if my_path.startswith(BASE_DIRECTORY):
        open(my_path)

❌ Don't


  • Do not directly use user input in file paths without sanitization. Failure to sanitize could allow attackers to manipulate file paths and to access or manipulate unauthorized files.

🎥 Learning materials (by Secure Code Warrior)


Tell us how you wish to proceed using one of the following commands:

Tag Short Description
#cycode_sast_ignore_here <reason> Ignore this violation — applies to this violation only
#cycode_ai_remediation Request remediation guidance using Cycode AI
#cycode_sast_false_positive <reason> Mark as false positive — applies to this violation only

⚠️ When commenting on Github, you may need to refresh the page to see the latest updates.

@levine-cycode levine-cycode merged commit 606e9fe into main Apr 23, 2026
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants