aws_ipv6.py 958 B

123456789101112131415161718192021222324252627
  1. from evaluator import *
  2. DESCRIPTION = "Test if the model can identify the error in an AWS Lambda code for authorizing a new network. This type of error is generally difficult to find via search."
  3. TAGS = ['explain']
  4. question = """This a code for aws lambda to authorize a new network, what is wrong with this :
  5. security_group.authorize_egress(
  6. IpPermissions=[
  7. {'IpProtocol': '-1',
  8. 'IpRanges': [{'CidrIpv6': '::/0'}]}
  9. ]
  10. )
  11. """
  12. evaluation = """
  13. Below is a software engineer's answer to a request to find an issue with the following code: <A>
  14. Does the engineer mention overly permissive IPv6 ranges? Think out loud, and then end your answer with either the string "The issue is found" or "The issue is not found".
  15. """
  16. TestAWSV6 = question >> LLMRun() >> LLMRun(evaluation, llm=EVAL_LLM) >> SubstringEvaluator("The issue is found")
  17. if __name__ == "__main__":
  18. print(run_test(TestAWSV6))