• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

capitalone / cloud-custodian / 5425
90%

Build:
DEFAULT BRANCH: master
Ran 15 Mar 2018 08:53PM UTC
Jobs 1
Files 99
Run time 6s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
5425

push

travis-ci

kapilt
s3 - has-statement filter bug fix for multiple similar statements (#2111)

* Fix bug when multiple S3 policy stmts are similar

Stop looking for required_statements once it has been found.

This fixes a bug that caused c7n to die when `has-statement` filter was run
on an S3 bucket policy with multiple similar statements.

For example, a bucket policy like:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "StatementOne",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:PutObject",
            "Condition": {
                "StringEquals": {
                    "s3:x-amz-acl": [
                        "public-read"
                    ]
                }
            }
            "Resource": "arn:aws:s3:::my-bucket/*"
        },
        {
            "Sid": "StatementTwo",
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::111122223333:root"
            },
            "Action": "s3:PutObject",
            "Resource": "arn:aws:s3:::my-bucket/*"
        }
    ]
}

paired with an policy like:

policies:
  - name: s3-public-bucket-policy
    resource: s3
    filters:
      - type: has-statement
        statements:
          - Effect: Allow
            Action: 's3:PutObject'

caused c7n to fail with an error like:
ValueError: list.remove(x): x not in list

* Add unit test for similar S3 statements

This test fails without the fix to capitalone/cloud-custodian#2111 and
passes with it.

* Use test account number

14831 of 16524 relevant lines covered (89.75%)

0.9 hits per line

Jobs
ID Job ID Ran Files Coverage
1 5425.1 15 Mar 2018 08:53PM UTC 0
89.75
Travis Job 5425.1
Source Files on build 5425
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #5425
  • de5de1ee on github
  • Prev Build on master (#5419)
  • Next Build on master (#5429)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc