How to use the policyuniverse.logger function in policyuniverse

To help you get started, we’ve selected a few policyuniverse examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Netflix-Skunkworks / policyuniverse / policyuniverse / arn.py View on Github external
if acct_number_match:
            self._from_account_number(input)
            return

        aws_service_match = re.search('^(([^.]+)(.[^.]+)?)\.amazon(aws)?\.com$', input)
        if aws_service_match:
            self._from_aws_service(input, aws_service_match.group(1))
            return

        aws_service_match = re.search('^([^.]+).aws.internal$', input)
        if aws_service_match:
            self._from_aws_service(input, aws_service_match.group(1))
            return

        self.error = True
        logger.warning('ARN Could not parse [{}].'.format(input))
github Netflix-Skunkworks / policyuniverse / policyuniverse / statement.py View on Github external
def _arn_internet_accessible(self, arn_input):
        if '*' == arn_input:
            return True

        arn = ARN(arn_input)
        if arn.error:
            logger.warning('Auditor could not parse ARN {arn}.'.format(arn=arn_input))
            return '*' in arn_input

        if arn.tech == 's3':
            # S3 ARNs typically don't have account numbers.
            return False

        if not arn.account_number and not arn.service:
            logger.warning('Auditor could not parse Account Number from ARN {arn}.'.format(arn=arn_input))
            return True

        if arn.account_number == '*':
            return True

        return False
github Netflix-Skunkworks / policyuniverse / policyuniverse / statement.py View on Github external
def _arn_internet_accessible(self, arn_input):
        if '*' == arn_input:
            return True

        arn = ARN(arn_input)
        if arn.error:
            logger.warning('Auditor could not parse ARN {arn}.'.format(arn=arn_input))
            return '*' in arn_input

        if arn.tech == 's3':
            # S3 ARNs typically don't have account numbers.
            return False

        if not arn.account_number and not arn.service:
            logger.warning('Auditor could not parse Account Number from ARN {arn}.'.format(arn=arn_input))
            return True

        if arn.account_number == '*':
            return True

        return False