Mutation

upload_bcheck

Uploads a new bcheck.

Arguments

input: UploadBCheckInput!


Input Fields

filename(): String!
The name of the BCheck file.
script(): String!
The BCheck script itself.

Return Fields

bcheck(): BCheck!
The uploaded BCheck.

Example

Query
mutation UploadBCheck($input: UploadBCheckInput!) {
  upload_bcheck(input: $input) {
    bcheck {
      name
      description
      author
      tags
      uploaded_filename
      uploaded_by
    }
  }
}
Variables
{
  "input": {
    "filename": "exposed-git-repository.bcheck",
    "script": "metadata:\n    language: v2-beta\n    name: \"Exposed Git repository\"\n    description: \"Reports a .git directory that anyone can download\"\n    author: \"Example Security Team\"\n    tags: \"git\", \"information disclosure\"\n\ngiven host then\n    send request called check:\n        method: \"GET\"\n        path: \"/.git/HEAD\"\n\n    if {check.response.status_code} is \"200\" and \"ref: refs/heads/\" in {check.response.body} then\n        report issue:\n            severity: medium\n            confidence: firm\n            detail: \"The .git directory can be downloaded, which can expose the site's source code.\"\n            remediation: \"Block access to the .git directory on the web server.\"\n    end if\n"
  }
}
Result
{
  "data": {
    "upload_bcheck": {
      "bcheck": {
        "name": "Exposed Git repository",
        "description": "Reports a .git directory that anyone can download",
        "author": "Example Security Team",
        "tags": [
          "git",
          "information disclosure"
        ],
        "uploaded_filename": "exposed-git-repository.bcheck",
        "uploaded_by": "user1230"
      }
    }
  }
}