AWS Auto Scaling group launch configuration has public IP address assignment enabled
This policy identifies the autoscaling group launch configuration that is configured to assign a public IP address. Auto Scaling groups assign a public IP address to the group's ec2 instances if its associated launch configuration is configured to assign a public IP address. Amazon EC2 instances should only be accessible from behind a load balancer instead of being directly exposed to the internet. It is recommended that the Amazon EC2 instances in an autoscaling group launch configuration do not have an associated public IP address except for limited edge cases.
This is applicable to aws cloud and is considered a medium severity issue.
Sample categories of findings relevant here are ['MISCONFIGURATION'].
Mitigation of this issue can be done as follows: An Auto Scaling group is associated with one launch configuration at a time. You cannot modify a launch configuration after you have created it. To change the launch configuration for an Auto Scaling group, You need to use an existing launch configuration as the basis for a new launch configuration first. Then, update the Auto Scaling group to use the new launch configuration before you delete the reported Auto Scaling group configuration.

To update the Auto Scaling group to use the new launch configuration follow the steps below:

1. Open the Amazon EC2 console.
2. On the left navigation pane, under 'Auto Scaling', choose 'Auto Scaling Groups' and Choose 'Launch configurations' near the top of the page.
3. Select the reported launch configuration and choose Actions, then click 'Copy launch configuration'. This sets up a new launch configuration with the same options as the original, but with 'Copy' added to the name.
4. On the 'Create launch configuration' page, expand 'Advanced details' under 'Additional Configuration - optional'.
5. Under the IP address type, choose 'Do not assign a public IP address to any instances'.
6. When you have finished, click on the 'Create launch configuration' button at the bottom of the page.
7. On the navigation pane, under Auto Scaling, choose Auto Scaling Groups.
8. Select the check box next to the Auto Scaling group.
9. A split pane opens up at the bottom part of the page, showing information about the group that's selected.
10. On the Details tab, click on the 'Edit' button adjacent to the 'Launch configuration' option.
11. Under the 'Launch configuration' dropdown, select the newly created launch configuration.
12. When you have finished changing your launch configuration, click on the 'Update' button at the bottom of the page.

After you change the launch configuration for an Auto Scaling group, any new instances are launched with the new configuration options. Existing instances are not affected. To update existing instances, either terminate them so that they are replaced by your Auto Scaling group or allow automatic scaling to gradually replace older instances with newer instances based on your termination policies.

To delete the reported Auto Scaling group launch configuration follow the steps below:

1. Open the Amazon EC2 console.
2. On the left navigation pane, under 'Auto Scaling', choose 'Auto Scaling Groups' and Choose 'Launch configurations' near the top of the page.
3. Select the reported launch configuration and choose Actions, then click 'Delete launch configuration'.
4. Click on the 'Delete' button to delete the autoscaling group launch configuration..

Query:
```config from cloud.resource where api.name = 'aws-ec2-autoscaling-launch-configuration' AND json.rule = associatePublicIpAddress exists and associatePublicIpAddress is true```