From a27d3c27d8a81a2d2b7300d6099e94a2bfb30123 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 9 Jul 2021 03:09:51 +0000 Subject: [PATCH] Add latest changes from gitlab-org/gitlab@master --- doc/development/audit_event_guide/index.md | 17 +++++++---------- doc/integration/security_partners/index.md | 6 ++++++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/doc/development/audit_event_guide/index.md b/doc/development/audit_event_guide/index.md index 0bff297f2a0..f809293df59 100644 --- a/doc/development/audit_event_guide/index.md +++ b/doc/development/audit_event_guide/index.md @@ -20,12 +20,11 @@ To instrument an audit event, the following attributes should be provided: | Attribute | Type | Required? | Description | |:-------------|:---------------------|:----------|:----------------------------------------------------| -| `name` | string | false | Action name to be audited. Used for error tracking | +| `name` | String | false | Action name to be audited. Used for error tracking | | `author` | User | true | User who authors the change | | `scope` | User, Project, Group | true | Scope which the audit event belongs to | | `target` | Object | true | Target object being audited | -| `ip_address` | IPAddr | false | Request IP address | -| `message` | string | true | Message describing the action | +| `message` | String | true | Message describing the action | ## How to instrument new Audit Events @@ -56,15 +55,14 @@ to both approvers and approval groups. In the initiating service ```ruby # in the initiating service audit_context = { - name: 'merge_approval_rule_updated', + name: 'update_merge_approval_rule', author: current_user, scope: project_alpha, target: merge_approval_rule, - ip_address: request.remote_ip, message: 'Attempted to update an approval rule' } -Gitlab::Audit::Auditor.audit(audit_context) do +::Gitlab::Audit::Auditor.audit(audit_context) do service.execute end ``` @@ -95,15 +93,14 @@ This method allows recording single audit event and involves fewer moving parts. ```ruby if merge_approval_rule.save audit_context = { - name: 'merge_approval_rule_created', + name: 'create_merge_approval_rule', author: current_user, scope: project_alpha, target: merge_approval_rule, - ip_address: request.remote_ip, message: 'Created a new approval rule' } - Gitlab::Audit::Auditor.audit(audit_context) + ::Gitlab::Audit::Auditor.audit(audit_context) end ``` @@ -114,7 +111,7 @@ The two ways we can instrument audit events have different flows. ### Using block to record multiple events We wrap the operation block in a `Gitlab::Audit::Auditor` which captures the -initial audit context (that is, `author`, `scope`, `target`, `ip_address`) object that are +initial audit context (that is, `author`, `scope`, `target`) object that are available at the time the operation is initiated. Extra instrumentation is required in the interacted classes in the chain with diff --git a/doc/integration/security_partners/index.md b/doc/integration/security_partners/index.md index 1cd14947e74..2b851b5f614 100644 --- a/doc/integration/security_partners/index.md +++ b/doc/integration/security_partners/index.md @@ -12,12 +12,18 @@ each security partner: +- [Accurics](https://readme.accurics.com/1409/) - [Anchore](https://docs.anchore.com/current/docs/using/integration/ci_cd/gitlab/) - [Bridgecrew](https://docs.bridgecrew.io/docs/integrate-with-gitlab-self-managed) - [Checkmarx](https://checkmarx.atlassian.net/wiki/spaces/SD/pages/1929937052/GitLab+Integration) +- [Deepfactor](https://docs.deepfactor.io/hc/en-us/articles/1500008981941) +- [GrammaTech](https://www.grammatech.com/codesonar-gitlab-integration) - [Indeni](https://indeni.com/doc-indeni-cloudrail/integrate-with-ci-cd/gitlab-instructions/) - [JScrambler](https://docs.jscrambler.com/code-integrity/documentation/gitlab-ci-integration) +- [Semgrep](https://semgrep.dev/for/gitlab) - [StackHawk](https://docs.stackhawk.com/continuous-integration/gitlab.html) +- [Venafi](https://marketplace.venafi.com/details/gitlab-ci-cd/) +- [Veracode](https://community.veracode.com/s/knowledgeitem/gitlab-ci-MCEKSYPRWL35BRTGOVI55SK5RI4A) - [WhiteSource](https://www.whitesourcesoftware.com/gitlab/)