Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
4d046a2e
Commit
4d046a2e
authored
Jan 25, 2021
by
Lindsay Kerr
Committed by
Kushal Pandya
Jan 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct preview for egress & ingress `deny all` policy which incorrectly reports `allow all`
parent
4e1d6192
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
17 deletions
+22
-17
changelogs/unreleased/270130-policy-preview-for-egress-deny-all-reports-egress-allow-all.yml
...-preview-for-egress-deny-all-reports-egress-allow-all.yml
+5
-0
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/lib/humanize.js
...hreat_monitoring/components/policy_editor/lib/humanize.js
+2
-2
ee/spec/frontend/threat_monitoring/components/policy_editor/lib/humanize_spec.js
..._monitoring/components/policy_editor/lib/humanize_spec.js
+9
-9
locale/gitlab.pot
locale/gitlab.pot
+6
-6
No files found.
changelogs/unreleased/270130-policy-preview-for-egress-deny-all-reports-egress-allow-all.yml
0 → 100644
View file @
4d046a2e
---
title
:
Correct the egress 'deny all' policy preview from Allow to Deny
merge_request
:
52370
author
:
type
:
fixed
ee/app/assets/javascripts/threat_monitoring/components/policy_editor/lib/humanize.js
View file @
4d046a2e
...
...
@@ -129,10 +129,10 @@ export default function humanizeNetworkPolicy(policy) {
const
template
=
direction
===
RuleDirectionInbound
?
s__
(
'
NetworkPolicies|
Allow
all inbound traffic to %{selector} from %{ruleSelector} on %{ports}
'
,
'
NetworkPolicies|
Deny
all inbound traffic to %{selector} from %{ruleSelector} on %{ports}
'
,
)
:
s__
(
'
NetworkPolicies|
Allow
all outbound traffic from %{selector} to %{ruleSelector} on %{ports}
'
,
'
NetworkPolicies|
Deny
all outbound traffic from %{selector} to %{ruleSelector} on %{ports}
'
,
);
const
ruleSelector
=
humanizeNetworkPolicyRule
(
rule
);
const
ports
=
humanizeNetworkPolicyRulePorts
(
rule
);
...
...
ee/spec/frontend/threat_monitoring/components/policy_editor/lib/humanize_spec.js
View file @
4d046a2e
...
...
@@ -36,7 +36,7 @@ describe('humanizeNetworkPolicy', () => {
it
(
'
returns policy description
'
,
()
=>
{
expect
(
humanizeNetworkPolicy
(
policy
)).
toEqual
(
'
Allow
all inbound traffic to <strong>all</strong> pods
'
+
'
Deny
all inbound traffic to <strong>all</strong> pods
'
+
'
from <strong>all</strong> pods
'
+
'
on <strong>any</strong> port
'
,
);
...
...
@@ -50,7 +50,7 @@ describe('humanizeNetworkPolicy', () => {
it
(
'
returns policy description
'
,
()
=>
{
expect
(
humanizeNetworkPolicy
(
policy
)).
toEqual
(
'
Allow
all inbound traffic to pods <strong>[one: , two: another]</strong>
'
+
'
Deny
all inbound traffic to pods <strong>[one: , two: another]</strong>
'
+
'
from <strong>all</strong> pods
'
+
'
on <strong>any</strong> port
'
,
);
...
...
@@ -66,9 +66,9 @@ describe('humanizeNetworkPolicy', () => {
it
(
'
returns policy description
'
,
()
=>
{
expect
(
humanizeNetworkPolicy
(
policy
)).
toEqual
(
'
Allow
all inbound traffic to <strong>all</strong> pods from <strong>all</strong> pods on <strong>any</strong> port
'
+
'
Deny
all inbound traffic to <strong>all</strong> pods from <strong>all</strong> pods on <strong>any</strong> port
'
+
'
<br><br>AND<br><br>
'
+
'
Allow
all outbound traffic from <strong>all</strong> pods to <strong>all</strong> pods on <strong>any</strong> port
'
,
'
Deny
all outbound traffic from <strong>all</strong> pods to <strong>all</strong> pods on <strong>any</strong> port
'
,
);
});
});
...
...
@@ -81,7 +81,7 @@ describe('humanizeNetworkPolicy', () => {
it
(
'
returns policy description
'
,
()
=>
{
expect
(
humanizeNetworkPolicy
(
policy
)).
toEqual
(
'
Allow
all inbound traffic to <strong>all</strong> pods
'
+
'
Deny
all inbound traffic to <strong>all</strong> pods
'
+
'
from <strong>all</strong> pods
'
+
'
on ports <strong>80/TCP, 81/UDP</strong>
'
,
);
...
...
@@ -95,7 +95,7 @@ describe('humanizeNetworkPolicy', () => {
it
(
'
returns policy description
'
,
()
=>
{
expect
(
humanizeNetworkPolicy
(
policy
)).
toEqual
(
'
Allow
all inbound traffic to <strong>all</strong> pods
'
+
'
Deny
all inbound traffic to <strong>all</strong> pods
'
+
'
from pods <strong>[one: , two: another]</strong>
'
+
'
on <strong>any</strong> port
'
,
);
...
...
@@ -111,7 +111,7 @@ describe('humanizeNetworkPolicy', () => {
it
(
'
returns policy description
'
,
()
=>
{
expect
(
humanizeNetworkPolicy
(
policy
)).
toEqual
(
'
Allow
all inbound traffic to <strong>all</strong> pods
'
+
'
Deny
all inbound traffic to <strong>all</strong> pods
'
+
'
from <strong>host, world</strong>
'
+
'
on <strong>any</strong> port
'
,
);
...
...
@@ -127,7 +127,7 @@ describe('humanizeNetworkPolicy', () => {
it
(
'
returns policy description
'
,
()
=>
{
expect
(
humanizeNetworkPolicy
(
policy
)).
toEqual
(
'
Allow
all inbound traffic to <strong>all</strong> pods
'
+
'
Deny
all inbound traffic to <strong>all</strong> pods
'
+
'
from <strong>0.0.0.0/32, 1.1.1.1/24</strong>
'
+
'
on <strong>any</strong> port
'
,
);
...
...
@@ -143,7 +143,7 @@ describe('humanizeNetworkPolicy', () => {
it
(
'
returns policy description
'
,
()
=>
{
expect
(
humanizeNetworkPolicy
(
policy
)).
toEqual
(
'
Allow
all inbound traffic to <strong>all</strong> pods
'
+
'
Deny
all inbound traffic to <strong>all</strong> pods
'
+
'
from <strong>some-service.com, another-service.com</strong>
'
+
'
on <strong>any</strong> port
'
,
);
...
...
locale/gitlab.pot
View file @
4d046a2e
...
...
@@ -18809,12 +18809,6 @@ msgstr ""
msgid "NetworkPolicies|Allow"
msgstr ""
msgid "NetworkPolicies|Allow all inbound traffic to %{selector} from %{ruleSelector} on %{ports}"
msgstr ""
msgid "NetworkPolicies|Allow all outbound traffic from %{selector} to %{ruleSelector} on %{ports}"
msgstr ""
msgid "NetworkPolicies|Are you sure you want to delete this policy? This action cannot be undone."
msgstr ""
...
...
@@ -18833,6 +18827,12 @@ msgstr ""
msgid "NetworkPolicies|Delete policy: %{policy}"
msgstr ""
msgid "NetworkPolicies|Deny all inbound traffic to %{selector} from %{ruleSelector} on %{ports}"
msgstr ""
msgid "NetworkPolicies|Deny all outbound traffic from %{selector} to %{ruleSelector} on %{ports}"
msgstr ""
msgid "NetworkPolicies|Deny all traffic"
msgstr ""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment