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

added source field to json and added Cy to readme #7

Merged
merged 2 commits into from
Jun 8, 2022
Merged
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 README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Short Form | Long Form | Description
## Output Example
Output domains file will be in the following format (JSON):
```json
[{"name": "domain name", "record_type": "DNS type (CNAME,A)", "record_value": "value (ip,ec2 domain name)", "is_private": "false/true"}]
[{"name": "domain name", "record_type": "DNS type (CNAME,A)", "record_value": "value (ip,ec2 domain name)", "is_private": "false/true", "source": "provider/dns management tool"}]
```

## Cloud Providers and Tools Support
Expand All @@ -102,6 +102,7 @@ Output domains file will be in the following format (JSON):
- GCP
- Digital Ocean
- Prisma® Cloud (by Palo Alto Networks)
- Cycognito (EASM product)

---
## Roadmap
Expand Down
4 changes: 3 additions & 1 deletion dcollector/providers/aws.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ def get_domains():
'name': record['Name'].rstrip('.').replace('\\052.', '').replace('*.',''),
'record_type': record['Type'],
'record_value': '',
'is_private': False
'is_private': False,
'source': 'aws'
}

if 'ResourceRecords' in record:
Expand All @@ -104,6 +105,7 @@ def get_domains():
elif domain_data['record_type'] == 'CNAME':
domain_data['is_private'] = utils.is_domain_internal(domain_data['record_value'])


domains.append(domain_data)
except Exception as error:
print('An error occurred while trying to get aws records:')
Expand Down
3 changes: 2 additions & 1 deletion dcollector/providers/cycognito.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def get_domains():
'name': asset['domain'].rstrip('.').replace('\\052.', '').replace('*.', ''),
'record_type': 'A',
'record_value': ip,
'is_private': False
'is_private': False,
'source': 'cycognito'
}
domains.append(domain_data)
return domains
Expand Down
3 changes: 2 additions & 1 deletion dcollector/providers/digitalocean.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ def get_domains():
'name': do_domain_name_normalise(r),
'record_type': r.type,
'record_value': r.data,
'is_private': False
'is_private': False,
'source': 'digitalocean'
}

if domain_data['record_type'] == 'A':
Expand Down
3 changes: 2 additions & 1 deletion dcollector/providers/gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ def get_domains():
'name': resource_record_set['name'].rstrip('.').replace('\\052.', '').replace('*.',''),
'record_type': resource_record_set['type'],
'record_value': resource_record_set['rrdatas'][0],
'is_private': False
'is_private': False,
'source': 'gcp'
}

# Check if ip or domain name is private
Expand Down
3 changes: 2 additions & 1 deletion dcollector/providers/prisma.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ def get_domains():
'name': record['name'].rstrip('.').replace('\\052.', ''),
'record_type': record['type'],
'record_value': '',
'is_private': False
'is_private': False,
'source': 'prisma'
}

if len(record['resourceRecords']):
Expand Down