Skip to content

Commit 3979ff7

Browse files
committed
Lint + brakeman ignore
1 parent 8164b08 commit 3979ff7

File tree

3 files changed

+31
-7
lines changed

3 files changed

+31
-7
lines changed

app/jobs/backup_db_rds.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# to be called from Clock
22
module BackupDbRds
33
def run
4-
logger = Logger.new(STDOUT)
4+
logger = Logger.new($stdout)
55
logger.info("Performing dump of the database.")
66

77
current_time = Time.current.strftime("%Y%m%d%H%M%S")
@@ -20,6 +20,5 @@ def run
2020

2121
logger.info("Uploading #{backup_filename}")
2222
blob_client.create_block_blob("backups", backup_filename, File.read(backup_filename))
23-
2423
end
2524
end

clock.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ module Clockwork
3434
BackupDbRds.run
3535
end
3636

37-
every(1.day, "Send reminder emails", at: "12:00", if: lambda { |_| Rails.env.production?}) do
37+
every(1.day, "Send reminder emails", at: "12:00", if: lambda { |_| Rails.env.production? }) do
3838
ReminderDeadlineJob.perform_now
3939
end
40-
4140
end

config/brakeman.ignore

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,36 @@
11
{
22
"ignored_warnings": [
3+
{
4+
"warning_type": "Command Injection",
5+
"warning_code": 14,
6+
"fingerprint": "0f98f6aeae590aca0d8eebf04dbd2dcaf4d1252822f138b4bcfe6e03455e5b4a",
7+
"check_name": "Execute",
8+
"message": "Possible command injection",
9+
"file": "app/jobs/backup_db_rds.rb",
10+
"line": 11,
11+
"link": "https://brakemanscanner.org/docs/warning_types/command_injection/",
12+
"code": "system(\"PGPASSWORD='#{ENV[\"DIAPER_DB_PASSWORD\"]}' pg_dump -Fc -v --host=#{ENV[\"DIAPER_DB_HOST\"]} --username=#{ENV[\"DIAPER_DB_USERNAME\"]} --dbname=#{ENV[\"DIAPER_DB_DATABASE\"]} -f #{\"#{Time.current.strftime(\"%Y%m%d%H%M%S\")}.rds.dump\"}\")",
13+
"render_path": null,
14+
"location": {
15+
"type": "method",
16+
"class": "BackupDbRds",
17+
"method": "run"
18+
},
19+
"user_input": "ENV[\"DIAPER_DB_PASSWORD\"]",
20+
"confidence": "Medium",
21+
"cwe_id": [
22+
77
23+
],
24+
"note": ""
25+
},
326
{
427
"warning_type": "Dynamic Render Path",
528
"warning_code": 15,
629
"fingerprint": "82ef033042422190ef49507207d51ed6ccd9593483630925baf0bf6c5e65033e",
730
"check_name": "Render",
831
"message": "Render path contains parameter value",
932
"file": "app/controllers/static_controller.rb",
10-
"line": 25,
33+
"line": 20,
1134
"link": "https://brakemanscanner.org/docs/warning_types/dynamic_render_path/",
1235
"code": "render(template => \"static/#{params[:name]}\", {})",
1336
"render_path": null,
@@ -18,6 +41,9 @@
1841
},
1942
"user_input": "params[:name]",
2043
"confidence": "Medium",
44+
"cwe_id": [
45+
22
46+
],
2147
"note": ""
2248
},
2349
{
@@ -41,6 +67,6 @@
4167
"note": ""
4268
}
4369
],
44-
"updated": "2021-04-24 20:03:05 -0700",
45-
"brakeman_version": "4.10.1"
70+
"updated": "2024-11-24 09:44:01 -0500",
71+
"brakeman_version": "6.2.1"
4672
}

0 commit comments

Comments
 (0)