Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into dekuhn-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
dekuhn committed Mar 4, 2020
2 parents 1248dc0 + f756b9d commit 6c3b103
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 9 deletions.
16 changes: 8 additions & 8 deletions .github/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,23 @@ staleLabel: stale
limitPerRun: 1

# Configuration settings specific to pull requests
# Details: pull requests older than 30 days will become stale, after 37 days of no activity the issue is closed.
# Stale notice message will be posted to the pull request at 30 days.
# Details: pull requests older than 14 days will be marked stale. After 21 days of no activity the issue is closed.
# Stale notice message will be posted to the pull request at 14 days.
pulls:
daysUntilStale: 30
daysUntilStale: 14
daysUntilClose: 7
markComment: >
This pull request has been automatically marked as stale because it has not had
recent activity. It will be closed in 7 days if no further activity occurs. Thank you
for your contributions.
# Configuration settings specific to issues
# Details: Issues older than 5 months will become stale at 152 days. After 182 days of no activity the issue is closed.
# Stale notice message will be posted to the issue at 152 days.
# Details: Issues older than 45 days will be marked stale. After 60 days of no activity the issue is closed.
# Stale notice message will be posted to the issue at 45 days.
issues:
daysUntilStale: 152
daysUntilClose: 30
daysUntilStale: 45
daysUntilClose: 15
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed in 30 days if no further activity occurs. Thank you
recent activity. It will be closed in 15 days if no further activity occurs. Thank you
for your contributions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ def __init__(self, global_configs, scanner_configs, service_config,
# Maps CAI resource name-> (full_name, resource_data).
self.resource_lookup_table = {}

# Verify Policy Library
cv_scanner_config = {}
for scanner in self.scanner_configs.get('scanners', []):
if scanner['name'] == 'config_validator':
cv_scanner_config = scanner
break
self.verify_policy_library_enabled = (
cv_scanner_config.get('verify_policy_library', False))

def _flatten_violations(self, violations):
"""Flatten Config Validator violations into a dict for each violation.
Expand Down Expand Up @@ -187,7 +196,8 @@ def run(self):
it will be hard for Forseti to retrieve the right resource_data for the
corresponding violation types.
"""
ConfigValidatorScanner.verify_policy_library()
if self.verify_policy_library_enabled:
ConfigValidatorScanner.verify_policy_library()

# Retrieving resource violations.
for flattened_violations in self._retrieve_flattened_violations():
Expand Down

0 comments on commit 6c3b103

Please sign in to comment.