diff --git a/util/secscan/analyzer.py b/util/secscan/analyzer.py index 28352bdea..0558ba808 100644 --- a/util/secscan/analyzer.py +++ b/util/secscan/analyzer.py @@ -113,7 +113,7 @@ class LayerAnalyzer(object): if layer_data is not None: # Dispatch events for any detected vulnerabilities logger.debug('Got data for layer %s: %s', layer.id, layer_data) - found_features = layer_data['Layer']['Features'] + found_features = layer_data['Layer'].get('Features', []) for repository_id in repository_map: tags = repository_map[repository_id] @@ -121,7 +121,7 @@ class LayerAnalyzer(object): if 'Vulnerabilities' not in feature: continue - for vulnerability in feature['Vulnerabilities']: + for vulnerability in feature.get('Vulnerabilities', []): event_data = { 'tags': [tag.name for tag in tags], 'vulnerability': {