Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add auditing operating user guider #313

Merged
merged 2 commits into from
Oct 11, 2020

Conversation

wanjunlei
Copy link
Contributor

Signed-off-by: wanjunlei wanjunlei@yunify.com

@wanjunlei
Copy link
Contributor Author

wanjunlei commented Sep 24, 2020

/assign @FeynmanZhou
/assign @Sherlock113

@ks-ci-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wanjunlei
To complete the pull request process, please assign rayzhou2017
You can assign the PR to them by writing /assign @rayzhou2017 in a comment when ready.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ks-ci-bot ks-ci-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 24, 2020
Copy link
Contributor

@Sherlock113 Sherlock113 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please have a look at my comments and make changes. Please resolve the conflict as well. Thanks.

weight: 300
---

KubeSphere Auditing Logs provides a security-relevant chronological set of records documenting the sequence of activities that have affected the system by individual users, administrators, or other components of the system. Each request to KubeSphere generates an event that is then written to a webhook and processed according to a certain rule. According to different rules, the event will be ignored, stored, or generated an alert.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

->
KubeSphere Auditing Logs provide a security-relevant chronological set of records documenting the sequence of activities that have affected the system by individual users, administrators, or other components of the system. Each request to KubeSphere generates an event that is then written to a webhook and processed according to a certain rule. The event will be ignored, stored, or generate an alert based on different rules.


### Receive auditing log from KubeSphere

KubeSphere Auditing Logs can receive auditing logs form KubeSphere and Kubernetes. By default, KubeSphere Auditing Logs only receives auditing logs from KubeSphere.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

->
KubeSphere Auditing Log system receives auditing logs only from KubeSphere by default, while it can also receive auditing logs from Kubernetes.


KubeSphere Auditing Logs can receive auditing logs form KubeSphere and Kubernetes. By default, KubeSphere Auditing Logs only receives auditing logs from KubeSphere.

User can stop receive auditing logs from KubeSphere by changing the value of 'auditing.enable' in ConfigMap `kubesphere-config` in the namespace `kubesphere-system` using the following command,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User can stop receive
->
User can stop receiving

kubectl edit cm -n kubesphere-system kubesphere-config
```

change the value of `auditing.enabled` as false to stop receive auditing logs from KubeSphere.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

->
Change the value of auditing.enabled as false to stop receiving auditing logs from KubeSphere.


> Note that this action will restart the Kubernetes apiserver.

The `audit-policy.yaml` define rules about what events should be recorded and what data they should include. You can use a minimal audit policy file to log all requests at the Metadata level:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The audit-policy.yaml define rules about
->
The audit-policy.yaml defines rules about

macro: ObjectRef.Resource="pods"
```

> `Macro` can bu used in rules or other macros like ${pod} or ${alerting-rule.pod}. The difference between these two methods is, ${pod} only can be used in the CRD Rule `alerting-rule`, ${alerting-rule.pod} can be used in all CRD Rule. It is also applied to lists and alias.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

->
Macro can be used in rules or other macros like ${pod} or ${alerting-rule.pod}. The difference between these two methods is that ${pod} only can be used in the CRD Rule alerting-rule, while ${alerting-rule.pod} can be used in all CRD Rules. It also applies to lists and alias.

> `Macro` can bu used in rules or other macros like ${pod} or ${alerting-rule.pod}. The difference between these two methods is, ${pod} only can be used in the CRD Rule `alerting-rule`, ${alerting-rule.pod} can be used in all CRD Rule. It is also applied to lists and alias.

#### List
`List` is collections of items that can be included in rules, macros, or other lists. Unlike rules and macros, lists cannot be parsed as filtering expressions. Here¡¯s an example of a list.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

->
A list is a collection of items that can be included in rules, macros, or other lists. Unlike rules and macros, lists cannot be parsed as filtering expressions. Here is an example of a list.

```

#### Alias
`Alias` is a short name of a filter field, it can be included in rules, macros, lists, and output string. Here¡¯s an example of an alias.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A alias is a short name of a filter field. It can be included in rules, macros, lists, and output strings. Here is an example of an alias.

```
Output: ${user} ${verb} a HostNetwork Pod ${name} in ${namespace}.
```
> The field of the user, verb, namespace, name all are alias.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

->
The fields of user, verb, namespace, and name are all aliases.


### KubeSphere Auditing Logs Query

KubeSphere supports auditing logs query for tenant isolation. Use the `admin` account to log in KubeSphere, choose **Toolbox -> Auditing Operating**.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the account admin a must here? I reckon any account can use the query feature for auditing logs as long as the component is enabled in the cluster.

@Sherlock113
Copy link
Contributor

@wanjunlei Please resolve the conflict in content/en/docs/toolbox/_index.md.

@FeynmanZhou After the conflict is resolved, this pr can be merged if you do not have any questions.

Signed-off-by: wanjunlei <wanjunlei@yunify.com>
Signed-off-by: wanjunlei <wanjunlei@yunify.com>
@FeynmanZhou
Copy link
Member

@Sherlock113 @wanjunlei I assume this document can be split into three or four individual guides, it is not friendly that make three or four topics in a single long page. I will merge it first then @Sherlock113 help us to split and wording it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dco-signoff: yes size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants