Class AbstractIamPolicyStatementCheck

All Implemented Interfaces:
PythonCheck, SubscriptionCheck
Direct Known Subclasses:
IamPolicyPublicAccessCheck, IamPrivilegeEscalationCheck, PrivilegePolicyCheck, ResourceAccessPolicyCheck

public abstract class AbstractIamPolicyStatementCheck extends AbstractCdkResourceCheck
  • Constructor Details

    • AbstractIamPolicyStatementCheck

      public AbstractIamPolicyStatementCheck()
  • Method Details

    • registerFqnConsumer

      protected void registerFqnConsumer()
      Specified by:
      registerFqnConsumer in class AbstractCdkResourceCheck
    • checkPolicyStatement

      protected void checkPolicyStatement(PolicyStatement policyStatement)
    • checkPolicyStatementFromJson

      protected void checkPolicyStatementFromJson(PolicyStatement policyStatementFormJson)
    • hasAllowEffect

      protected static boolean hasAllowEffect(@Nullable org.sonar.python.checks.cdk.CdkUtils.ExpressionFlow effect)
    • checkAllowingPolicyStatement

      protected abstract void checkAllowingPolicyStatement(PolicyStatement policyStatement)
    • getDictionaryFromJson

      protected static Optional<DictionaryLiteral> getDictionaryFromJson(SubscriptionContext ctx, CallExpression call)
    • getPolicyStatements

      protected static List<DictionaryLiteral> getPolicyStatements(SubscriptionContext ctx, DictionaryLiteral json)
      Return a list of PolicyStatement json representation from a PolicyDocument.from_json call
    • getSensitiveExpression

      protected static org.sonar.python.checks.cdk.CdkUtils.ExpressionFlow getSensitiveExpression(org.sonar.python.checks.cdk.CdkUtils.ExpressionFlow expression, Predicate<Expression> predicate)