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

Support multiple keys for key rotation #278

Merged
merged 37 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
1e8fbb6
Add multiple keys to prefix transport
mingyech Sep 16, 2024
c2fd786
Fix test
mingyech Sep 16, 2024
e1b9723
Support multiple keys in decoy reg detector
mingyech Sep 16, 2024
7b1d2ce
Fix tapdance lib linking issue
mingyech Sep 19, 2024
37be998
Fix more build test issues
mingyech Sep 19, 2024
43ef867
Rm unneed line
mingyech Sep 19, 2024
ef41a20
Fix test payload
mingyech Sep 20, 2024
5ee30ba
Add more tests
mingyech Sep 20, 2024
ace9d11
More tests
mingyech Sep 20, 2024
434b45c
Mv vars
mingyech Sep 20, 2024
00efa8a
Add shared secret in test
mingyech Sep 20, 2024
80af092
Parse multiple keys in application
mingyech Oct 1, 2024
18b38c8
Read multiple keys in detector
mingyech Oct 2, 2024
95eaaba
Update makefile
mingyech Oct 2, 2024
6404610
Fix c rust parsing glue code
mingyech Oct 15, 2024
2507c9b
Fix numkeys
mingyech Oct 15, 2024
243aa5c
Fix more numkeys
mingyech Oct 15, 2024
db64c94
Fix more numkeys
mingyech Oct 15, 2024
c05c018
Fix typos
mingyech Oct 15, 2024
c3bff8d
Fix numkeys deref
mingyech Oct 15, 2024
5aadf88
Allow file or directory
mingyech Oct 18, 2024
9a1a671
Upd error msg
mingyech Oct 18, 2024
3afad8e
Fix numkeys
mingyech Oct 18, 2024
c7bd7ea
Add dbg print
mingyech Oct 20, 2024
a7fac13
Add dbg print
mingyech Oct 20, 2024
3581392
dbg
mingyech Oct 20, 2024
47a7e8f
dbg
mingyech Oct 20, 2024
7a39218
Rm dbg print
mingyech Oct 20, 2024
7079d1f
Add dbg print
mingyech Oct 20, 2024
875e784
Test & dbg print
mingyech Oct 21, 2024
c5332bd
Fix prefix auth w multiple keys
mingyech Oct 21, 2024
efee066
fix
mingyech Oct 21, 2024
9a870c2
Rm unused lines
mingyech Oct 22, 2024
67687d7
Fix build.rs
mingyech Oct 22, 2024
3828903
Fix lint
mingyech Oct 22, 2024
f3e4498
Fix clippy err
mingyech Oct 22, 2024
a1901d0
Fix pfring zc interface name bug
mingyech Oct 22, 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
15 changes: 14 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,20 @@ extern crate cc;

fn main() {
cc::Build::new()
.file("libtapdance/tapdance.c")
.files(&[
"libtapdance/tapdance.c",
"libtapdance/ssl_api.c",
"libtapdance/elligator2.c",
"libtapdance/curve25519-donna-c64.c",
"libtapdance/loadkey.c",
"libtapdance/tapdance_rst_spoof.c",
"libtapdance/tapdance_rust_util.c",
])
.include("src")
.compile("libtapdance.a");

println!("cargo:rustc-link-lib=tapdance");
println!("cargo:rustc-link-search=libtapdance");
println!("cargo:rustc-link-lib=gmp");
println!("cargo:rustc-link-lib=crypto");
}
26 changes: 13 additions & 13 deletions cmd/application/app_config.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@

## ------ Application General ------

# Absolute path to private key to use when authenticating with servers.
# Absolute path to private key to use when authenticating with clients.
# Can be either privkey or privkey || pubkey; only first 32 bytes will
# be used. If this is blank then the environment variable CJ_PRIVKEY
# which is defined in conjure.conf will be used (if that fails to parse
# the station will shutdown).
privkey_path = ""

# Same as privkey but used for zmq auth
zmq_privkey_path = ""

# Log level, one of the following: info, error, warn, debug, trace
log_level = "error"

Expand Down Expand Up @@ -60,13 +63,13 @@ ingest_worker_count = 100
# be othewise firewalled.
covert_blocklist_domains = ["localhost"]
covert_blocklist_subnets = [
"127.0.0.1/32", # localhost ipv4
"10.0.0.0/8", # reserved ipv4
"172.16.0.0/12", # reserved ipv4
"192.168.0.0/16", # reserved ipv4
"fc00::/7 ", # private network ipv6
"fe80::0/16", # link local ipv6
"::1/128", # localhost ipv6
"127.0.0.1/32", # localhost ipv4
"10.0.0.0/8", # reserved ipv4
"172.16.0.0/12", # reserved ipv4
"192.168.0.0/16", # reserved ipv4
"fc00::/7 ", # private network ipv6
"fe80::0/16", # link local ipv6
"::1/128", # localhost ipv6
]

# Automatically add all addresses and subnets associated with local devices to
Expand All @@ -81,16 +84,13 @@ covert_allowlist_subnets = []
# If a registration is received and the phantom address is in one of these
# subnets the registration will be dropped. This allows us to exclude subnets to
# prevent stations from interfering.
phantom_blocklist = [ ]
phantom_blocklist = []

# List of addresses to filter out traffic from the detector. The primary functionality
# of this is to prevent liveness testing from other stations in a conjure cluster from
# clogging up the logs with connection notifications. To accomplish this goal add all station
# ip addresses to this list when configuring station detectors.
detector_filter_list = [
"127.0.0.1",
"::1",
]
detector_filter_list = ["127.0.0.1", "::1"]

## ------ GeoIP Info ------

Expand Down
7 changes: 6 additions & 1 deletion cmd/application/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@ func main() {
logger.Fatalf("error parseing private key: %s", err)
}

zmqPrivKey, err := conf.ParseZMQPrivateKey()
if err != nil {
logger.Fatalf("error parseing private key: %s", err)
}

var prefixTransport cj.Transport
if conf.DisableDefaultPrefixes {
prefixTransport, err = prefix.New(privkey, conf.PrefixFilePath)
Expand All @@ -130,7 +135,7 @@ func main() {
ctx, cancel := context.WithCancel(context.Background())
wg := new(sync.WaitGroup)
regChan := make(chan interface{}, 10000)
zmqIngester, err := cj.NewZMQIngest(zmqAddress, regChan, privkey, conf.ZMQConfig)
zmqIngester, err := cj.NewZMQIngest(zmqAddress, regChan, zmqPrivKey, conf.ZMQConfig)
if err != nil {
logger.Fatal("error creating ZMQ Ingest: %w", err)
}
Expand Down
Loading
Loading