v1beta
Double column
curl
API
CLI

Services /

Update security rules

Updates the security rules for the given service.

URL parameters

    • project

      string required

      ID of the project

    • service

      string required

      ID of the service

Request attributes

  • object

    • credentials

      array required

      An array of credentials to access the service.

      • object

        • username

          string required

          The username to access the service

          pattern: ^[a-zA-Z0-9]+$

          min length: 3

          max length: 20

        • password

          string required

          The password to access the service with this username.

        • ports

          array

          An array of names of ports using these credentials

          • string

            The name of a port using these credentials

            pattern: ^[a-z0-9]+(-[a-z0-9]+)*$

            min length: 3

            max length: 20

        • type

          string required

          The type of authentication used

          one of: basic-auth

    • policies

      array required

      An array of IP address policies.

      • object

        • addresses

          array required

          An array of IP addresses used for this rule

          • string

            An IP address used by this rule

        • action

          string required

          The action for this rule.

          one of: ALLOW, DENY

        • ports

          array

          An array of names of ports using these credentials

          • string

            The name of a port using these credentials

            pattern: ^[a-z0-9]+(-[a-z0-9]+)*$

            min length: 3

            max length: 20

API
CLI

POST /v1beta/projects/{project}/services/{service}/security

Example request

request body

curl

curl --header "Content-Type: application/json" \
  --header "Authorization: Bearer NORTHFLANK_API_TOKEN" \
  --request POST \
  --data '{"credentials":[{"username":"admin","password":"password123","ports":["port-1"],"type":"basic-auth"}],"policies":[{"addresses":["127.0.0.1"],"action":"DENY","ports":["port-1"]}]}' \
  https://api.northflank.com/v1beta/projects/{project}/services/{service}/security

Example response

200 OK

success

Example response

404 Not Found

The security rules reference a port that does not exist on this service.

© 2021 Northflank Ltd. All rights reserved.

TermsPrivacy

contact@northflank.com