add 'cacheacl' auth type, dstaddr, dstport, dsthost, dstoper, srvaddr and srvport authcache types; allow to configure authcache by service

'auth cacheacl ...' is identical to 'auth cache ...' except ACL is not checked for cached authentication. dstaddr, dstport, dsthost and dstoper (operation) are intended to be used with cacheacl. For example

authcache user,ip,password,dstaddr 600
auth cacheacl iponly strong

allows user to access destination ip without ACL/password revalidation if he has cached attempt to the same ip from the same ip with the same username and password.

srvaddr, srvport are useful to only match with cached attempts to the same `internal` address / service port.
This commit is contained in:
Vladimir Dubrovin committed 2026-04-21 21:49:52 +03:00
1 parent bfbbf1f446
commit 4f0f3c81e1
5 files changed
+28 -11

No files matched your search

+4 -3
View File
@@ -843,7 +843,7 @@ int doauth(struct clientparam * param){
ac.sinsl_family = *SAFAMILY(&param->sinsl);
memcpy(ac.sinsl_addr, SAADDR(&param->sinsl), SAADDRLEN(&param->sinsl));
}
hashadd(&auth_table, param, &ac, conf.time + conf.authcachetime);
hashadd(&auth_table, param, &ac, conf.time + param->srv->authcachetime);
}
break;
}
@@ -971,13 +971,14 @@ struct auth authfuncs[] = {
{authfuncs+4, dnsauth, checkACL, "dnsname"},
{authfuncs+5, strongauth, checkACL, "strong"},
{authfuncs+6, cacheauth, checkACL, "cache"},
{authfuncs+7, cacheauth, NULL, "cacheacl"},
#ifndef NORADIUS
#define AUTHOFFSET 1
{authfuncs+7, radauth, checkACL, "radius"},
{authfuncs+8, radauth, checkACL, "radius"},
#else
#define AUTHOFFSET 0
#endif
{authfuncs+7+AUTHOFFSET, NULL, NULL, "none"},
{authfuncs+8+AUTHOFFSET, NULL, NULL, "none"},
{NULL, NULL, NULL, ""}
};