Skip to content

Conversation

@harshbafna
Copy link

No description provided.

"""
try:
metadata_value = requests.get("http://169.254.169.254/latest/meta-data/{0}".format(metadata_path)).text
metadata_value = requests.get("https://169.254.169.254/latest/meta-data/{0}".format(metadata_path)).text
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommendation generated by Amazon CodeGuru Reviewer. Leave feedback on this recommendation by replying to the comment or by reacting to the comment using emoji.

Do not hardcode IP addresses because they aren't always static and might change. It also makes them vulnerable to attacks like denial of service and IP spoofing to bypass security checks. We recommend that you use environment variables or configuration files to make the IP address configurable.

Learn more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants