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

Added Access Control for Network Interface #683

Merged
merged 129 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
129 commits
Select commit Hold shift + click to select a range
66f41d8
Code move
OlivierHecart Oct 12, 2023
ec960ea
Code move
OlivierHecart Nov 2, 2023
939daa4
Use RoutingContext type
OlivierHecart Nov 2, 2023
6e1c124
Structs split
OlivierHecart Nov 7, 2023
239d8cb
Renaming
OlivierHecart Nov 7, 2023
b0f999b
Visibility
OlivierHecart Nov 7, 2023
2a5466b
Move ingress/egress filters out of pubsub
OlivierHecart Nov 13, 2023
0f2fa24
Make hat abstract
OlivierHecart Nov 15, 2023
002db77
Abstract missing close_face fn
OlivierHecart Nov 15, 2023
a33fcf1
Duplicate hat
OlivierHecart Nov 15, 2023
6b61780
Move Primitives
OlivierHecart Nov 16, 2023
0a76ae3
Move link_id into HatFace
OlivierHecart Nov 22, 2023
ef541d8
Change face initialization
OlivierHecart Nov 22, 2023
1755ba9
Interceptors
OlivierHecart Nov 22, 2023
cb693dc
Interceptor types renaming
OlivierHecart Nov 23, 2023
c520168
Rename RoutingContext
OlivierHecart Nov 23, 2023
a4a672e
Add RoutingContext and LoggerInterceptor
OlivierHecart Dec 1, 2023
59e8de7
Interceptors can access the Config at construction
OlivierHecart Dec 5, 2023
9c94df5
Split linkstate and p2p peer hats
OlivierHecart Dec 5, 2023
0096e59
Simplify HatTrait init function
OlivierHecart Dec 7, 2023
d4fac3d
Hats cleanup
OlivierHecart Dec 11, 2023
7c8732c
Reintroduce routes precomputation
OlivierHecart Dec 22, 2023
b2a7ee2
Improve routes precomputation
OlivierHecart Dec 22, 2023
43fcb78
Reintroduce matching pulls precomputation
OlivierHecart Dec 22, 2023
7cd513a
Perf improvements
OlivierHecart Jan 5, 2024
b530da2
Perf improvements
OlivierHecart Jan 5, 2024
05e9c3b
Merge branch 'master' into router-reorg
OlivierHecart Jan 9, 2024
d5fcdfa
Remove files wrongly reintroduced by merge
OlivierHecart Jan 9, 2024
331cb3f
Fix complete_n build
OlivierHecart Jan 9, 2024
458e64c
Remove useless checks
OlivierHecart Jan 9, 2024
b69ae82
Fix OAM handling
OlivierHecart Jan 10, 2024
60f0ed0
Remove commented code
OlivierHecart Jan 10, 2024
27e1974
Simplified routes computation hats api
OlivierHecart Jan 11, 2024
7cdfc44
Move matching pulls computation out of hats
OlivierHecart Jan 11, 2024
567feb9
Fix query routes update
OlivierHecart Jan 11, 2024
57a5d8f
Fix copy-paste error
OlivierHecart Jan 12, 2024
62049b1
Renaming
OlivierHecart Jan 15, 2024
a1301d5
Add missing query routes deactivations
OlivierHecart Jan 17, 2024
6d9f2f6
Refactor code
OlivierHecart Jan 17, 2024
7af8480
Improve perfromances
OlivierHecart Jan 18, 2024
d47b4fd
WIP: added pep pdp points
kauncoder Jan 26, 2024
c5579c9
WIP:added interceptor code and PEP logic
kauncoder Jan 26, 2024
99d1284
WIP:added datastructures for policy and PDP logic
kauncoder Jan 29, 2024
e11313f
WIP:first basic acl prototype
kauncoder Jan 30, 2024
74e12fd
WIP:first acl prototype
kauncoder Jan 30, 2024
e2a59c7
WIP:first acl prototype
kauncoder Jan 30, 2024
e4d1014
WIP:ACL phase 1
kauncoder Jan 31, 2024
b72d85e
WIP:ACL phase 1
kauncoder Feb 1, 2024
f7a26e2
WIP:Modified ACL for attributes
kauncoder Feb 8, 2024
f52d3cd
WIP:Modified ACL for attributes
kauncoder Feb 8, 2024
39a4f78
WIP:Cleaned code
kauncoder Feb 19, 2024
52baaf3
WIP:merging code
kauncoder Feb 19, 2024
b7f9c71
WIP:merging code
kauncoder Feb 19, 2024
45eac35
WIP:adding config conditions
kauncoder Feb 20, 2024
264f861
WIP:merging with DS
kauncoder Feb 20, 2024
7636090
WIP:moved rules into config file
kauncoder Feb 21, 2024
99c2efa
WIP:moved rules into config file
kauncoder Feb 21, 2024
50c9f0e
WIP:merging changes
kauncoder Feb 21, 2024
a8bb31e
Revert "WIP:merging changes"
kauncoder Feb 21, 2024
187c4cb
WIP:merging new changes
kauncoder Feb 21, 2024
a1fda63
WIP:merging new changes
kauncoder Feb 21, 2024
fd674e2
WIP:ACL with networkinterface
kauncoder Feb 28, 2024
1b4a949
WIP:ACL with networkinterface
kauncoder Feb 28, 2024
f933843
WIP:ACL with networkinterface
kauncoder Feb 28, 2024
fb83d00
WIP:ACL with networkinterface
kauncoder Feb 28, 2024
9257ac7
WIP:Added multi-interface funcionality
kauncoder Feb 29, 2024
3cb97d2
WIP: Improved code design for ACL
kauncoder Feb 29, 2024
9af653e
WIP: Modified for new config style
kauncoder Mar 1, 2024
c2e41a1
WIP: Modified for new config style
kauncoder Mar 1, 2024
47b2b9f
WIP: Added changes for default behaviour
kauncoder Mar 1, 2024
7cda036
WIP: Added changes for default behaviour
kauncoder Mar 3, 2024
2430355
WIP: Added changes for default behaviour
kauncoder Mar 3, 2024
7985826
WIP: Cleaning code
kauncoder Mar 4, 2024
c6378d1
WIP: Config changes after discussion
kauncoder Mar 5, 2024
a19608c
WIP: Config changes after discussion
kauncoder Mar 5, 2024
0a94a11
Merge branch 'main' into wip/authz/initial_modules
snehilzs Mar 5, 2024
6cd0c76
Merge branch 'eclipse-zenoh:main' into wip/authz/initial_modules
snehilzs Mar 6, 2024
23128e2
WIP: Adding Queryable
kauncoder Mar 6, 2024
f066a76
WIP: Adding key-expr caching
kauncoder Mar 8, 2024
152938d
Cleaning config file
kauncoder Mar 8, 2024
875977c
Merge branch 'main' into wip/authz/initial_modules
kauncoder Mar 26, 2024
7439dba
made review changes
kauncoder Mar 28, 2024
0a8bf04
made review changes
kauncoder Mar 28, 2024
87333fe
adding review changes for logs and removing bool values
kauncoder Mar 28, 2024
3b4091e
adding review changes
kauncoder Mar 28, 2024
c7d0475
adding actions for both ingress and egress
kauncoder Mar 29, 2024
e8ac3e6
adding ingress and egress flow
kauncoder Apr 2, 2024
af4141e
cleaning code
kauncoder Apr 2, 2024
74c58e5
adding tests
kauncoder Apr 3, 2024
eae9df7
cleaning policy code
kauncoder Apr 3, 2024
8e7ebf6
acl tests for queryable
kauncoder Apr 4, 2024
4a341e2
replaced nested Vec with structs
kauncoder Apr 4, 2024
fd9d0d9
fixed queryable test issue
kauncoder Apr 4, 2024
34db54e
fixed cache downcast error
kauncoder Apr 5, 2024
a02ffad
fixed interface issue in tests
kauncoder Apr 5, 2024
266d926
move acl config out of transport
kauncoder Apr 7, 2024
7eb121a
move acl config out of transport
kauncoder Apr 7, 2024
98a3704
clean tests code
kauncoder Apr 7, 2024
6881e6d
clean tests code
kauncoder Apr 7, 2024
f239a4d
clean config file
kauncoder Apr 7, 2024
fbfed48
clean config file
kauncoder Apr 7, 2024
4be148d
clean code
kauncoder Apr 8, 2024
fc4a66c
resolve conflicts
kauncoder Apr 8, 2024
eb9d40a
Merge branch 'main' into wip/authz/initial_modules
kauncoder Apr 8, 2024
d847de1
resolve conflicts issues
kauncoder Apr 8, 2024
73a5eaf
refactor code
kauncoder Apr 9, 2024
a63b460
refactor code
kauncoder Apr 9, 2024
aeda020
refactor code
kauncoder Apr 10, 2024
a8b88b6
refactor code for review changes
kauncoder Apr 10, 2024
88e1dff
refactor code for review changes
kauncoder Apr 10, 2024
00ccb40
fix acl tests issue
kauncoder Apr 10, 2024
b9832bf
fix acl tests issue
kauncoder Apr 10, 2024
76b7671
fix acl tests issue
kauncoder Apr 10, 2024
e2e2f90
fix acl tests issue
kauncoder Apr 11, 2024
92a0c1f
fix acl tests issue
kauncoder Apr 11, 2024
0788248
resolve merge conflicts
kauncoder Apr 11, 2024
5fd083b
resolve merge conflicts
kauncoder Apr 11, 2024
c24fbf5
Update DEFAULT_CONFIG.json5
snehilzs Apr 12, 2024
ea927a5
change acl to access_control for clarity
kauncoder Apr 15, 2024
8172dfb
fix: Remove sync-lockfiles workflow (#925)
fuzzypixelz Apr 11, 2024
3c70890
modify actions values in config file
kauncoder Apr 16, 2024
40a2020
remove [ACCESS LOG] string from the logs
kauncoder Apr 16, 2024
648ac09
Remove [ACCESS LOG] from logging
Mallets Apr 16, 2024
e3ef202
rework access control logging
Mallets Apr 16, 2024
93163f6
Add ingress/egress logs
Mallets Apr 16, 2024
79de84c
add interface name in access logs
kauncoder Apr 16, 2024
b9f7c3e
Fix log level
Mallets Apr 16, 2024
33ab251
Add missing header
Mallets Apr 16, 2024
b5617b7
Add missing header files
Mallets Apr 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions DEFAULT_CONFIG.json5
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,8 @@
// ],
// },
// ],
// /// configure acl rules
// acl: {
// /// configure access control (ACL) rules
// access_control: {
// ///[true/false] acl will be activated only if this is set to true
// "enabled": false,
// ///[deny/allow] default permission is deny (even if this is left empty or not specified)
Expand All @@ -186,12 +186,12 @@
// [
// {
// "actions": [
snehilzs marked this conversation as resolved.
Show resolved Hide resolved
// "put"
// put, get, declare_subscriber, declare_queryable
snehilzs marked this conversation as resolved.
Show resolved Hide resolved
// ],
// "flows":["egress","ingress"],
// "permission": "allow",
// "key_exprs": [
// "test/thr"
// "test/demo"
// ],
// "interfaces": [
// "lo0"
Expand Down
4 changes: 3 additions & 1 deletion commons/zenoh-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,9 @@ validated_struct::validator! {

/// Configuration of the downsampling.
downsampling: Vec<DownsamplingItemConf>,
pub acl: AclConfig {

///Configuration of the access control (ACL)
pub access_control: AclConfig {
pub enabled: bool,
pub default_permission: Permission,
pub rules: Option<Vec<AclConfigRules>>
Expand Down
2 changes: 1 addition & 1 deletion zenoh/src/net/routing/interceptor/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub(crate) fn interceptor_factories(config: &Config) -> ZResult<Vec<InterceptorF
// Uncomment to log the interceptors initialisation
// res.push(Box::new(LoggerInterceptor {}));
res.extend(downsampling_interceptor_factories(config.downsampling())?);
res.extend(acl_interceptor_factories(config.acl())?);
res.extend(acl_interceptor_factories(config.access_control())?);
Ok(res)
}

Expand Down
17 changes: 8 additions & 9 deletions zenoh/tests/acl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const KEY_EXPR: &str = "test/demo";
const VALUE: &str = "zenoh";

#[tokio::test(flavor = "multi_thread", worker_threads = 4)]
#[cfg(not(target_os = "windows"))]
async fn test_acl() {
zenoh_util::init_log_from_env();
test_pub_sub_deny().await;
Expand Down Expand Up @@ -56,7 +55,7 @@ async fn test_pub_sub_deny() {
let mut config_router = get_basic_router_config().await;
config_router
.insert_json5(
"acl",
"access_control",
r#"{
"enabled": true,
"default_permission": "deny",
Expand Down Expand Up @@ -104,7 +103,7 @@ async fn test_pub_sub_allow() {
let mut config_router = get_basic_router_config().await;
config_router
.insert_json5(
"acl",
"access_control",
r#"{

"enabled": false,
Expand Down Expand Up @@ -152,7 +151,7 @@ async fn test_pub_sub_allow_then_deny() {
let mut config_router = get_basic_router_config().await;
config_router
.insert_json5(
"acl",
"access_control",
r#"
{"enabled": true,
"default_permission": "allow",
Expand Down Expand Up @@ -212,7 +211,7 @@ async fn test_pub_sub_deny_then_allow() {
let mut config_router = get_basic_router_config().await;
config_router
.insert_json5(
"acl",
"access_control",
r#"
{"enabled": true,
"default_permission": "deny",
Expand Down Expand Up @@ -272,7 +271,7 @@ async fn test_get_qbl_deny() {
let mut config_router = get_basic_router_config().await;
config_router
.insert_json5(
"acl",
"access_control",
r#"{
"enabled": true,
"default_permission": "deny",
Expand Down Expand Up @@ -328,7 +327,7 @@ async fn test_get_qbl_allow() {
let mut config_router = get_basic_router_config().await;
config_router
.insert_json5(
"acl",
"access_control",
r#"{
"enabled": true,
"default_permission": "allow",
Expand Down Expand Up @@ -384,7 +383,7 @@ async fn test_get_qbl_deny_then_allow() {
let mut config_router = get_basic_router_config().await;
config_router
.insert_json5(
"acl",
"access_control",
r#"
{"enabled": true,
"default_permission": "deny",
Expand Down Expand Up @@ -455,7 +454,7 @@ async fn test_get_qbl_allow_then_deny() {
let mut config_router = get_basic_router_config().await;
config_router
.insert_json5(
"acl",
"access_control",
r#"
{"enabled": true,
"default_permission": "allow",
Expand Down