mozilla-services / websec-check

web security checklist for Firefox Services
Mozilla Public License 2.0
74 stars 17 forks source link

spec out expanded checklist item schema #15

Closed g-k closed 3 years ago

g-k commented 5 years ago

Discussed previously in https://github.com/mozilla-services/foxsec/pull/1169, but we want to support the user stories:

To support this I'm proposing a single directory (since each item can have many tags) items/ containing JSON files (probably as output of other tools or issue template) with an example:

{
  "tags": ["Dev", "VCS"], # array of strings we'll have to curate
  "id": "59966f75-fb3d-4f6c-ae5b-d38b919f3c7f", # UUIDv4
  "name": "trusted code hosting",
  "description": "Application built internally should be hosted in trusted GitHub organizations (mozilla, mozilla-services, mozilla-bteam, mozilla-conduit, mozilla-mobile, taskcluster). Sometimes we build and deploy applications we don't fully control. In those cases, the Dockerfile that builds the application container should be hosted in its own repository in a trusted organization.",
  "test_command": "python -c \"print(${repo_or_dockerfile_org} in 'mozilla,mozilla-services,mozilla-bteam,mozilla-conduit,mozilla-mobile,taskcluster'.split(','))\"",
  "extra_links": [
    "https://github.com/mozilla-services/github-management"
  ]
}

tools would be (in implementation order):

  1. a CLI tool (initially this can be a glorified shell script running jq for tag matches)
  2. an entirely static site like https://mozilla.github.io/server-side-tls/ssl-config-generator/
  3. an API-backed static site like https://starters.servo.org/
  4. output as a single or separate bugs (given a BMO API token or GH creds)
ajvb commented 5 years ago

@g-k Just came to this repo's issues page to create a ticket around the idea of adding id's that would allow for easier reference when discussing the checklist items.

As an example. if

Do not use target="_blank" in external links unless you also use rel="noopener noreferrer" (to prevent Reverse Tabnabbing)

was CI.7 (Common Issues, 7), it could allow for comments like:

@ajvb in regards to CI.7, are those commented out links something you plan on adding back? If so, they need the rel="noopener noreferrer" added to them

So if we want UUID id's for these checks, then it may also be nice to have "human id's" or similar.

g-k commented 4 years ago

Also, want different profiles for site security levels / risk profiles.

Links to relevant metrics on STMO.

g-k commented 4 years ago

Goals are:

The tool should take a directory or list of item files with:

and extract and convert metadata to JSON and generate alternative output formats for text e.g. converts text from markdown to HTML or .rst.

Then output as HTML, issues/bugs, etc.

A static site generator like Jekyll, Hyde, or Hugo might make sense for this.

g-k commented 4 years ago

metadata example: https://jekyllrb.com/docs/front-matter/