Documentation
¶
Overview ¶
Package client implements a small Airlock Digital REST API client.
Index ¶
- func BoolInt(v bool) string
- func IntString(v int64) string
- func Values(kv ...string) url.Values
- type APIError
- type Agent
- type Client
- func (c *Client) AddApplicationHash(ctx context.Context, applicationID string, hashes []string) error
- func (c *Client) AddBaselineHash(ctx context.Context, baselineID string, hashes []string) error
- func (c *Client) AddBlocklistHash(ctx context.Context, blocklistID string, hashes []string) error
- func (c *Client) AddGroupPath(ctx context.Context, groupID, path, comment string) error
- func (c *Client) AddGroupProcess(ctx context.Context, groupID, process, typ, comment string) error
- func (c *Client) AddGroupPublisher(ctx context.Context, groupID, publisher, comment string) error
- func (c *Client) AddRepositoryHashes(ctx context.Context, hashes []map[string]string) error
- func (c *Client) CreateApplication(ctx context.Context, name, version, categoryID string) (string, error)
- func (c *Client) CreateApplicationCategory(ctx context.Context, name, parentID string) (string, error)
- func (c *Client) CreateApplicationMetarule(ctx context.Context, body map[string]any) (string, error)
- func (c *Client) CreateBaseline(ctx context.Context, name string) (string, error)
- func (c *Client) CreateBlocklist(ctx context.Context, name string) (string, error)
- func (c *Client) CreateBlocklistMetarule(ctx context.Context, body map[string]any) (string, error)
- func (c *Client) CreateGroup(ctx context.Context, name, parent string, hidden bool) (string, error)
- func (c *Client) DeleteApplication(ctx context.Context, id string) error
- func (c *Client) DeleteApplicationCategory(ctx context.Context, id string) error
- func (c *Client) DeleteApplicationMetarule(ctx context.Context, id string) error
- func (c *Client) DeleteBaseline(ctx context.Context, id string) error
- func (c *Client) DeleteBlocklist(ctx context.Context, id string) error
- func (c *Client) DeleteBlocklistMetarule(ctx context.Context, id string) error
- func (c *Client) DeleteGroup(ctx context.Context, id string) error
- func (c *Client) ExportApplication(ctx context.Context, applicationID string) ([]byte, error)
- func (c *Client) ExportBaseline(ctx context.Context, baselineID string) ([]byte, error)
- func (c *Client) ExportBlocklist(ctx context.Context, blocklistID string) ([]byte, error)
- func (c *Client) FindAgents(ctx context.Context, params url.Values) ([]Agent, error)
- func (c *Client) GetAgent(ctx context.Context, agentID string) (Agent, bool, error)
- func (c *Client) GetGroupPolicy(ctx context.Context, groupID string) (*Policy, error)
- func (c *Client) GetGroupPolicyRaw(ctx context.Context, groupID string) (map[string]any, error)
- func (c *Client) ImportReferenceBaseline(ctx context.Context, name string) error
- func (c *Client) ListAgents(ctx context.Context) ([]Named, error)
- func (c *Client) ListApplicationCategories(ctx context.Context) ([]Named, error)
- func (c *Client) ListApplicationMetarules(ctx context.Context, applicationID string, includeCriteria bool) ([]Metarule, error)
- func (c *Client) ListApplications(ctx context.Context) ([]Named, error)
- func (c *Client) ListBaselines(ctx context.Context) ([]Named, error)
- func (c *Client) ListBlocklistMetarules(ctx context.Context, blocklistID string, includeCriteria bool) ([]Metarule, error)
- func (c *Client) ListBlocklists(ctx context.Context) ([]Named, error)
- func (c *Client) ListCommunicationLists(ctx context.Context) (json.RawMessage, error)
- func (c *Client) ListDomainGroups(ctx context.Context) ([]string, error)
- func (c *Client) ListGroupAgentsRaw(ctx context.Context, groupID string) (json.RawMessage, error)
- func (c *Client) ListGroups(ctx context.Context) ([]Named, error)
- func (c *Client) ListReferenceBaselines(ctx context.Context) ([]Named, error)
- func (c *Client) MoveAgent(ctx context.Context, agentID, groupID string) error
- func (c *Client) Post(ctx context.Context, path string, params url.Values, body any, out any) error
- func (c *Client) PostRaw(ctx context.Context, path string, params url.Values, body any) ([]byte, error)
- func (c *Client) QueryHashes(ctx context.Context, hashes []string) ([]HashQueryResult, error)
- func (c *Client) RemoveApplicationHash(ctx context.Context, applicationID string, hashes []string) error
- func (c *Client) RemoveBaselineHash(ctx context.Context, baselineID string, hashes []string) error
- func (c *Client) RemoveBlocklistHash(ctx context.Context, blocklistID string, hashes []string) error
- func (c *Client) RemoveGroupPath(ctx context.Context, groupID, path string) error
- func (c *Client) RemoveGroupProcess(ctx context.Context, groupID, process, typ string) error
- func (c *Client) RemoveGroupPublisher(ctx context.Context, groupID, publisher string) error
- func (c *Client) SetGroupApplication(ctx context.Context, groupID, applicationID string, approved bool) error
- func (c *Client) SetGroupBaseline(ctx context.Context, groupID, baselineID string, approved bool) error
- func (c *Client) SetGroupBlocklist(ctx context.Context, groupID, blocklistID string, approved bool, audit bool) error
- func (c *Client) UpdateApplicationMetaruleName(ctx context.Context, id, name string) error
- func (c *Client) UpdateBlocklistMetaruleName(ctx context.Context, id, name string) error
- func (c *Client) UpdateGroupSettings(ctx context.Context, settings map[string]any) error
- type Config
- type HashQueryResult
- type Metarule
- type Named
- type Policy
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIError ¶
APIError is returned for non-successful Airlock API calls. Response bodies are not included because they may contain environment data.
type Agent ¶ added in v0.1.2
type Agent struct {
AgentID string `json:"agentid"`
ClientVersion string `json:"clientversion"`
Domain string `json:"domain"`
FreeSpace string `json:"freespace"`
GroupID string `json:"groupid"`
Hostname string `json:"hostname"`
IP string `json:"ip"`
LocalIP string `json:"localip"`
LastCheckin string `json:"lastcheckin"`
OS string `json:"os"`
PolicyVersion string `json:"policyversion"`
Status any `json:"status"`
Username string `json:"username"`
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client talks to the Airlock Digital REST API.
func (*Client) AddApplicationHash ¶
func (*Client) AddBaselineHash ¶
func (*Client) AddBlocklistHash ¶
func (*Client) AddGroupPath ¶
func (*Client) AddGroupProcess ¶
func (*Client) AddGroupPublisher ¶
func (*Client) AddRepositoryHashes ¶ added in v0.1.0
func (*Client) CreateApplication ¶
func (*Client) CreateApplicationCategory ¶
func (*Client) CreateApplicationMetarule ¶ added in v0.1.0
func (*Client) CreateBaseline ¶
func (*Client) CreateBlocklist ¶
func (*Client) CreateBlocklistMetarule ¶ added in v0.1.0
func (*Client) CreateGroup ¶
func (*Client) DeleteApplication ¶
func (*Client) DeleteApplicationCategory ¶
func (*Client) DeleteApplicationMetarule ¶ added in v0.1.0
func (*Client) DeleteBaseline ¶
func (*Client) DeleteBlocklist ¶
func (*Client) DeleteBlocklistMetarule ¶ added in v0.1.0
func (*Client) ExportApplication ¶ added in v0.1.1
func (*Client) ExportBaseline ¶ added in v0.1.1
func (*Client) ExportBlocklist ¶ added in v0.1.1
func (*Client) FindAgents ¶ added in v0.1.2
func (*Client) GetGroupPolicy ¶
func (*Client) GetGroupPolicyRaw ¶ added in v0.1.0
func (*Client) ImportReferenceBaseline ¶ added in v0.1.0
func (*Client) ListApplicationCategories ¶
func (*Client) ListApplicationMetarules ¶ added in v0.1.0
func (*Client) ListApplications ¶
func (*Client) ListBlocklistMetarules ¶ added in v0.1.0
func (*Client) ListBlocklists ¶
func (*Client) ListCommunicationLists ¶ added in v0.1.0
func (*Client) ListDomainGroups ¶ added in v0.1.0
func (*Client) ListGroupAgentsRaw ¶ added in v0.1.0
func (*Client) ListReferenceBaselines ¶ added in v0.1.0
func (*Client) Post ¶
Post sends Airlock's POST-style API request. Parameters are encoded as query parameters unless body is non-nil.
func (*Client) PostRaw ¶ added in v0.1.1
func (c *Client) PostRaw(ctx context.Context, path string, params url.Values, body any) ([]byte, error)
PostRaw sends an Airlock POST request and returns the raw response body. Use this for documented non-JSON endpoints such as XML exports.
func (*Client) QueryHashes ¶ added in v0.1.0
func (*Client) RemoveApplicationHash ¶
func (*Client) RemoveBaselineHash ¶
func (*Client) RemoveBlocklistHash ¶
func (*Client) RemoveGroupPath ¶
func (*Client) RemoveGroupProcess ¶
func (*Client) RemoveGroupPublisher ¶
func (*Client) SetGroupApplication ¶
func (*Client) SetGroupBaseline ¶
func (*Client) SetGroupBlocklist ¶
func (*Client) UpdateApplicationMetaruleName ¶ added in v0.1.0
func (*Client) UpdateBlocklistMetaruleName ¶ added in v0.1.0
type Config ¶
type Config struct {
URL string
APIKey string
Insecure bool
UserAgent string
Timeout time.Duration
}
Config holds Airlock client configuration.
type HashQueryResult ¶ added in v0.1.0
type HashQueryResult struct {
Hash string `json:"hash"`
Data struct {
Applications []application `json:"applications"`
Baselines []baseline `json:"baselines"`
Blocklists []blocklist `json:"blocklists"`
} `json:"data"`
}
type Metarule ¶ added in v0.1.0
type Metarule struct {
ID string `json:"metaruleid"`
Name string `json:"name"`
OS string `json:"os"`
Criteria json.RawMessage `json:"criteria,omitempty"`
Settings json.RawMessage `json:"settings,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.