AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-428569

Little Code's questions

Martin Hope
Little Code
Asked: 2022-01-22 11:32:21 +0800 CST

nftables (nft) 链优先级问题

  • 1

nft让我头疼不已,无论我如何调整政策,我仍然无法让它发挥作用。

我想到的概念:

  • 一个存在通用规则的“基础”链(例如允许ssh等)
  • 一个或多个特定于守护程序特定规则所在的应用程序(例如 http 服务器链)

我尝试了许多不同的规则排列,但我永远无法同时获得“基础”+ 守护程序流量,我总是最终阻止其中一个!;-(

这是我当前的(简化的)配置(目前构成它允许ssh但不允许http)

/etc/nftables.conf:

#!/usr/sbin/nft -f                                                                                                                                                                                                                                              
flush ruleset                                                                                                                       
table inet filter {   
     counter input_ssh {}     
        set my_admin_ipv4 {                                                                                                        
                type ipv4_addr                                                                                                      
                flags interval                                                                                                      
                counter                                                                                                             
                elements = {                                                                                                        
                        10.0.0.0/8,                                                                                                 
                        172.16.0.0/12,                                                                                              
                        192.168.0.0/16                                                                                                                                                                                      
                }                                                                                                                   
        }         
       chain input {
                type filter hook input priority filter;
                iifname lo accept comment "Allow loopback traffic";
                ct state established,related accept comment "Allow established/related connections";
                ct state invalid drop comment "Deny invalid connections";

                # SSH
                tcp dport ssh ip saddr @my_admin_ipv4 counter name input_ssh accept comment "Allow IPv4 SSH from Admin";
    policy drop;
        }
        chain forward {
                type filter hook forward priority 0;
                policy drop;
        }
        chain output {
                type filter hook output priority 0;
        }
 include "/etc/nft/*.conf"
}

/etc/nft/http.conf:

counter input_http {} 
   chain http {
    type filter hook input priority filter - 1;
      # HTTP #
      tcp dport {80,443} counter name input_nginx accept comment "Allow HTTP";
    policy accept; 
    }
debian nftables
  • 1 个回答
  • 455 Views
Martin Hope
Little Code
Asked: 2020-11-18 04:21:07 +0800 CST

ssh-keygen:签名语法 - 选项需​​要帮助

  • 1

我正在尝试使用受限选项签署一些 SSH 密钥。

我最初的尝试如下:

ssh-keygen -s /path/to/ca-ssh.pem -D opensc-pkcs11.so -n barfoo -O no-agent-forwarding -O no-port-forwarding -O no-x11-forwarding -O no-user-rc -O no-pty -I foo -z 12345 /path/to/pub

然而,这会产生一个没有选项的结果:

    $ ssh-keygen -L -f
    Type: [email protected] user certificate                                                                                                                           
    Public key: ED25519-CERT SHA256:secretsquirrel                                                                                                      
    Signing CA: RSA SHA256: secretsquirrel                                                                                                                
    Key ID: "foo"                                                                                                                                        
    Serial: 12345                                                                                                                                                       
    Valid: forever                                                                                                                                                                    
    Principals:                                                                                                                                                                       
            barfoo                                                                                                                                                                       
    Critical Options: (none)                                                                                                                                                          
    Extensions: (none)  

首先,我想我会-O clear在其他选项之前添加。但这产生了同样的结果(none)。

所以我想我会尝试-O critical:no-agent-forwarding样式语法,但这会产生:

Critical Options:
        no-agent-forwarding UNKNOWN OPTION (len 0)

最后我尝试-O critical:no-agent-forwarding=true了,但这与UNKNOWN OPTION上面的结果相同。

没关系,但我使用的版本是:

  • Debian 10(破坏者)
  • OpenSSH_7.9p1 Debian-10+deb10u2,OpenSSL 1.1.1d 2019 年 9 月 10 日
debian ssh ssh-keys
  • 1 个回答
  • 202 Views
Martin Hope
Little Code
Asked: 2020-11-14 14:13:11 +0800 CST

LDIF 添加/替换语法?

  • 1

(slapd 2.4.47+dfsg-3+deb10u3 - 来自 Debian 10)

我已经搜索了有关此问题的先前答案,但是尽管遵循了建议(使用changetype: modify),但我仍然遇到问题。

问题是需要能够编写一个混合了新元素和需要修改的现有元素的 LDIF 文件。

但是,以下两种方法都不起作用。

dn: cn=config
add: olcTLSCACertificateFile
olcTLSCACertificateFile: foo
-
add: olcTLSCertificateFile
olcTLSCertificateFile: foo
-
add: olcTLSCertificateKeyFile
olcTLSCertificateKeyFile: foo
-
add: olcTLSCipherSuite
olcTLSCipherSuite: foo
-
add: olcTLSVerifyClient
olcTLSVerifyClient: foo

运行时ldapmodify -Y EXTERNAL -H ldapi:/// -f /etc/myconfigs/ldifs/certs.ldif"会出现以下错误:

          SASL/EXTERNAL authentication started                                                                                                                                      
          SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth                                                                                                    
          SASL SSF: 0                                                                                                                                                               
          ldap_modify: Inappropriate matching (18)                                                                                                                                  
                additional info: modify/add: olcTLSCACertificateFile: no equality matching rule  

如果我再适应一种replace风格:

dn: cn=config
changetype: modify
replace: olcTLSCACertificateFile
olcTLSCACertificateFile: foo
-
replace: olcTLSCertificateFile
olcTLSCertificateFile: foo
-
replace: olcTLSCertificateKeyFile
olcTLSCertificateKeyFile: foo
-
replace: olcTLSCipherSuite
olcTLSCipherSuite: foo
-
replace: olcTLSVerifyClient
olcTLSVerifyClient: foo

错误变为:

SASL/EXTERNAL authentication started
SASL username: gidNumber=0+uidNumber=0,cn=peercred,cn=external,cn=auth
SASL SSF: 0
ldap_modify: Other (e.g., implementation specific) error (80)

“如果不存在则添加,如果存在则替换”的正确语法是什么?

openldap
  • 1 个回答
  • 1866 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve