Skip to content

Commit

Permalink
fix: the directory is called base not base kinds (#209)
Browse files Browse the repository at this point in the history
  • Loading branch information
aquamatthias authored Oct 11, 2024
1 parent 6d1e190 commit 30aac39
Show file tree
Hide file tree
Showing 66 changed files with 1,335 additions and 1,331 deletions.
2 changes: 1 addition & 1 deletion docs/inventory-graph/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ The kind of resource is defined in the `kind` property of the resource.

</ZoomPanPinch>

The same resource can adhere to multiple resource kinds. This makes it possible to allow to view the same resource in more than one way. For example, an AWS EC2 volume can be viewed as [`aws_ec2_volume`](../resources/aws/ec2/aws_ec2_volume.mdx), as compute [`volume`](../resources/base-kinds/volume.mdx), as `aws_resource` and as [`resource`](../resources/index.mdx#resource-base-kind).
The same resource can adhere to multiple resource kinds. This makes it possible to allow to view the same resource in more than one way. For example, an AWS EC2 volume can be viewed as [`aws_ec2_volume`](../resources/aws/ec2/aws_ec2_volume.mdx), as compute [`volume`](../resources/base/volume.mdx), as `aws_resource` and as [`resource`](../resources/index.mdx#resource-base-kind).

This is useful if you want to search the graph using more abstract concepts. For example, it allows for the selection of all volumes regardless of cloud provider.

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
16 changes: 8 additions & 8 deletions docs/resources/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ import { useCurrentSidebarCategory } from '@docusaurus/theme-common';

When working with multiple clouds, it can be tedious to what resource kinds and attributes are named. To implement org policies (such as "no unencrypted storage volumes" or "every compute instance must have a cost center tag"), you don't want to rewrite those checks for every cloud provider.

While Fix Security has knowledge of cloud-specific resource kinds like [`aws_ec2_volume`](./aws/ec2/aws_ec2_volume.mdx) and [`gcp_disk`](./gcp/compute/gcp_disk.mdx), both of those kinds inherit from the base [`volume`](./base-kinds/volume.mdx) kind, which in turn inherits from the [`resource` base kind](#resource-base-kind):
While Fix Security has knowledge of cloud-specific resource kinds like [`aws_ec2_volume`](./aws/ec2/aws_ec2_volume.mdx) and [`gcp_disk`](./gcp/compute/gcp_disk.mdx), both of those kinds inherit from the base [`volume`](./base/volume.mdx) kind, which in turn inherits from the [`resource` base kind](#resource-base-kind):

- The `resource` kind defines basic attributes common to all resources (e.g., name, creation time, etc.).

- The [`volume`](./base-kinds/volume.mdx) kind defines properties that are common to most storage volumes.
- The [`volume`](./base/volume.mdx) kind defines properties that are common to most storage volumes.

- The [`aws_ec2_volume`](./aws/ec2/aws_ec2_volume.mdx) and [`gcp_disk`](./gcp/compute/gcp_disk.mdx) kinds define properties that are specific to AWS and Google Cloud, respectively.

The information whether a volume is encrypted or not comes from a boolean of the [`volume`](./base-kinds/volume.mdx) kind.
The information whether a volume is encrypted or not comes from a boolean of the [`volume`](./base/volume.mdx) kind.

When searching for unencrypted volumes, `search is(volume) and encrypted = false` will find _any_ unencrypted volume, no matter which cloud they were created in.

Expand All @@ -28,7 +28,7 @@ At the same time, you can still search by cloud provider-specific properties (e.

Fix Security has built-in support for resource types from AWS and Google Cloud.

<DocCardList items={useCurrentSidebarCategory().items.filter((item) => !item.href?.includes("base-kinds"))} />
<DocCardList items={useCurrentSidebarCategory().items.filter((item) => !item.href?.includes("base"))} />

## `resource` base kind

Expand All @@ -55,7 +55,7 @@ Every resource in Fix Security has the `resource` base kind as its root.
Fix Security also introduces abstract model classes for different resource types, making it easy to query and reason about common data.

<DocCardList items={[
{type: 'link', href: '/resources/base-kinds', label: 'Base kinds', docId: 'resources/base-kinds/index'}
{type: 'link', href: '/resources/base', label: 'Base kinds', docId: 'resources/base/index'}
]} />

<details>
Expand All @@ -67,13 +67,13 @@ Fix Security also introduces abstract model classes for different resource types

</ZoomPanPinch>

- **[`aws_ec2_volume`](./aws/ec2/aws_ec2_volume.mdx) inherits from the base [`volume`](./base-kinds/volume.mdx) kind, which itself inherits all properties from `resource`.**
- **[`aws_ec2_volume`](./aws/ec2/aws_ec2_volume.mdx) inherits from the base [`volume`](./base/volume.mdx) kind, which itself inherits all properties from `resource`.**

As such, [`aws_ec2_volume`](./aws/ec2/aws_ec2_volume.mdx) has all properties of [`volume`](./base-kinds/volume.mdx) and `resource`, in addition to its own properties:
As such, [`aws_ec2_volume`](./aws/ec2/aws_ec2_volume.mdx) has all properties of [`volume`](./base/volume.mdx) and `resource`, in addition to its own properties:

![aws_ec2_volume Example Data](./img/ec2_volume_example.svg)

- **[`gcp_disk`](./gcp/compute/gcp_disk.mdx) is also a [`volume`](./base-kinds/volume.mdx).**
- **[`gcp_disk`](./gcp/compute/gcp_disk.mdx) is also a [`volume`](./base/volume.mdx).**

A [Google Cloud Disk resource](https://cloud.google.com/compute/docs/reference/rest/v1/disks) is conceptually similar to an AWS EC2 Volume and the two resource types have many properties in common.

Expand Down
2 changes: 1 addition & 1 deletion tools/export_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def base_diagram(name: str) -> str:
f"Create provider file: {source} with {len(kinds_by_source[source])} service kinds"
)
if source == "base":
provider_md("base-kinds", items, base_diagram)
provider_md(source, items, base_diagram)
else:
provider_md(source, items, class_diagram, relationship=relationship_diagram, hierarchy=hierarchy_diagram)

Expand Down
Loading

0 comments on commit 30aac39

Please sign in to comment.