Commit Graph

16 Commits

Author SHA1 Message Date
Bjørn Erik Pedersen dbf9514fd6 Update security.toml
Add BRANCH to env whitelist.
2021-12-17 13:22:58 +01:00
Bjørn Erik Pedersen 68554cf77c Add some basic security policies with sensible defaults
This ommmit contains some security hardening measures for the Hugo build runtime.

There are some rarely used features in Hugo that would be good to have disabled by default. One example would be the "external helpers".

For `asciidoctor` and some others we use Go's `os/exec` package to start a new process.

These are a predefined set of binary names, all loaded from `PATH` and with a predefined set of arguments. Still, if you don't use `asciidoctor` in your project, you might as well have it turned off.

You can configure your own in the new `security` configuration section, but the defaults are configured to create a minimal amount of site breakage. And if that do happen, you will get clear instructions in the loa about what to do.

The default configuration is listed below. Note that almost all of these options are regular expression _whitelists_ (a string or a slice); the value `none` will block all.

```toml
[security]
  enableInlineShortcodes = false
  [security.exec]
    allow = ['^dart-sass-embedded$', '^go$', '^npx$', '^postcss$']
    osEnv = ['(?i)^(PATH|PATHEXT|APPDATA|TMP|TEMP|TERM)$']

  [security.funcs]
    getenv = ['^HUGO_']

  [security.http]
    methods = ['(?i)GET|POST']
    urls = ['.*']
```
2021-12-16 09:40:22 +01:00
Bjørn Erik Pedersen 4eb10c1a96 Set a sensible maxAge on the image cache 2021-12-12 15:18:21 +01:00
Bjørn Erik Pedersen 648598090e Configure image cache to use :cacheDir/images
That should make the Netlify builds faster, now that we don't store the images in Git anymore.
2021-12-11 15:45:23 +01:00
Bjørn Erik Pedersen 36a9e701ca docs: Adjust config docs 2021-08-03 12:22:02 +02:00
Bjørn Erik Pedersen bdaf7e0228 Release 0.81.0 2021-02-19 19:29:56 +01:00
Bjørn Erik Pedersen 9be494de3a Clean up the markup config 2020-05-31 12:41:38 +02:00
Bjørn Erik Pedersen c486747de6 Params cleanup 2020-01-23 16:12:24 +01:00
Bjørn Erik Pedersen ded74f0982 Add Goldmark as the new default markdown handler
This commit adds the fast and CommonMark compliant Goldmark as the new default markdown handler in Hugo.

If you want to continue using BlackFriday as the default for md/markdown extensions, you can use this configuration:

```toml
[markup]
defaultMarkdownHandler="blackfriday"
```

Fixes #5963
Fixes #1778
Fixes #6355
2019-11-23 14:12:24 +01:00
bmackinney 38a15e6f7d remove metaDataFormat from config.toml
and replace reference to the config in templates/introduction.md
2019-09-07 19:53:22 +02:00
Bjørn Erik Pedersen b294048e9b Make it a Hugo Module 2019-07-29 10:12:14 +02:00
Bjørn Erik Pedersen 3fdb45b3cd docs: Add Hugo Modules docs 2019-07-25 13:21:30 +02:00
Bjørn Erik Pedersen af82c56c51 config: Remove superflous param 2019-03-21 09:13:16 +01:00
Shohei Ueda 00e4402605 Remove extra whitespace 2019-02-20 15:07:08 +01:00
Bjørn Erik Pedersen 6a2684fe4f Add the default cache configuration
So we can use it for testing.
2019-02-01 09:56:34 +01:00
Bjørn Erik Pedersen 320a0ac681 Refactor config below /config
See https://github.com/gohugoio/hugo/issues/5422
2018-12-24 08:36:16 +01:00