Skip to content

Commit

Permalink
adding docs (#3)
Browse files Browse the repository at this point in the history
  • Loading branch information
Prateeknandle authored Sep 26, 2023
1 parent e3956ab commit 8d9950c
Show file tree
Hide file tree
Showing 25 changed files with 1,329 additions and 88 deletions.
26 changes: 13 additions & 13 deletions discoveryengine/examples/exampl-main.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
terraform {
required_providers {
accuknox = {
source = "terraform.example.com/local/accuknox"
source = "terraform.example.com/local/accuknox"
version = "1.0.0"
}
}
Expand All @@ -12,10 +12,10 @@ provider "accuknox" {

// resources

resource "accuknox_discovery_engine_discovered_policy" "dsp"{
name="autopol-system-3960684242"
namespace="wordpress-mysql"
policy= <<-EOT
resource "accuknox_discovery_engine_discovered_policy" "dsp" {
name = "autopol-system-3960684242"
namespace = "wordpress-mysql"
policy = <<-EOT
apiVersion: security.kubearmor.com/v1
kind: KubeArmorPolicy
metadata:
Expand Down Expand Up @@ -50,9 +50,9 @@ spec:
EOT
}

resource "accuknox_discovery_engine_enable_discovered_policy" "dsp_enable"{
name="autopol-system-3960684242"
namespace="wordpress-mysql"
resource "accuknox_discovery_engine_enable_discovered_policy" "dsp_enable" {
name = "autopol-system-3960684242"
namespace = "wordpress-mysql"
}

resource "accuknox_discovery_engine_configuration" "example_config" {
Expand Down Expand Up @@ -163,18 +163,18 @@ resource "accuknox_discovery_engine_configuration" "example_config" {

//data sources

data "accuknox_discovery_engine_discovered_policy" "dsp"{
name="autopol-system-3960684242"
namespace="wordpress-mysql"
data "accuknox_discovery_engine_discovered_policy" "dsp" {
name = "autopol-system-3960684242"
namespace = "wordpress-mysql"
}

output "dsp" {
value = data.accuknox_discovery_engine_discovered_policy.dsp.policy
}

data "accuknox_discovery_engine_configuration" "data_cm" {
name="discovery-engine-config"
namespace="accuknox-agents"
name = "discovery-engine-config"
namespace = "accuknox-agents"
}

output "data_cm" {
Expand Down
29 changes: 29 additions & 0 deletions docs/data-sources/discovery_engine_configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "accuknox_discovery_engine_configuration Data Source - terraform-provider-accuknox"
subcategory: "Discovery_Engine"
description: |-
Provides the current discovery engine's configuration
---

# accuknox_discovery_engine_configuration (Data Source)

This data source provides a mechanism to view the configuration of discovery engine.

## Example Usage

```
data "accuknox_discovery_engine_configuration" "data_cm" {
name="discovery-engine-config"
namespace="accuknox-agents"
}
output "data_cm" {
value = data.accuknox_discovery_engine_configuration.data_cm.data
}
```

### Required

- `name` (Required) Name of the policy.
- `namespace` (Required) Namespace of the policy.
29 changes: 29 additions & 0 deletions docs/data-sources/discovery_engine_discovered_policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "accuknox_discovery_engine_discovered_policy Data Source - terraform-provider-accuknox"
subcategory: "Discovery_Engine"
description: |-
Provides the discovered policy based on name and namespace.
---

# accuknox_discovery_engine_discovered_policy (Data Source)

This data source provides a mechanism to view the configuration of the discovered policy based on `name` and `namespace` provided.

## Example Usage

```
data "accuknox_discovery_engine_discovered_policy" "dsp"{
name="autopol-system-3960684242"
namespace="wordpress-mysql"
}
output "dsp" {
value = data.accuknox_discovery_engine_discovered_policy.dsp.policy
}
```

### Argument Reference

- `name` (Required) Name of the policy.
- `namespace` (Optional) Namespace of the policy. If not mentioned then it will be assummed as `default`.
28 changes: 28 additions & 0 deletions docs/data-sources/kubearmor_configuration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "accuknox_kubearmor_configuration Data Source - terraform-provider-accuknox"
subcategory: "kubearmor"
description: |-
Provides the kubearmor configuration based on name and namespace.
---

# accuknox_kubearmor_configuration (Data Source)

This data source provides a mechanism to view the kubearmor configuration based on `name` and `namespace` provided.

## Example Usage

```
data "accuknox_kubearmor_configuration" "data_cm" {
name="kubearmor-config"
namespace="kube-system"
}
output "data_cm" {
value = data.accuknox_kubearmor_configuration.data_cm.data
}
```
### Argument Reference

- `name` (Required) Name of the config map which stores the data. By default it is `kubearmor-config`.
- `namespace` (Optional) Namespace of the config map. By default it is `kube-system`.
27 changes: 27 additions & 0 deletions docs/data-sources/kubearmor_host_security_policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "accuknox_kubearmor_host_security_policy Data Source - terraform-provider-accuknox"
subcategory: "kubearmor"
description: |-
Provides the host security policy based on name.
---

# accuknox_kubearmor_host_security_policy (Data Source)

This data source provides a mechanism to view the configuration of the host security policy based on `name` provided.

## Example Usage

```
data "accuknox_kubearmor_host_security_policy" "host-policy" {
name="hsp-kubearmor-dev-proc-path-block"
}
output "host-policy" {
value = data.accuknox_kubearmor_host_security_policy.host-policy.policy
}
```

### Argument Reference

- `name` (Required) Name of the policy.
21 changes: 21 additions & 0 deletions docs/data-sources/kubearmor_installed_version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "accuknox_kubearmor_installed_version Data Source - terraform-provider-accuknox"
subcategory: "kubearmor"
description: |-
Provides the kubearmor installed version.
---

# accuknox_kubearmor_installed_version (Data Source)

This data source provides a mechanism to view the kubearmor installed version.

## Example Usage

```
data "accuknox_kubearmor_installed_version" "installed_version" {}
output "installed_version" {
value = data.accuknox_kubearmor_installed_version.installed_version.version
}
```
27 changes: 27 additions & 0 deletions docs/data-sources/kubearmor_namespace_posture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "accuknox_kubearmor_namespace_posture Data Source - terraform-provider-accuknox"
subcategory: "kubearmor"
description: |-
Provides the namespace posture based on name.
---

# accuknox_kubearmor_namespace_posture (Data Source)

This data source provides a mechanism to view the configuration of the namespace posture based on namespace name.

## Example Usage

```
data "accuknox_kubearmor_namespace_posture" "ns_ps" {
name="kube-system"
}
output "ns_ps" {
value = data.accuknox_kubearmor_namespace_posture.ns_ps.annotation
}
```

### Argument Reference

- `name` (Required) Namespace name.
27 changes: 27 additions & 0 deletions docs/data-sources/kubearmor_namespace_visibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "accuknox_kubearmor_namespace_visibility Data Source - terraform-provider-accuknox"
subcategory: "kubearmor"
description: |-
Provides the namespace posture based on name.
---

# accuknox_kubearmor_namespace_visibility (Data Source)

This data source provides a mechanism to view the configuration of the namespace visibility based on namespace name.

## Example Usage

```
data "accuknox_kubearmor_namespace_visibility" "ns_vs" {
name="kube-system"
}
output "ns_vs" {
value = data.accuknox_kubearmor_namespace_visibility.ns_vs.visibility
}
```

### Argument Reference

- `name` (Required) Namespace name.
21 changes: 21 additions & 0 deletions docs/data-sources/kubearmor_node.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "accuknox_kubearmor_node Data Source - terraform-provider-accuknox"
subcategory: "kubearmor"
description: |-
Provides the kubearmor node information.
---

# accuknox_kubearmor_node (Data Source)

This data source provides a mechanism to view the kubearmor node information.

## Example Usage

```
data "accuknox_kubearmor_node" "k_node" {}
output "k_node" {
value = data.accuknox_kubearmor_node.k_node.node_data
}
```
28 changes: 28 additions & 0 deletions docs/data-sources/kubearmor_security_policy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "accuknox_kubearmor_security_policy Data Source - terraform-provider-accuknox"
subcategory: "kubearmor"
description: |-
Provides the container security policy based on name and namespace.
---

# accuknox_kubearmor_security_policy (Data Source)

This data source provides a mechanism to view the configuration of the container security policy based on `name` and `namespace` provided.

## Example Usage

```
data "accuknox_kubearmor_security_policy" "pkg-mgmt" {
name="block-pkg-mgmt-tools-exec"
namespace="default"
}
output "sp" {
value = data.accuknox_kubearmor_security_policy.pkg-mgmt.policy
}
```
### Argument Reference

- `name` (Required) Name of the policy.
- `namespace` (Optional) Namespace of the policy. If not mentioned then it will be assummed as `default`.
21 changes: 21 additions & 0 deletions docs/data-sources/kubearmor_stable_version.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "accuknox_kubearmor_stable_version Data Source - terraform-provider-accuknox"
subcategory: "kubearmor"
description: |-
Provides the kubearmor stable version.
---

# accuknox_kubearmor_stable_version (Data Source)

This data source provides a mechanism to view the kubearmor stable version.

## Example Usage

```
data "accuknox_kubearmor_stable_version" "stable_version" {}
output "stable_version" {
value = data.accuknox_kubearmor_stable_version.stable_version.version
}
```
60 changes: 60 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
page_title: "Provider: Accuknox"
subcategory: ""
description: |-
The Accuknox provider is used to interact with the resources supported by KubeArmor and Discovery-Engine.
---

# Accuknox Provider

The Accuknox provider is used to interact with the resources supported by KubeArmor and Discovery-Engine.

Use the navigation to the left to read about the available resources.

## Example Usage

> As per the current version the provider section should be empty and no requirement for credentials to use Accuknox provider.
```terraform
terraform {
required_providers {
accuknox = {
source = "hashicorp/accuknox"
version = "1.0.0"
}
}
}
provider "accuknox" {
}
resource "accuknox_kubearmor_security_policy" "block-pkg-mgmt-tools-exec" {
policy= <<-EOT
apiVersion: security.kubearmor.com/v1
kind: KubeArmorPolicy
metadata:
name: block-pkg-mgmt-tools-exec
spec:
selector:
matchLabels:
app: nginx
process:
matchPaths:
- path: /usr/bin/apt
- path: /usr/bin/apt-get
action:
Block
EOT
}
```

## KubeArmor

[KubeArmor](https://docs.kubearmor.io/kubearmor/) is a cloud-native runtime security enforcement system that restricts the behavior (such as process execution, file access, and networking operations) of pods, containers, and nodes (VMs) at the system level. KubeArmor leverages Linux security modules (LSMs) such as AppArmor, SELinux, or BPF-LSM to enforce the user-specified policies. KubeArmor generates rich alerts/telemetry events with container/pod/namespace identities by leveraging eBPF.

## Discovery-Engine

Discovery Engine discovers the security posture for your workloads and auto-discovers the policy-set required to put the workload in least-permissive mode. The engine leverages the rich visibility provided by KubeArmor and Cilium to auto discover the systems and network security posture.
Loading

0 comments on commit 8d9950c

Please sign in to comment.