Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
10 changes: 8 additions & 2 deletions fixtures/global_builtins/claude/sensitive_data_protection.rego
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,13 @@ is_sensitive_file(path) if {
}

is_sensitive_file(path) if {
lower_path := lower(path)
# Match keywords against the file name only, not the full path. Matching the
# entire path produced false positives: macOS canonicalizes /tmp and /var
# under /private, so the "private" keyword (and "auth") flagged every file
# beneath those roots. Directory-scoped secrets stay covered by the dedicated
# ssh/cloud/package/vcs clauses, which match on their full path prefixes.
segments := split(lower(path), "/")
filename := segments[count(segments) - 1]

# Files with sensitive keywords
sensitive_keywords := {
Expand All @@ -104,7 +110,7 @@ is_sensitive_file(path) if {
}

some keyword in sensitive_keywords
contains(lower_path, keyword)
contains(filename, keyword)
}

is_sensitive_file(path) if {
Expand Down
10 changes: 8 additions & 2 deletions fixtures/global_builtins/factory/sensitive_data_protection.rego
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,13 @@ is_sensitive_file(path) if {
}

is_sensitive_file(path) if {
lower_path := lower(path)
# Match keywords against the file name only, not the full path. Matching the
# entire path produced false positives: macOS canonicalizes /tmp and /var
# under /private, so the "private" keyword (and "auth") flagged every file
# beneath those roots. Directory-scoped secrets stay covered by the dedicated
# ssh/cloud/package/vcs clauses, which match on their full path prefixes.
segments := split(lower(path), "/")
filename := segments[count(segments) - 1]

# Files with sensitive keywords
sensitive_keywords := {
Expand All @@ -104,7 +110,7 @@ is_sensitive_file(path) if {
}

some keyword in sensitive_keywords
contains(lower_path, keyword)
contains(filename, keyword)
}

is_sensitive_file(path) if {
Expand Down
10 changes: 8 additions & 2 deletions fixtures/global_builtins/opencode/sensitive_data_protection.rego
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,13 @@ is_sensitive_file(path) if {
}

is_sensitive_file(path) if {
lower_path := lower(path)
# Match keywords against the file name only, not the full path. Matching the
# entire path produced false positives: macOS canonicalizes /tmp and /var
# under /private, so the "private" keyword (and "auth") flagged every file
# beneath those roots. Directory-scoped secrets stay covered by the dedicated
# ssh/cloud/package/vcs clauses, which match on their full path prefixes.
segments := split(lower(path), "/")
filename := segments[count(segments) - 1]

# Files with sensitive keywords
sensitive_keywords := {
Expand All @@ -104,7 +110,7 @@ is_sensitive_file(path) if {
}

some keyword in sensitive_keywords
contains(lower_path, keyword)
contains(filename, keyword)
}

is_sensitive_file(path) if {
Expand Down