Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/1641 - Add date to the report file name and at the top of the HTML title #1643

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
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
3 changes: 2 additions & 1 deletion ScoutSuite/output/data/inc-scoutsuite/scoutsuite.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,10 @@ function getPathArray() {
* Display the account ID -- use of the generic function + templates result in the div not being at the top of the page
*/
var loadAccountId = function () {
const currentDate = new Date().toUTCString();
var element = document.getElementById('account_id')
var value = '<i class="fa fa-cloud"></i> ' + runResults['provider_name'] +
' <i class="fa fa-chevron-right"></i> ' + runResults['account_id']
' <i class="fa fa-chevron-right"></i> ' + runResults['account_id'] + ` (Report date: ${currentDate})`
if (('organization' in runResults) && (value in runResults['organization'])) {
value += ' (' + runResults['organization'][value]['Name'] + ')'
}
Expand Down
10 changes: 7 additions & 3 deletions ScoutSuite/providers/aws/provider.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import copy
import os
import datetime

from ScoutSuite.core.console import print_error, print_exception, print_warning, print_debug
from ScoutSuite.providers.aws.services import AWSServicesConfig
Expand All @@ -9,7 +10,6 @@
from ScoutSuite.providers.base.provider import BaseProvider
from ScoutSuite.utils import manage_dictionary


class AWSProvider(BaseProvider):
"""
Implements provider for AWS
Expand Down Expand Up @@ -46,10 +46,14 @@ def get_report_name(self):
"""
Returns the name of the report using the provider's configuration
"""

x = datetime.datetime.now()

current_date_time = f"{x.year}-{x.month}-{x.day}-{x.hour}-{x.minute}"
if self.profile:
return f'aws-{self.profile}'
return f'aws-{self.profile}-{current_date_time}'
elif self.account_id:
return f'aws-{self.account_id}'
return f'aws-{self.account_id}-{current_date_time}'
else:
return 'aws'

Expand Down