Code Monkey home page Code Monkey logo

hugo-deploy's People

Contributors

nathany avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

hugo-deploy's Issues

End-to-end encryption

Right now I'm using CloudFlare with Flexible SSL. I would like to do better, especially if I ever have any user forms on a site.

Flexible SSL: There is an encrypted connection between your website visitors and CloudFlare, but not from CloudFlare to your server.

S3 supports HTTPS, but only for subdomains without dots in them (eg. hugo-deploy but not nathany.com).

However, S3's static website hosting doesn't appear to support HTTPS.

https://hugo-deploy.s3.amazonaws.com/index.html works
https://hugo-deploy.s3-website-us-east-1.amazonaws.com doesn't resolve

Document how to configure it

It's unclear from the README where you configure the s3 bucket and AWS credentials. I assume it's via the CircleCI UI, but it would be nice to be explicit!

IAM User role for Github Actions

I stumbled across this repo and found it very useful, thank you for making this available. I do have one comment. I work a lot around AWS and I can see that when you run the hugo deploy it is using AWS credentials of a specific user. I do not know what user you are using in your example so forgive my assumptions, however its always best to follow the principle of least privilege. This is why I have created a github-build user in my AWS account with its credentials provided as secrets for my GitHub action build pipeline.

I thought you might want to know the inline policies I have for that github-build user in order to deploy the website under the least privilege rule. The below policies contain action permissions for what is required as a minimum to deploy the site and invalidate its caches in the CloudFront distribution. This enforces the github-build user to ONLY have the permissions it needs to do the build. You could add this to this repo for anyone who is interested in setting up a github-build user in order to follow security best practises as I know many people will just give the standard admin access keys to Github which is definitely not recommended.

Let me know what you think, I thought it would be handy to share as it took me a few hours to figure out what permissions it needed as a minimum as the hugo deploy code doesn't use the standard aws-sdk-go for all of its interactions with AWS which makes it hard to reverse engineer the permissions needed. :)

Here is the inline policy actions permissions:
CloudFront (for cache invalidations - ignore if you do not use)

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": "cloudfront:CreateInvalidation",
            "Resource": "[MY CLOUDFRONT DISTRIBUTION]"
        }
    ]
}

S3 (upload site to S3)

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:PutBucketPolicy",
                "s3:ListBucket",
                "s3:GetBucketPolicy"
            ],
            "Resource": [BUCKET RESOURCES]
        }
    ]
}

Ideally, you could just put the above json in one policy named GithubActionsPolicy that will contain all the permissions it needs and then just attach it to the github-build user :). That's what I will end up doing.

If you don't find this useful, feel free to close the issue, otherwise, I think it would be cool and handy for others to include. For the AWS example obviously :)

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.