Skip to content

Commit

Permalink
fix: update snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
cfabianski committed Feb 20, 2024
1 parent 9fbf424 commit f5312da
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 20 deletions.
4 changes: 2 additions & 2 deletions internal/report/output/privacy/.snapshots/TestAddReportData
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
CriticalRiskFindingCount: (int) 0,
HighRiskFindingCount: (int) 0,
MediumRiskFindingCount: (int) 0,
LowRiskFindingCount: (int) 1,
LowRiskFindingCount: (int) 0,
RulesPassedCount: (int) 0
},
(types.Subject) {
Expand All @@ -31,7 +31,7 @@
CriticalRiskFindingCount: (int) 0,
HighRiskFindingCount: (int) 0,
MediumRiskFindingCount: (int) 0,
LowRiskFindingCount: (int) 1,
LowRiskFindingCount: (int) 0,
RulesPassedCount: (int) 0
}
}
Expand Down
4 changes: 2 additions & 2 deletions internal/report/output/privacy/.snapshots/TestBuildCsvString
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@

Subject,Data Types,Detection Count,Critical Risk Finding,High Risk Finding,Medium Risk Finding,Low Risk Finding,Rules Passed
User,Email Address,1,0,0,0,1,0
User,Email Address,1,0,0,0,0,0
Unknown,Country,1,0,0,0,0,1

Third Party,Subject,Data Types,Critical Risk Finding,High Risk Finding,Medium Risk Finding,Low Risk Finding,Rules Passed
Sentry,User,"Email Address",0,0,0,1,0
Sentry,User,"Email Address",0,0,0,0,0

6 changes: 3 additions & 3 deletions internal/report/output/security/.snapshots/TestAddReportData
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
(map[string][]types.Finding) (len=2) {
(string) (len=3) "low": ([]types.Finding) (len=1) {
(string) (len=8) "critical": ([]types.Finding) (len=1) {
(types.Finding) {
Rule: (*types.Rule)({
CWEIDs: ([]string) (len=2) {
Expand Down Expand Up @@ -53,13 +53,13 @@
RawCodeExtract: ([]file.Line) {
},
SeverityMeta: (types.SeverityMeta) {
RuleSeverity: (string) (len=3) "low",
RuleSeverity: (string) (len=8) "critical",
SensitiveDataCategories: ([]string) <nil>,
HasLocalDataTypes: (*bool)(<nil>),
SensitiveDataCategoryWeighting: (int) 0,
RuleSeverityWeighting: (int) 0,
FinalWeighting: (int) 0,
DisplaySeverity: (string) (len=3) "low"
DisplaySeverity: (string) (len=8) "critical"
}
}
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,66 @@
(map[string][]types.Finding) {
(map[string][]types.Finding) (len=1) {
(string) (len=8) "critical": ([]types.Finding) (len=1) {
(types.Finding) {
Rule: (*types.Rule)({
CWEIDs: ([]string) (len=2) {
(string) (len=3) "209",
(string) (len=3) "532"
},
Id: (string) (len=17) "ruby_rails_logger",
Title: (string) (len=46) "Sensitive data sent to Rails loggers detected.",
Description: (string) (len=608) "## Description\nLeaking sensitive data to loggers is a common cause of data leaks and can lead to data breaches. This rule looks for instances of sensitive data sent to rails loggers.\n\n## Remediations\n❌ Avoid using sensitive data in logger messages:\n\n```ruby\nRails.logger.info('User is: #{user.email}')\n```\n\n✅ If you need to identify a user, ensure to use their unique identifier instead of their personal identifiable information:\n\n```ruby\nRails.logger.info('User is: #{user.uuid}')\n```\n\n## Resources\n- [OWASP logging cheat sheet](https://cheatsheetseries.owasp.org/cheatsheets/Logging_Cheat_Sheet.html)\n",
DocumentationUrl: (string) (len=57) "https://docs.bearer.com/reference/rules/ruby_rails_logger"
}),
LineNumber: (int) 1,
FullFilename: (string) "",
Filename: (string) (len=20) "pkg/datatype_leak.rb",
DataType: (*types.DataType)({
CategoryUUID: (string) (len=36) "35b94efa-9b67-49b2-abb9-29b6a759a030",
Name: (string) (len=14) "Biometric Data"
}),
CategoryGroups: ([]string) (len=3) {
(string) (len=3) "PII",
(string) (len=13) "Personal Data",
(string) (len=25) "Personal Data (Sensitive)"
},
Source: (types.Source) {
Location: (*types.Location)({
Start: (int) 1,
End: (int) 0,
Column: (types.Column) {
Start: (int) 0,
End: (int) 0
}
})
},
Sink: (types.Sink) {
Location: (*types.Location)({
Start: (int) 1,
End: (int) 2,
Column: (types.Column) {
Start: (int) 10,
End: (int) 28
}
}),
Content: (string) (len=38) "Rails.logger.info(user.biometric_data)"
},
ParentLineNumber: (int) 1,
ParentContent: (string) (len=38) "Rails.logger.info(user.biometric_data)",
Fingerprint: (string) (len=34) "375d7c2e9977cf2ce5dbf04b04237bea_0",
OldFingerprint: (string) (len=34) "80ce0185374c0975a9b2a71e9d11a4f0_0",
DetailedContext: (string) "",
CodeExtract: (string) "",
RawCodeExtract: ([]file.Line) {
},
SeverityMeta: (types.SeverityMeta) {
RuleSeverity: (string) (len=8) "critical",
SensitiveDataCategories: ([]string) <nil>,
HasLocalDataTypes: (*bool)(<nil>),
SensitiveDataCategoryWeighting: (int) 0,
RuleSeverityWeighting: (int) 0,
FinalWeighting: (int) 0,
DisplaySeverity: (string) (len=8) "critical"
}
}
}
}
20 changes: 10 additions & 10 deletions internal/report/output/security/.snapshots/TestBuildReportString
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,29 @@ https://docs.bearer.com/reference/rules [TEST]
Language Default Rules Custom Rules Files


MEDIUM: Missing SSL certificate verification detected. [CWE-295]
https://docs.bearer.com/reference/rules/ruby_lang_ssl_verification
To ignore this finding, run: bearer ignore add 9005ef3db844b32c1a0317e032f4a16a_0
CRITICAL: Sensitive data sent to Rails loggers detected. [CWE-209, CWE-532]
https://docs.bearer.com/reference/rules/ruby_rails_logger
To ignore this finding, run: bearer ignore add 375d7c2e9977cf2ce5dbf04b04237bea_0

File: :2
File: :1



LOW: Sensitive data sent to Rails loggers detected. [CWE-209, CWE-532]
https://docs.bearer.com/reference/rules/ruby_rails_logger
To ignore this finding, run: bearer ignore add 375d7c2e9977cf2ce5dbf04b04237bea_0
MEDIUM: Missing SSL certificate verification detected. [CWE-295]
https://docs.bearer.com/reference/rules/ruby_lang_ssl_verification
To ignore this finding, run: bearer ignore add 9005ef3db844b32c1a0317e032f4a16a_0

File: :1
File: :2


=====================================

3 checks, 2 findings

CRITICAL: 0
CRITICAL: 1 (CWE-209, CWE-532)
HIGH: 0
MEDIUM: 1 (CWE-295)
LOW: 1 (CWE-209, CWE-532)
LOW: 0
WARNING: 0

Need help or want to discuss the output? Join the Community https://discord.gg/eaHZBJUXRF
Expand Down
Loading

0 comments on commit f5312da

Please sign in to comment.