Git Product home page Git Product logo

boc-effective's Introduction

boc-effective's People

Contributors

dependabot[bot] avatar rowanu avatar viveksupe avatar

Watchers

 avatar  avatar  avatar

boc-effective's Issues

Do not include resources that have no valid actions associated

This policy results in a report that includes ``, but it has no actions:

{
  "Statement": [
    {
      "Action": [
        "logs:*"
      ],
      "Effect": "Allow",
      "Resource": "arn:aws:logs:*:*:*"
    },
    {
      "Action": [
        "logs:*"
      ],
      "Effect": "Deny",
      "Resource": "arn:aws:logs:*:*:*"
    },
    {
      "Action": [
        "s3:GetObject",
        "s3:PutObject"
      ],
      "Effect": "Allow",
      "Resource": "arn:aws:s3:::*"
    }
  ],
  "Version": "2012-10-17"
}```

Remove leading "." from json-schema errors

error.dataPath returned by ajv include a leading "." (which is right).

Currently, that's being jammed in the response that's displayed to the user, for example:

.Statement should NOT have fewer than 1 items

Maybe don't do that.

Lazy load policies.js

So that user doesn't need to download >200KB before seeing the website.

It should be easy to do the fetch; the biggest issue will be how this impacts testing, and how should the actions should be simulated in testing - should it just be loaded from local copy of policies.js?

Leading wildcards in actions don't work as expected

Raised via email.

Given the policy:

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "s3:*AccessPoint"
      ],
      "Resource": "*"
    }
  ]
}

Current Output:

Policy allows 8 actions on *

s3:CreateAccessPoint
s3:DeleteAccessPoint
s3:DeleteAccessPointPolicy
s3:GetAccessPoint
s3:GetAccessPointPolicy
s3:GetAccessPointPolicyStatus
s3:ListAccessPoints
s3:PutAccessPointPolicy

Expected Output:

Policy allows 3 actions on *

s3:CreateAccessPoint
s3:DeleteAccessPoint
s3:GetAccessPoint

Infrastructure

  • Site
  • Pipeline
  • Distribution
  • Origin for bucket
  • DNS record: effective.bigorange.cloud

Cannot dynamically pull in policies.js

It blocked πŸ™ƒ

From the console:

Fetching https://awspolicygen.s3.amazonaws.com/js/policies.js
boc-effective-site-bucket-cl1zushj3npr.s3-website-us-east-1.amazonaws.com/:1 Access to fetch at 'https://awspolicygen.s3.amazonaws.com/js/policies.js' from origin 'http://boc-effective-site-bucket-cl1zushj3npr.s3-website-us-east-1.amazonaws.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

And this is why you deploy ASAP πŸ™

Basic CI/CD

Create a pipeline that does CI/CD for the website.

Combine statements on the same resource

e.g. "Resource": "*"

Allow and Deny

This policy should ALLOW all actions:

{
    "Version": "2012-10-17",
    "Statement": [{
        "Sid": "DenyAllUsersNotUsingMFA",
        "Effect": "Deny",
        "NotAction": "iam:*",
        "Resource": "*",
        "Condition": {"BoolIfExists": {"aws:MultiFactorAuthPresent": "false"}}
    },{
        "Sid": "AllowIAM",
        "Effect": "Allow",
        "Action": "iam:*",
        "Resource": "*"
    }]
}

Expansion Bug

From Security Slack:

Thanks for this @Rowan Udell !  If you do s3:G* does it work for you?  I’m getting items that don’t match that and I want to make sure I’m not doing something unexpected

Instructions text

Identity-based policies

Sample policies https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_examples.html

Try the following policy to see the full list of AWS acionts - it's the AWS Administrator Access Managed Policy arn:aws:iam::aws:policy/AdministratorAccess:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "*",
            "Resource": "*"
        }
    ]
}

Something a little more real-world:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "s3:get*",
            "Resource": "*"
        }
    ]
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.