conjur-policy-go

command module
v0.0.0-...-5fc5921 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

README

conjur-policy-go

The general goal is to be able to represent Conjur policy as objects in Go, and to be able to emit valid Conjur policy from objects in Go.

For this Go representation:

policy := PolicyBody{
  Policy{
   Id:    "dev",
   Owner: UserRef("admin"),
   Body: PolicyBody{
    Group{
     Id:    "bar",
     Owner: UserRef("foo"),
    },
    User{
     Id:    "foo",
     Owner: UserRef("admin"),
    },
   },
  },
  Policy{
   Owner: UserRef("admin"),
   Id:    "pcf/prod",
   Body: PolicyBody{
    Group{
     Id:    "bar",
     Owner: UserRef("foo"),
    },
    User{
     Id:    "foo",
     Owner: UserRef("admin"),
    },
   },
  },
 }

Outputs this YAML (and vice-versa):

- !policy
  id: dev
  owner: !user admin
  body:
    - !group
      id: bar
      owner: !user foo
    - !user
      id: foo
      owner: !user admin
- !policy
  id: pcf/prod
  owner: !user admin
  body:
    - !group
      id: bar
      owner: !user foo
    - !user
      id: foo
      owner: !user admin
Roadmap

What is needed to achieve feature parity with ruby implementation?

  • marshal models to YAML compliant with conjur syntax
  • unmarshal conjur syntax YAML to models
  • handle edge-cases (like empty policy)
  • special handling of inlined id on objects with single attribute
  • validate attribute duplications
  • provide negative test-cases (e.g. invalid syntax)
  • add license
  • provide docs
  • support for all entities policy statements
  • verify fields available on model entities
  • tag reference strong typing
  • annotations stronger typing - support for conjur based annotations
  • support inclusion of other yaml files

On another layer build on top of the parser

  • restricted_to support with CIDR validation
  • validate relative and absolute paths
  • dependency order resolution

To be confirmed

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL