Skip to content

Feat ipynb validator - #125

Merged
mpekatsoula merged 2 commits into
arm:mainfrom
dartanghan:feat_ipnb_validator
Aug 4, 2026
Merged

Feat ipynb validator#125
mpekatsoula merged 2 commits into
arm:mainfrom
dartanghan:feat_ipnb_validator

Conversation

@dartanghan

@dartanghan dartanghan commented Dec 19, 2025

Copy link
Copy Markdown
Contributor

Added a feature to scan .ipynb (jupyter notebook) files, able to read SQL and PYTHON cells.
This will be very useful for data engineers that want their data products validated.

  • Added .ipynb in the README.doc
  • Added ipynb in pyproject.toml
  • Created ipynb_plugin.py
  • Added rules in plugins.yaml

Sample code:

%sql
SET password := "secret"
SELECT :password
%python

@dlt.table
def filtered_taxis():
    password="SQLSERVER"
    username="SQLUSER"
    print("username: ", username)
    print("password: ", password)

Sample result:

File: notebook.ipynb
 Identified issue 1: Hardcoded SQL password in notebook
    Snippet: %sql
SET password := "secret"
SELECT :password
    Line number: 62
    CWE: CWE-798
    Severity: High
...

File: dlt_pipeline.ipynb
 Identified issue 1: Hardcoded credentials in code
    Snippet: password="SQLSERVER"
    username="SQLUSER"
    Line number: 64
    CWE: CWE-798
    Severity: High
...

We can also detect leaked info in metadata

Snippet: 87:   "language_info": {
88:    "name": "python",
89:    "version": "3.11.4",
90:    "password": "hidden in metadata"
91:   }
    CWE: CWE-532
    Severity: Medium
    Why: A metadata field named `password` is present in the notebook metadata. Even though the value is masked, including a password field in metadata can lead to accidental disclosure if the 
actual secret is stored.
    Mitigation: Remove any metadata fields containing sensitive information. Use external secret stores and avoid embedding secrets or secret labels in notebook metadata.
    Confidence: 0.8

@dartanghan

Copy link
Copy Markdown
Contributor Author

Hi @mpekatsoula @aaronjb !
Should I fix/adjust anything on the code or do you think that notebook scan aren't aligned with the tool's purpose?
I will be glad to fix or adapt this PR :)

Tnx

@mpekatsoula

Copy link
Copy Markdown
Contributor

@dartanghan feel free to resolve conflicts/update the plugin and we're happy to merge

@dartanghan
dartanghan force-pushed the feat_ipnb_validator branch from 1dad44b to a7aaf4a Compare August 4, 2026 18:49
Comment thread src/metis/plugins/plugins.yaml Outdated

Your tasks are:
1. Security Review Scope
- Review the security implications of the FILE_CHANGES, focusing on lines marked with "+." or "-" but take into account how they interact with the whole file.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

"+"

Comment thread src/metis/plugins/plugins.yaml Outdated
chunk_lines: 40
chunk_lines_overlap: 15
max_chars: 1500
prompts:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does it make sense to reuse the python prompts here?

@mpekatsoula
mpekatsoula merged commit 41b395c into arm:main Aug 4, 2026
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